term-query

why does elasticsearch calculates score for term queries?

前提是你 提交于 2021-01-28 05:21:37
问题 I want to make a simple query based on knowing a unique field value using a term query. For instance: { "query": { "term": { "products.product_id": { "value": "Ubsdf-234kjasdf" } } } } Regarding term queries , Elasticsearch documentation states: Returns documents that contain an exact term in a provided field. You can use the term query to find documents based on a precise value such as a price, a product ID, or a username. On the other hand, documentation also suggests that the _score is

Elasticsearch match vs. term in filter

时光怂恿深爱的人放手 提交于 2020-07-09 13:11:44
问题 I don't see any difference between term and match in filter: POST /admin/_search { "query": { "bool": { "filter": [ { "term": { "partnumber": "j1knd" } } ] } } } And the result contains not exactly matched partnumbers too, e.g.: "52527.J1KND-H" Why? 回答1: Term queries are not analyzed and mean whatever you send will be used as it is to match the tokens in the inverted index, while match queries are analyzed and the same analyzer applied on the fields, which is used at index time and

Disabling Elasticsearch search analyzer

为君一笑 提交于 2020-02-24 12:26:20
问题 I'm working on the elasticsearch version 7.2 and i'm in the process of improving the performance of ES calls made by the application. From what I read, if we haven't set a "search analyzer" , by default standard analyzer will be set. But in a case where a analyzer is not needed ,having an analyzer may affect performance. Do having all fields as "keywords" prevents this? Or is there any other way to disable this "search analyzer" Ps: For any answer if you could point me to the ES official