Hi, I have problems understanding how that "has_parent" query works.
Situation:
Index with 2 types: "parent_type" and "child_type" with simple parent-child mapping:
"parent_type" => {"properties": {...}}
"child_type" => {"_parent": {"type": "parent_type"},"properties": {...}}
Every parent document has exact one child document. Elasticsearch version 1.3.
Now I run two count queries on "child_type" (http://localhost:9200/index/child_type/_count):
{
"query": {
"has_parent": {
"type": "parent_type",
"query": {
"match_all": {}
}
}
}
}
and
{
"query": {
"match_all": {}
}
}
The first query counts less documents then the second query. I do not understand why there is a difference?