The only way to achieve the result you are seeking is to use parent/child documents:
http://www.elasticsearch.org/blog/managing-relations-inside-elasticsearch/ http://www.spacevatican.org/2012/6/3/fun-with-elasticsearch-s-children-and-nested-documents/ Cheers, Ivan On Mon, Aug 4, 2014 at 9:10 AM, Jeremy TYRIAUX <[email protected]> wrote: > Hello, > > i have a little problem with elastic search : > > My doc looks like : (serialized as JSON doc) > <users> > <user> > <name> Brandon </name> > <age> 10 </age> > </user> > <user> > <name> Monica </name> > <age> 14 </age> > </user> > </users> > > My search request : > { > "fields": ["user.age"], > "query": { > "bool" : { > "must" : > { "multi_match" : { > "query" : "Brandon", > "fields" : [ "*.name*.$"] } > } > } > } > } > > > I got : 10 and 14 as result (all fields user.age in the doc) > > I only want to get 14 ( the age of brandon) > Can we only get the field about the search field ? > > > ( sorry for my english, i'm not ! :p ) > > sorry for double post, i not subscibe first time.... > > -- > 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 [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/elasticsearch/ca65dff4-cd98-41b3-a098-e9e59dda1f5f%40googlegroups.com > <https://groups.google.com/d/msgid/elasticsearch/ca65dff4-cd98-41b3-a098-e9e59dda1f5f%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQDkr1VfskWZsoFUcjuAfq%3D5_8iVPRF7yM3dBJFiAYwxWA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
