# Little problem

**URL:** <https://discuss.elastic.co/t/little-problem/19075>\
**Category:** Elasticsearch\
**Created:** [August 4, 2014, 4:10pm UTC](https://discuss.elastic.co/t/little-problem/19075 "2014-08-04T16:10:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jeremy\_TYRIAUX](https://avatars.discourse-cdn.com/v4/letter/j/a183cd/32.png) [@Jeremy\_TYRIAUX](https://discuss.elastic.co/u/Jeremy_TYRIAUX)\
**Post date:** [August 4, 2014, 4:10pm UTC](https://discuss.elastic.co/t/little-problem/19075/1 "2014-08-04T16:10:45Z")

</div>

Hello,

i have a little problem with elastic search :

My doc looks like : (serialized as JSON doc)  
  
  
 Brandon   
 10   
  
  
 Monica   
 14

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 ! 😛 )

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 [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
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).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)\
**Post date:** [August 4, 2014, 4:22pm UTC](https://discuss.elastic.co/t/little-problem/19075/2 "2014-08-04T16:22:41Z")

</div>

The only way to achieve the result you are seeking is to use parent/child  
documents:

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

> **[Fun with elasticsearch's children and nested documents - Space Vatican](https://www.spacevatican.org/2012/6/3/fun-with-elasticsearch-s-children-and-nested-documents/)**
>
> When you’re indexing data, the world is rarely as simple as each document existing in isolation. Sometimes, you’re better off …

Cheers,

Ivan

On Mon, Aug 4, 2014 at 9:10 AM, Jeremy TYRIAUX [drezounet@gmail.com](mailto:drezounet@gmail.com) wrote:

> Hello,
> 
> i have a little problem with Elasticsearch :
> 
> My doc looks like : (serialized as JSON doc)  
>   
>   
> Brandon   
> 10   
>   
>   
> Monica   
> 14
> 
> 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 ! 😛 )
> 
> 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 [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> 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)  
> [https://groups.google.com/d/msgid/elasticsearch/ca65dff4-cd98-41b3-a098-e9e59dda1f5f%40googlegroups.com?utm\_medium=email&utm\_source=footer](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](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 [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQDkr1VfskWZsoFUcjuAfq%3D5\_8iVPRF7yM3dBJFiAYwxWA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQDkr1VfskWZsoFUcjuAfq%3D5_8iVPRF7yM3dBJFiAYwxWA%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Jeremy1](https://avatars.discourse-cdn.com/v4/letter/j/6a8cbe/32.png) [@Jeremy1](https://discuss.elastic.co/u/Jeremy1)\
**Post date:** [August 5, 2014, 3:29pm UTC](https://discuss.elastic.co/t/little-problem/19075/3 "2014-08-05T15:29:40Z")

</div>

thanks for the reply.

i divided the problem in a new index with only user structure.

now it's functionnaly.

Thanks to you Ivan.

Jeremy.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 1:10am UTC](https://discuss.elastic.co/t/little-problem/19075/4 "2017-07-06T01:10:42Z")

</div>


