Skip to content

Commit c1e012d

Browse files
author
Junwei Dai
committed
bring back the constructor InternalSearchResponse and SearchResponseSections
Signed-off-by: Junwei Dai <[email protected]>
1 parent 1603f4e commit c1e012d

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed

server/src/main/java/org/opensearch/action/search/SearchResponseSections.java

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,29 @@ public SearchResponseSections(
121121
this.searchExtBuilders.addAll(Objects.requireNonNull(searchExtBuilders, "searchExtBuilders must not be null"));
122122
}
123123

124+
public SearchResponseSections(
125+
SearchHits hits,
126+
Aggregations aggregations,
127+
Suggest suggest,
128+
boolean timedOut,
129+
Boolean terminatedEarly,
130+
SearchProfileShardResults profileResults,
131+
int numReducePhases,
132+
List<SearchExtBuilder> searchExtBuilders
133+
) {
134+
this(
135+
hits,
136+
aggregations,
137+
suggest,
138+
timedOut,
139+
terminatedEarly,
140+
profileResults,
141+
numReducePhases,
142+
searchExtBuilders,
143+
Collections.emptyList()
144+
);
145+
}
146+
124147
public final boolean timedOut() {
125148
return this.timedOut;
126149
}

server/src/main/java/org/opensearch/search/internal/InternalSearchResponse.java

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,30 @@ public InternalSearchResponse(
111111
);
112112
}
113113

114+
public InternalSearchResponse(
115+
SearchHits hits,
116+
InternalAggregations aggregations,
117+
Suggest suggest,
118+
SearchProfileShardResults profileResults,
119+
boolean timedOut,
120+
Boolean terminatedEarly,
121+
int numReducePhases,
122+
List<SearchExtBuilder> searchExtBuilderList
123+
124+
) {
125+
super(
126+
hits,
127+
aggregations,
128+
suggest,
129+
timedOut,
130+
terminatedEarly,
131+
profileResults,
132+
numReducePhases,
133+
searchExtBuilderList,
134+
Collections.emptyList()
135+
);
136+
}
137+
114138
public InternalSearchResponse(StreamInput in) throws IOException {
115139
super(
116140
new SearchHits(in),

0 commit comments

Comments
 (0)