elasticsearch - parent-child documents relation retrieval -
could me little problem regarding parent-child documents relation?
considering json, have objects, each of them contains array of sub-objects. sub-objects contain text fields. need maintain full-text-search on these objects , construct snippets. need highlighting building snippets. if use nested objects, highlighting not deal them. therefore, use parent-child relationships.
now need retrieve parent-documents, children match query_string. furthermore, need highlighted fields of matched children , associate each one(each child) corresponding parent construct snippets in application.
is possible accomplish goal in 1 query?
i think should consider using children aggregation. can retrieve children items within parents. it's aggregation not able whole document (just id) retrieve relationship... query can document details quickly.
and more details : https://www.elastic.co/guide/en/elasticsearch/guide/current/children-agg.html
Comments
Post a Comment