# Querying inner objects by field name

**URL:** <https://discuss.elastic.co/t/querying-inner-objects-by-field-name/49556>\
**Category:** Elasticsearch\
**Created:** [May 9, 2016, 2:03pm UTC](https://discuss.elastic.co/t/querying-inner-objects-by-field-name/49556 "2016-05-09T14:03:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bostjan\_Kovac](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bostjan_kovac/32/9671_2.png) [@Bostjan\_Kovac](https://discuss.elastic.co/u/Bostjan_Kovac)\
**Post date:** [May 9, 2016, 2:03pm UTC](https://discuss.elastic.co/t/querying-inner-objects-by-field-name/49556/1 "2016-05-09T14:03:49Z")

</div>

I'm reading the documentation on this site: [https://www.elastic.co/guide/en/elasticsearch/guide/current/complex-core-fields.html#\_how\_inner\_objects\_are\_indexed](https://www.elastic.co/guide/en/elasticsearch/guide/current/complex-core-fields.html#_how_inner_objects_are_indexed)

I'm interested in this paragraph:

> Inner fields can be referred to by name (for example, first). To distinguish between two fields that have the same name, we can use the full path (for example, user.name.first) or even the type name plus the path (tweet.user.name.first).

so if I have the example from the linked docu site:  
`{ "gb": { "tweet": { "properties": { "tweet": { "type": "string" }, "user": { "type": "object", "properties": { "id": { "type": "string" }, "gender": { "type": "string" }, "age": { "type": "long" }, "name": { "type": "object", "properties": { "full": { "type": "string" }, "first": { "type": "string" }, "last": { "type": "string" } }`

According to the docu I should be able to search with condition `last: whatever`, but it does not work. I always have to use the full path `user.last: whatever`. Is the documentation false or my understanding of it? Note that `last` occurs only in the inner object, so in theory full path should not be necessary to reference it.

---

<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 5, 2017, 10:52pm UTC](https://discuss.elastic.co/t/querying-inner-objects-by-field-name/49556/2 "2017-07-05T22:52:59Z")

</div>


