Getting matched subdocument in nested type

I index varing multi level nested objects. When the search results are
returned is there any way returning just the matched subdocument using
script or filter mechanism

My mapping looks like

{"nested_mapping":{
"properties":{
"desp":{"type":"string"},
"id":{"type":"string",
"store":"yes"},"name":{"type":"string","store":"yes"},"
subprocess":{"type":"nested","include_in_root":true,
"properties":{"id":{"type":"string"},
"name":{"type":"string"}
}}}

Indexed documents are :

  1. {"id":"level2","desp":"simple desc","subprocess":{"name":"L3"}}

{"id":"level0","name":"L0","subprocess":{"id":"level1","name":"L1","subprocess":{"id":"level2","name":"L2","subprocess":{"id":"level3","name":"L3","desp":"Level
3 process"}}}}

I am getting both records (entire json source) for the search query "Q3".
What mechanism I should use if I just need to get sub documents (just
the matched nested part in the multi-level nesting) i.e.
subprocess":{"name":"L3"} and
subprocess:{"id":"level3","name":"L3","desp":"Level 3 process"}

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

Returning only the matched nested documents is not yet supported by
ElasticSearch: https://github.com/elasticsearch/elasticsearch/issues/3022

You would need to resolve this issue on the client side for now.

--
Ivan

On Tue, May 21, 2013 at 2:07 AM, Chetana ambha.career@gmail.com wrote:

I index varing multi level nested objects. When the search results are
returned is there any way returning just the matched subdocument using
script or filter mechanism

My mapping looks like

{"nested_mapping":{
"properties":{
"desp":{"type":"string"},
"id":{"type":"string",
"store":"yes"},"name":{"type":"string","store":"yes"},"
subprocess":{"type":"nested","include_in_root":true,
"properties":{"id":{"type":"string"},
"name":{"type":"string"}
}}}

Indexed documents are :

  1. {"id":"level2","desp":"simple desc","subprocess":{"name":"L3"}}

{"id":"level0","name":"L0","subprocess":{"id":"level1","name":"L1","subprocess":{"id":"level2","name":"L2","subprocess":{"id":"level3","name":"L3","desp":"Level
3 process"}}}}

I am getting both records (entire json source) for the search query "Q3".
What mechanism I should use if I just need to get sub documents (just
the matched nested part in the multi-level nesting) i.e.
subprocess":{"name":"L3"} and
subprocess:{"id":"level3","name":"L3","desp":"Level 3 process"}

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

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