Answer the question
In order to leave comments, you need to log in
What's wrong with Elasticsearch filters?
The version of elasticsearch is 6.0.0
for such a request:
{
"size": 50,
"query": {
"bool": {
"must": {
"wildcard": {
"keywords": {
"value": "*chero*",
"boost": 2
}
}
},
"filter": {
"terms": {
"category_id": [33, 35]
},
"range": {
"access_index": {"lte": 10}
}
}
}
}
}
"terms": {
"category_id": [33, 35]
},
"range": {
"access_index": {"lte": 10}
}
Answer the question
In order to leave comments, you need to log in
This is how it works on elasticsearch version 6.0.0
{
"query": {
"bool": {
"must": {
"wildcard": {
"keywords": {
"value": "автобус*",
"boost":2
}
}
},
"filter": [
{ "terms": { "category_id": [33, 35] }},
{ "range": { "access_index": { "lte": 30 }}}
]
}
}
}
Wrap both filters in bool, and only then insert them into the filter itself
...
filter
bool
must
terms
range
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question