What is the Top Children query for?

Hi guys. I've read the documentation for the Top Children query[1], but
don't understand what the query's purpose is. Could anyone shed some light
on when Top Children is useful?

Thanks!
Nick

[1]
http://www.elasticsearch.org/guide/reference/query-dsl/top-children-query/

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

The top_children query allows you to return documents based on matches on
other documents. Lets say you index movies and subtitles
as separate documents. A movie is a parent and a subtitle is a child
document. The top_children will allows you to return the movies based on
query matches in the associated subtitle documents.

Most of times you want to use the has_child query. The top_children doesn't
take into account all associated child docs, but only the top matching
ones, it basically tries to match as much as child documents to return
enough parent hits (based on from and size). The has_child query takes into
account all child document irrelevant of how many parent documents are
requested. So the top_children query is in most cases faster, but not
accurate. The has_child query is accurate, but usually slower then the
has_child query.

On 23 July 2013 17:57, Nick Hoffman nick@deadorange.com wrote:

Hi guys. I've read the documentation for the Top Children query[1], but
don't understand what the query's purpose is. Could anyone shed some light
on when Top Children is useful?

Thanks!
Nick

[1]
http://www.elasticsearch.org/guide/reference/query-dsl/top-children-query/

--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
Met vriendelijke groet,

Martijn van Groningen

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.