Nested hasChildQuery

Hi all,

Context: Java api, ES 0.18.7

I'm trying to run the following query but with no success.

hasChildQuery("line", hasChildQuery("item", termQuery("value", 1))

Is there any logical reason againt using nested hasChildQuery queries?

Searching for both individually works fine returning each time the
correct parents. I assumed that combining the two would result in the
most upper parent returned as result.

The types are put in the index like this:

line: {"type":{"_parent":{"type":"plant"}}}

item: {"type":{"_parent":{"type":"line"}}}

Any ideas?

Yes, it should work.

On Friday, February 24, 2012 at 2:36 PM, SK wrote:

Hi all,

Context: Java api, ES 0.18.7

I'm trying to run the following query but with no success.

hasChildQuery("line", hasChildQuery("item", termQuery("value", 1))

Is there any logical reason againt using nested hasChildQuery queries?

Searching for both individually works fine returning each time the
correct parents. I assumed that combining the two would result in the
most upper parent returned as result.

The types are put in the index like this:

line: {"type":{"_parent":{"type":"plant"}}}

item: {"type":{"_parent":{"type":"line"}}}

Any ideas?

was solved with Multi level parent/child mapping and search fails · Issue #1751 · elastic/elasticsearch · GitHub

Thanks

On Feb 26, 8:30 pm, Shay Banon kim...@gmail.com wrote:

Yes, it should work.

On Friday, February 24, 2012 at 2:36 PM, SK wrote:

Hi all,

Context: Java api, ES 0.18.7

I'm trying to run the following query but with no success.

hasChildQuery("line", hasChildQuery("item", termQuery("value", 1))

Is there any logical reason againt using nested hasChildQuery queries?

Searching for both individually works fine returning each time the
correct parents. I assumed that combining the two would result in the
most upper parent returned as result.

The types are put in the index like this:

line: {"type":{"_parent":{"type":"plant"}}}

item: {"type":{"_parent":{"type":"line"}}}

Any ideas?

Yea, it didn't work…, but it does now (0.19).

On Friday, February 24, 2012 at 2:36 PM, SK wrote:

Hi all,

Context: Java api, ES 0.18.7

I'm trying to run the following query but with no success.

hasChildQuery("line", hasChildQuery("item", termQuery("value", 1))

Is there any logical reason againt using nested hasChildQuery queries?

Searching for both individually works fine returning each time the
correct parents. I assumed that combining the two would result in the
most upper parent returned as result.

The types are put in the index like this:

line: {"type":{"_parent":{"type":"plant"}}}

item: {"type":{"_parent":{"type":"line"}}}

Any ideas?