Nested mappings with the same field names as the parent do not work

If a nested mapping contains a field with the same name as the parent document, I am never able to retrieve any hits when searching for this field. Here is the simplest example:

I added a gist for this: nested mapping fields with the same name as the parent are not searchable · GitHub

On Friday, September 20, 2013 3:24:39 PM UTC-7, Matthew Higgins wrote:

If a nested mapping contains a field with the same name as the parent
document, I am never able to retrieve any hits when searching for this
field. Here is the simplest example:

An article has a "title" field. Article has a nested mapping of comments,
which has the fields "author" and "title".

Now create one entry:

The following returns results:

The following does not return results, because the title field name is on
both "article" and "comment":

I think it's an edge case with nested mappings.

--
View this message in context:
http://elasticsearch-users.115913.n3.nabble.com/Nested-mappings-with-the-same-field-names-as-the-parent-do-not-work-tp4041645.html
Sent from the Elasticsearch Users mailing list archive at Nabble.com.

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

The 'path' is not abbreviating the field name, but is a pointer to the
nested object. Use 'comments.title' for field name.

See also
http://www.elasticsearch.org/guide/reference/query-dsl/nested-filter/

Jörg

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

Thanks! I was thrown off by the fact that an example without a prefix worked.