Currently I trying to restrict results of Elasticsearch (5.4) with the following query:
{
"query": {
"bool": {
"must": {
"multi_match": {
"query": "apache log Linux",
"type": "most_fields",
"fields": [
"message",
"type"
]
}
},
"filter": {
"term": {
"client": "test"
}
}
}
}
}
This returns every document that contains "apache"
, "log
", or "linux"
. I want to restrict the results to documents that have a field "client" with the exact specified value, this case: "test"
. However, this query returns all the documents that contain "test" as value. A document with "client": "test client"
will also be returned.
I want to restriction to be exact, so only the documents with "client": "test"
should be returned and not "client": "test client"
.
After testing a bunch of different queries and lots of searching, I can not find a solution to my problem. What am I missing?