Getting parent id in parent-child mapping

I am using parent-child and the mapping is having the field _parent and I
set parent to actual parent id during indexing.
But the search result returns all the fields except the parent and I also
could not figure out any method to get the parent id.
How should I get a parent id of the child document ?

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.

Hi Chetana,

You can specify the _parent and _source in the fields. It will list the
_parent in the "fields" array in the hit, but the _source will be at it's
normal place in the hit.

curl 'localhost:9200/indexname/childname/_search' -d '{
fields:["_parent", "_source"]
}'

See also:
http://www.elasticsearch.org/guide/reference/api/search/fields/

Jaap

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