I using the top hits aggregation with a has_child query. In the top_hits
aggregation documentation it says 'By default the hits are sorted by the
score of the main query', but I'm not seeing that in the results for my
query
The buckets of there replies terms agg are sorted by default by their doc
count, but the hits inside topChildren agg are sorted by default by the
score of the query.
I think if you sort the replies buckets by highest score you get what you
want. In order to do this you need to define a max metric agg, that keeps
track of the score and let the replies terms agg sort its buckets by that,
similar to what is done in this example:
I using the top hits aggregation with a has_child query. In the top_hits
aggregation documentation it says 'By default the hits are sorted by the
score of the main query', but I'm not seeing that in the results for my
query
Thanks for your response, that seems like the right approach. The problem I
am seeing now is that the metrics aggregation is always returning 0. Even
if I remove top_hits out of the query the metrics aggregation still returns
alwyas 0, so something is quite right? Here is a simplified example:
On Tuesday, August 19, 2014 8:47:40 AM UTC+1, Martijn v Groningen wrote:
Hi Dan,
The buckets of there replies terms agg are sorted by default by their doc
count, but the hits inside topChildren agg are sorted by default by the
score of the query.
I think if you sort the replies buckets by highest score you get what you
want. In order to do this you need to define a max metric agg, that keeps
track of the score and let the replies terms agg sort its buckets by that,
similar to what is done in this example: Elasticsearch Platform — Find real-time answers at scale | Elastic
Martijn
On 18 August 2014 23:52, Dan Tuffery <dan.t...@gmail.com <javascript:>>
wrote:
I using the top hits aggregation with a has_child query. In the top_hits
aggregation documentation it says 'By default the hits are sorted by
the score of the main query', but I'm not seeing that in the results
for my query
I should have looked at the documentation first it is 'doc.score'.
On Tuesday, August 19, 2014 7:07:18 PM UTC+1, Dan Tuffery wrote:
Hi Martijn,
Thanks for your response, that seems like the right approach. The problem
I am seeing now is that the metrics aggregation is always returning 0. Even
if I remove top_hits out of the query the metrics aggregation still returns
alwyas 0, so something is quite right? Here is a simplified example:
On Tuesday, August 19, 2014 8:47:40 AM UTC+1, Martijn v Groningen wrote:
Hi Dan,
The buckets of there replies terms agg are sorted by default by their doc
count, but the hits inside topChildren agg are sorted by default by the
score of the query.
I think if you sort the replies buckets by highest score you get what you
want. In order to do this you need to define a max metric agg, that keeps
track of the score and let the replies terms agg sort its buckets by that,
similar to what is done in this example: Elasticsearch Platform — Find real-time answers at scale | Elastic
I using the top hits aggregation with a has_child query. In the top_hits
aggregation documentation it says 'By default the hits are sorted by
the score of the main query', but I'm not seeing that in the results
for my query
On Tuesday, August 19, 2014 7:07:18 PM UTC+1, Dan Tuffery wrote:
Hi Martijn,
Thanks for your response, that seems like the right approach. The problem
I am seeing now is that the metrics aggregation is always returning 0. Even
if I remove top_hits out of the query the metrics aggregation still returns
alwyas 0, so something is quite right? Here is a simplified example:
On Tuesday, August 19, 2014 8:47:40 AM UTC+1, Martijn v Groningen wrote:
Hi Dan,
The buckets of there replies terms agg are sorted by default by their
doc count, but the hits inside topChildren agg are sorted by default by the
score of the query.
I think if you sort the replies buckets by highest score you get what
you want. In order to do this you need to define a max metric agg, that
keeps track of the score and let the replies terms agg sort its buckets by
that, similar to what is done in this example: http://www. Elasticsearch Platform — Find real-time answers at scale | Elastic
current/search-aggregations-metrics-top-hits-aggregation.
html#_field_collapse_example
I using the top hits aggregation with a has_child query. In the
top_hits aggregation documentation it says 'By default the hits are
sorted by the score of the main query', but I'm not seeing that in
the results for my query
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.