How to handle document relations using nest elastic search

Hi ,

I have a scenario where I have below document structure

Document { Id, Name,ParentId,FamilyId,Author,List of additional user custom
fields }

and a document can have relations to another document .

For example :

we have mail thread where replies and actual mail are documents but actual
mail is the parent and all the replies are child's.

Now have below use cases to achieve.

1)Get the qualified replies only for the given query .

2)Get the qualified replies and all other emails in thread (include
families ) for given query.Here query meant to qualify the reply /replies

3)Get the qualified mail documents only for given query

4)Get the qualified mail documents and all of its replies for given query
which qualifies the mail documents

can you let me know what is the best way to handle this kind of document
relations and sample code for the nest client use .


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
To view this discussion on the web visit
For more options, visit