TopHits aggregation in Java: tophits is always null in parsing response


(drjz) #1

Update: the error was on my side, please ignore. My apologies.

I have exactly copied the code here: https://www.elastic.co/guide/en/elasticsearch/client/java-api/current/_metrics_aggregations.html#java-aggs-metrics-tophits

When I try to get the Top Hits in "top", I get an empty TopHits objects. When I print out the response, I see the "top" as part of the JSON and it consists of hits. Is the documentation here still up to date? What can cause the top hits response parsing in Java getting null?


(system) #2