Nested queries: when to provide path?

Hi all,

With nested objects, I have noticed that sometimes you do not have to
provide the path (ancestors).

For example,

A : {
properties : {
B : {
type : "string"
properties : {
C : {
type : "string"

I have noticed in my documents, that sometimes I can just query C directly,
e.g. ?q=C:blah.

However, sometimes I need to provide the whole path, e.g. ?q=A.B.C:blah.

Sometimes, I can provide a part of the path, e.g. ?q=B.C:blah.

Could someone explain what the logic is? Does it all depend on whether the
deepest field has a unique name? Is there a "select all ancestors" function
in ES like in XPath, i.e. //C?



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
To view this discussion on the web visit
For more options, visit