What does the JSON query look like that includes a filter with the query string? If I am querying an index and want to filter results that come back with my query string, I tried the following:
GET animals/_search
{
"query": {
"query_string": {
"query": "dog"
},
"filter": {
"should" : [
{"match" : {"color" : "brown"}}
]
}
}
}
But I get a message saying:
"error": {
"root_cause": [
{
"type": "parsing_exception",
"reason": "[query_string] malformed query, expected [END_OBJECT] but found [FIELD_NAME]",
"line": 6,
"col": 5
}
],
"type": "parsing_exception",
"reason": "[query_string]
Is is possible to include filters with query strings?
Thanks!