Aha, thanks Igor. Yes, I do happen to be using the same type for
parent and child. In this case, it's an index of products, and
children are variations of those products.
On Aug 9, 2012, at 12:41 PM, Igor Motov wrote:
Typically, parent and child documents have different types. If this
is your case, all you need to do is to limit your search to the
parent type. If for some reason you used the same type, you can find
all records that have no parents specified by searching for -
_parent:* like this:
This will return all nodes that have empty _parent field.
On Thursday, August 9, 2012 1:24:11 PM UTC-4, shane wrote:
I did see that, but it seems like that only controls whether or not
results have children. What I want to do is match against all top-
level docs (regardless of existence or number of children), but not
match against any children.
On Aug 9, 2012, at 12:46 AM, olof wrote:
There's a filter for this:
Does this help? I haven't used parent-child relations in ES myself.
Den onsdagen den 8:e augusti 2012 kl. 22:06:53 UTC+2 skrev shane:
This might be a simple question, and if so I apologize, but I'm not
sure how to go about this.
How would I execute a query against only top-level documents? I have
an index of documents, some have child documents, but I want to
exclude the children from the query.