Nested match_all filter filters documents without nested documents

Hi all,

I have a curl example that illustrates my issue:

Basically, I would expect that the following 2 queries would always behave
the same:

(a)
{
"size":0,
"query":{
"nested":{
"query":{
"match_all":{}
},
"path":"list"
}
},
"fields":[]
}

(b)
{
"size":0,
"query":{
"match_all":{}
},
"fields":[]
}

However, (a) seems to filter documents without nested docs. Is this the
expected behaviour?

Thank you in advance,

Bob

--
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.

After doing some more digging it appears as though this is part of the semantics of how elasticsearch implements nested queries in NestedQueryParser which uses lucene's ToParentBlockJoin:

lucene.apache.org/core/4_3_0/join/org/apache/lucene/search/join/package-summary.html

lucene.apache.org/core/4_3_0/join/org/apache/lucene/search/join/ToParentBlockJoinQuery.html

I would greatly appreciate a confirmation, but I think an elaboration in the ES docs to mention that it performs "inner join"-like semantics would be very useful to prevent confusion.

Cheers,

Bob

--
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.

This is expected behaviour, when using the nested query all documents
without nested inner objects are automatically excluded.
It makes sense to explicitly document this behaviour.

On 25 July 2013 14:53, btiernay rtiernay@gmail.com wrote:

After doing some more digging it appears as though this is part of the
semantics of how elasticsearch implements nested queries in
NestedQueryParser which uses lucene's ToParentBlockJoin:

lucene.apache.org/core/4_3_0/join/org/apache/lucene/search/join/package-summary.html

lucene.apache.org/core/4_3_0/join/org/apache/lucene/search/join/ToParentBlockJoinQuery.html

I would greatly appreciate a confirmation, but I think an elaboration in
the ES docs to mention that it performs "inner join"-like semantics would
be very useful to prevent confusion.

Cheers,

Bob

--
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.

--
Met vriendelijke groet,

Martijn van Groningen

--
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 for the confirmation :slight_smile:

--
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.