How to query document to return parent and child result


(cyrilforce) #1

Hi All,

I have created some parent and child documents :

curl -XPUT 'http://localhost:9200/twitter/author/1 -d'
curl -XPUT 'http://localhost:9200/twitter/author/2 -d'

curl -XPUT 'http://localhost:9200/twitter/tweet/1?parent=1 -d'
curl -XPUT 'http://localhost:9200/twitter/tweet/2?parent=2 -d'

with the mapping as well. However there is a case whereby i need to query
the parent and child with the result return with both parent and child
information. I would like to know could i
achieve that in a single query or i need to do 2 query each for parent and
child.

Thanks.

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


(Atul Bagga) #2

Did you get an answer to this? I also have a similar requirement.

I want to query such that Parent should derive its relevance from both itself and all Child documents and I want to show parent and child items in search result.


(Atul Bagga) #3

Actually I found this thread now which is helpful on this-


(system) #4