Parent Fields in Child-Query


#1

Hello everyone,

I have question to querys with parent-child-relationships.

When I do a bool query like this, where I only query fields of the child-type:

{
"query": {
"has_parent": {
"type": "feature",
"score_type": "score",
"query": {
"bool" : {
"should" : [ {
"query_string" : {
"query" : "costs",
"default_field" : "search.headline",
"use_dis_max" : true,
"default_operator" : "and",
"allow_leading_wildcard" : true,
"boost" : 99.0
}
}]
}
}
}
}
}

With such a query I get no hits, but when I add another should-clause with a query over a parent fields, then I will get hits. But already with the first should clause, (theoretical) I have to become hits.
It looks weird. Only adding a query over a parent field helps to get a result.

Can anyone help me?


(system) #2