Skip to main content

All Questions

0 votes
1 answer
77 views

elasticsearch categorize_text aggregation sorting with sub top_hits aggregation

I have the following aggregation. But want I want is that the buckets inside the topClassificationGroup are also sorted with the same sort as the topHits. So the bucket containing the "best" ...
Stephan Zehnder's user avatar
0 votes
1 answer
2k views

Elasticsearch - Sort results of Terms aggregation by key string length

I am querying ES with a Terms aggregation to find the first N unique values of a string field foo where the field contains a substring bar, and the document matches some other constraints. Currently ...
AbrahamCoding's user avatar
0 votes
1 answer
51 views

ElasticSearch - Sort Buckets

My elasticSearch query is like: { "size": 0, "aggs": { "group_by_name": { "terms": { "field": "Infos....
FuSsA's user avatar
  • 4,297
2 votes
2 answers
2k views

Aggregation and Sorting in Elastic Search

I want to sort the Aggregated results of my query in elastic search Equivalent SQL query:- select col1, col2, sum(col3) from table group by col1,col2 order by sum(col3) desc; I tried with the below ...
Codinggeek's user avatar
0 votes
1 answer
270 views

Sort by date and number of writes by day in ElasticSearch (Secondary sort)

My index has two fields - updated which is a date field (eg. "2020-01-04T05:00:06.870000Z") numWrites which is a float I need a query that - sorts by date (YYYY-mm-dd) in descending order ...
user379151's user avatar
  • 1,389
1 vote
2 answers
2k views

How to get top 5 documents based on a stored field value in elasticsearch?

Example - test scores of one subject of students are stored in Elastic search index. Now I want to find top 5 students who scored highest in that subject.
S Khandelwal's user avatar
1 vote
0 answers
49 views

Elasticsearch document sorting based on nested values

I have the following data indexed in my elasticsearch version 7.4. [ { "users": [ { "age": "31", "dept": "IT", "city": "Chennai" }, { "age": "...
Gowtham Raj's user avatar
0 votes
1 answer
1k views

Boosting elastic aggregation result

I have an elastic index for products, each product has Brand attribution and I "have to" create an aggregation that returns Brands of the products. My Sample Query: GET /products/product/_search { ...
skynyrd's user avatar
  • 982
0 votes
1 answer
615 views

ElasticSearch Facets / Aggregations sorting / ordering

Does anyone know how to order aggregation / facet buckets from a range into a predictable order i/e the order they were added to the facet in? Currently the 1.4 branch (and possibly older branches) ...
user3169851's user avatar