Hi all!
I have an index with parent-child capability and the has_child query below with a filter-range applied on children (child_field_1). My issues here are 2.
- I cannot put multiple filters to children (only one),
My query:
GET npk/_search
{
"query": {
"has_child": {
"type": "body",
"min_children": 1,
"query": {
"range": {
"child_field_1": {
"gte": 5,
"lte": 10
},
"child_field_2": {
"gte": 8,
"lte": 12
}
} },
"inner_hits": {}
} } }
Response:
"type": "parsing_exception",
"reason": "[range] query doesn't support multiple fields, found [child_field_1] and [child_field_2]",
- I cannot put a filter for parent.
My query:
GET npk/_search
{
"query": {
"range": {
"parent_field_1": {
"gte": 1,
"lte": 10
}},
"has_child": {
"type": "body",
"min_children": 1,
"query": {
"range": {
"child_field_1": {
"gte": 5,
"lte": 10
}
} },
"inner_hits": {}
} } }
Response:
"type": "parsing_exception",
"reason": "[range] malformed query, expected [END_OBJECT] but found [FIELD_NAME]",