You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using High Level Rest Client Java API to produce search query, using AggregationBuilders.topHits("th").sort("_score", SortOrder.DESC)
causes query to contain duplicate sort clauses:
Elasticsearch version 6.5.4, also current master
Description of the problem:
When using High Level Rest Client Java API to produce search query, using
AggregationBuilders.topHits("th").sort("_score", SortOrder.DESC)
causes query to contain duplicate sort clauses:
This also seems to break search, causing many scores to return as null.
It seems that this is because at the following locations ifs are missing their elses:
https://github.com/elastic/elasticsearch/blob/master/server/src/main/java/org/elasticsearch/search/aggregations/metrics/TopHitsAggregationBuilder.java#L233-L236
https://github.com/elastic/elasticsearch/blob/master/server/src/main/java/org/elasticsearch/search/aggregations/metrics/TopHitsAggregationBuilder.java#L250-L253
Simple work around is to use directly
AggregationBuilders.topHits("th").sort(SortBuilders.scoreSort().order(SortOrder.DESC))
.The text was updated successfully, but these errors were encountered: