Answer the question
In order to leave comments, you need to log in
Why does the range filter in Elasticsearch consume more resources than full-text search?
I have filtered query.
In the first case, the search occurs in the text,
{ 'query': {'filtered': {'filter': {'bool': {'must': [{'term': {'status': 4}}]}},
'query': {'bool': {'should': [{'match': {'name': {'operator': 'and',
'query': 'барменша'}}},
{'match': {'description': {'boost': 0.9,
'operator': 'and',
'query': 'барменша'}}},
{'match': {'author': {'boost': 0.8,
'operator': 'and',
'query': 'барменша'}}},
{'match': {'tags': {'boost': 0.7,
'operator': 'and',
'query': 'барменша'}}}]}}}}
{
'query': {'filtered': {'filter': {'bool': {'must': [{'term': {'status': 4}},
{'range': {'year_to': {'lte': '1946'}}}]}}}}
"properties": {
"id": {
"type": "integer"
},
"name": {
"analyzer": "russian_morphology",
"type": "string"
},
"description": {
"analyzer": "russian_morphology",
"type": "string"
},
"status": {
"type": "integer"
},
"tags": {
"analyzer": "russian_morphology",
"type": "string"
},
"year_from": {
"type": "integer"
},
"year_to": {
"type": "integer"
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question