Skip to content
Advertisement

Implement Elasticsearch aggregation snd sort query using Java API and sort based on reversed

I have an Elasticsearch nested aggregation query(below), that I am trying to implement in Java using the Elasticsearch Java API. The query counts keywords and sorts using the reversed_nested _count. The query works in dev tools and partly Java, the only I can not sort using the Java API using the reversed_count.

JavaScript

How can I implement using the java API to sort using reversed_count? I have tried using BucketOrder.count button working.

Please help.

Thanks

JavaScript

ES Version: 7.10.6

Advertisement

Answer

I believe the error is that the reversed_count subAggs must be subaggregation of filter_products.

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement