# Nested query resulting in missing source fields?

**URL:** <https://discuss.elastic.co/t/nested-query-resulting-in-missing-source-fields/22728>\
**Category:** Elasticsearch\
**Created:** [March 18, 2015, 6:03am UTC](https://discuss.elastic.co/t/nested-query-resulting-in-missing-source-fields/22728 "2015-03-18T06:03:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Woody\_Peterson](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/woody_peterson/32/830_2.png) [@Woody\_Peterson](https://discuss.elastic.co/u/Woody_Peterson)\
**Post date:** [March 18, 2015, 6:03am UTC](https://discuss.elastic.co/t/nested-query-resulting-in-missing-source-fields/22728/1 "2015-03-18T06:03:02Z")

</div>

I have a monstrous query with a monstrous response. It was originally  
written to work around some limitations in Elasticsearch 0.8, if I remember  
right, namely missing grouping.

I'm having an issue where a certain nested query inside of a dis\_max is  
producing hits that don't contain any source fields, and I see no reason  
why this should be the case.

You don't have to study these in detail, just skim the first one to the  
'nested' part and glance at the results, then do the same for the second  
one (note the missing 'nested' part, and all the extra data in the results).

> <https://gist.github.com/woahdae/1142fa956d28c2d84a57>

vs

> <https://gist.github.com/woahdae/fe3d1a3562a463aea4b5>

I'm a dog flying an airplane at this point, anybody know where to look next?

--  
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/9c11b6b6-08c4-4652-8dd5-9f197a8e301b%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/9c11b6b6-08c4-4652-8dd5-9f197a8e301b%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 12:26am UTC](https://discuss.elastic.co/t/nested-query-resulting-in-missing-source-fields/22728/2 "2017-07-06T00:26:00Z")

</div>


