Has_child query doesn't return all results


(Christian) #1

Hello,

I'm pretty new to ElasticSearch, so I suspect I'm doing something wrong
here. My index contains a record type and a field type (with _parent ==
record). I can search for fields and get results back correctly. I can
also ask for the _parent of the field and see that it correctly maps to a
record. However, when I search for a record with a has_child query that is
exactly the same as my field query that works correctly, it sometimes will
not return any results. It's not a constant thing either. A has_child
query for some fields works just fine but for other fields returns nothing.
Here is a gist with a really simplified version of my index:

https://gist.github.com/2036598

Christian


(Christian) #2

Ah forget it. I changed the child objects to nested objects and now I can
query it like I want. Thanks.

On Wednesday, March 14, 2012 9:55:04 AM UTC-4, Christian wrote:

Hello,

I'm pretty new to ElasticSearch, so I suspect I'm doing something wrong
here. My index contains a record type and a field type (with _parent ==
record). I can search for fields and get results back correctly. I can
also ask for the _parent of the field and see that it correctly maps to a
record. However, when I search for a record with a has_child query that is
exactly the same as my field query that works correctly, it sometimes will
not return any results. It's not a constant thing either. A has_child
query for some fields works just fine but for other fields returns nothing.
Here is a gist with a really simplified version of my index:

https://gist.github.com/2036598

Christian


(system) #3