A has_parent query returns no hits, although a reverse query fits.
I have two mappings.
The parent:
{
"album" :
{
"properties":
{
"title": { "type": "string"},
"location": location,
}
}
}
The child:
{
"photo" :
{
"_parent": {"type": "album"},
"properties":
{
"photo_id": { "type": "string", "index" : "not_analyzed" },
"url": {"type": "string", "index" : "not_analyzed" },
}
}
}
Running a simple query, expected to return all the photos, returns nothing. Such as:
{
"query": {
"has_parent": {
"parent_type": "album",
"query": {
"match_all": {}
}
}
}
}
Sometimes this works and sometimes not. Is "Has_parent" experimental? Why would it sometime work and sometime not?
Resetting the service and reinserting the data seems to work sometimes.