# Non flatten field path for results

**URL:** <https://discuss.elastic.co/t/non-flatten-field-path-for-results/15903>\
**Category:** Elasticsearch\
**Created:** [February 19, 2014, 5:33pm UTC](https://discuss.elastic.co/t/non-flatten-field-path-for-results/15903 "2014-02-19T17:33:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Han\_JU](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/han_ju/32/962_2.png) [@Han\_JU](https://discuss.elastic.co/u/Han_JU)\
**Post date:** [February 19, 2014, 5:33pm UTC](https://discuss.elastic.co/t/non-flatten-field-path-for-results/15903/1 "2014-02-19T17:33:06Z")

</div>

Hi,

I found that sometimes the field path in query results are flatten, like:

{'a.b': 'my\_result'}

In fact this happens if 'b' is the only required field under 'a'.

However I need to do some post processing on query results and I hope they  
can be in a consistent format.  
So I'd like to know is there's a way to force the query result in a nested  
way? Like:

{'a': {'b': 'my\_result'}}

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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/b571e471-47e8-4fa7-a523-6344dd22f32a%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/b571e471-47e8-4fa7-a523-6344dd22f32a%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Binh\_Ly](https://avatars.discourse-cdn.com/v4/letter/b/ce7236/32.png) [@Binh\_Ly](https://discuss.elastic.co/u/Binh_Ly)\
**Post date:** [February 20, 2014, 1:26pm UTC](https://discuss.elastic.co/t/non-flatten-field-path-for-results/15903/2 "2014-02-20T13:26:45Z")

</div>

You can use source filtering for this:

[http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-source-filtering.html](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-source-filtering.html)

Example:

\_search  
{  
"\_source": ["a.b"]  
}

--  
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/002ff553-11aa-4543-b803-c9f9264bb416%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/002ff553-11aa-4543-b803-c9f9264bb416%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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:48am UTC](https://discuss.elastic.co/t/non-flatten-field-path-for-results/15903/3 "2017-07-06T01:48:42Z")

</div>

Closed on July 6, 2017, 1:48am UTC


