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?
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.
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?
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.