Using Elasticsearch.Net/NEST to search parent documents based on child attributes, where parent/child documents are stored separately

前端 未结 2 942
情话喂你
情话喂你 2021-01-01 06:49

I would like to use Elasticsearch.Net/NEST to search related documents. For example, I have:

Person:

id name address_id
-- ---- ----------
1  John 1
2  Mary         


        
2条回答
  •  情书的邮戳
    2021-01-01 07:04

    I think the best place to look is at the NEST Unit Tests.

    • Fluent Mapping Full Example Tests - Includes an example of setting Parent relationship.
    • Has Parent Query
    • Has Child Query
    • Top Children Query

    Also on the Nest Documentation Site there is a small snippet for running a has_child query. (Pretty much the same as the unit test)

提交回复
热议问题