Skip to content

Commit ea27c07

Browse files
Clarify code comments
1 parent 9ae4e6a commit ea27c07

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

server/src/main/java/org/elasticsearch/action/search/MultiSearchRequest.java

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,10 @@ public static void readMultiLineFormat(
171171
String searchType,
172172
Boolean ccsMinimizeRoundtrips,
173173
boolean allowExplicitIndex,
174+
/*
175+
* Refer to RestSearchAction#parseSearchRequest()'s JavaDoc to understand why this is an Optional
176+
* and what its values mean with respect to an endpoint's Cross Project Search status/support.
177+
*/
174178
Optional<Boolean> crossProjectEnabled
175179
) throws IOException {
176180
readMultiLineFormat(
@@ -202,6 +206,10 @@ public static void readMultiLineFormat(
202206
Boolean ccsMinimizeRoundtrips,
203207
boolean allowExplicitIndex,
204208
TriFunction<String, Object, SearchRequest, Boolean> extraParamParser,
209+
/*
210+
* Refer to RestSearchAction#parseSearchRequest()'s JavaDoc to understand why this is an Optional
211+
* and what its values mean with respect to an endpoint's Cross Project Search status/support.
212+
*/
205213
Optional<Boolean> crossProjectEnabled
206214
) throws IOException {
207215
int from = 0;
@@ -226,7 +234,11 @@ public static void readMultiLineFormat(
226234
if (searchType != null) {
227235
searchRequest.searchType(searchType);
228236
}
229-
// When crossProjectEnabled is true, ccsMinimizeRoundtrips is guaranteed to be true.
237+
/*
238+
* This `ccsMinimizeRoundtrips` refers to the value specified as the query parameter and is extracted in
239+
* `RestMultiSearchAction#parseMultiLineRequest()`. If in a Cross Project Search environment, it is
240+
* guaranteed to be `true`. Otherwise, its value is whatever that the user is provided.
241+
*/
230242
if (ccsMinimizeRoundtrips != null) {
231243
searchRequest.setCcsMinimizeRoundtrips(ccsMinimizeRoundtrips);
232244
}

0 commit comments

Comments
 (0)