Skip to content

Commit 60a197e

Browse files
Clarify code comment as per review suggestion
1 parent 75600cf commit 60a197e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1005,7 +1005,11 @@ static SearchResponse.Clusters reconcileProjects(
10051005
.map(Map.Entry::getKey)
10061006
.collect(Collectors.toSet());
10071007

1008-
// Same as we do in stateful right now.
1008+
/*
1009+
* We don't show any metadata in the response if there are no linked projects to search.
1010+
* In that case, it's alright to return `Clusters.EMPTY` and is in fact what we do in
1011+
* stateful, i.e. outside CPS.
1012+
*/
10091013
if (linkedProjectsWithResponses.isEmpty()) {
10101014
return SearchResponse.Clusters.EMPTY;
10111015
}

0 commit comments

Comments
 (0)