Hello,
I have an index, in which there are 3 types of document, call them parent
-> child -> grandchild. So every grandchild's _parent is some child, and
every child's _parent is some parent.
Performing these two queries yields correct results
curl -XPOST http://localhost:9200/my_index/parent/_search -d '{
"filter": {
"has_child": {
"query": {
"match_all": {}
},
"type": "child"
}
},
"from": 0,
"query": {
"match_all": {}
},
"size": 10
}'
curl -XPOST http://localhost:9200/my_index/child/_search -d '{
"filter": {
"has_parent": {
"parent_type": "parent",
"query": {
"match_all": {}
}
}
},
"from": 0,
"query": {
"match_all": {}
},
"size": 10
}'
But when doing a deeper query I get an empty list, even though there are
correct values in ES:
curl -XPOST http://localhost:9200/my_index/child/_search -d '{
"filter": {
"has_child": {
"query": {
"match_all": {}
},
"type": "grandchild"
}
},
"from": 0,
"query": {
"match_all": {}
},
"size": 10
}'
Also, the same seems to hold (i.e. empty list is returned) when trying to
search for a parent that has children that have grandchildren:
curl -XPOST http://localhost:9200/my_index/parent/_search/ -d '{
"query": {
"has_child": {
"type": "child",
"query": {
"has_child": {
"type": "grandchild",
"query": {
"match_all": {}
}
}
}
}
}
}'
I'm using the most recent ElasticSearch server, i.e. 0.20.2
Could someone tell me what is the problem?
Cheers,
Przemek
--