GET dspdocs/_search
{
"query": {
"filtered": {
"filter": {
"bool": {
"must": ["must_term1", "must_term2"],
"must_not": ["must_not_term", "must_not_term2"]
}
},
"query": {
"match": {
"text": {
"query": "query_term",
"operator": "or"
}
}
}
}
}
}
I am trying to execute the above query and I get the following error:
"type": "query_parsing_exception",
"reason": "[_na] query malformed, must start with start_object",
I know this means that my query hasn't been written properly or I've screwed up some order somewhere but for the life of me, I can't seem to figure out where I went wrong.
I'm basically trying to filter out all documents which don't contain the must terms and contain the must_not terms. Then I search within the filtered set for all documents which have the query_term in them.
(I do the filtering first to increase the speed of the search slightly)
must_term1andmust_not_term? Are they term queries or just aquery_term?