I'm migrating my Elasticsearch queries from the 1.7 version to 5.0 (the latest at this moment) and I'm having some trouble with aggregations.
I want to do aggregation on a given field and show the top 5 documents ordered by score. From what I've read this used to be done like this:
"aggs" : {
"max_price" : { "max" : { "script" : "_score" } }
}
Using Sense, the answer I get is "Unexpected token VALUE_STRING [script] in [top_score]."
Anyone went through this?
Note: For an older version an answer was posted here: ElasticSearch: aggregation on _score field?