We are using a constant score to ignore the distance score while using the Fuzzy Query. The result is successful.
However, the difference between the CPU usage of Elasticsearch and the one used with the Constant score is more than 2 times. (If we use the Constant score, the CPU usage is higher.)
See the query below.
Fuzzy only
"query": {
"bool": {
"should": [
{
"fuzzy": {
"name_jamo": {
"value": "something",
"fuzziness": "2",
"prefix_length": 1,
"max_expansions": 50,
"transpositions": false,
"boost": 0.5
}
}
}
],
"disable_coord": false,
"adjust_pure_negative": true,
"minimum_should_match": "1",
"boost": 1.0
}
}
Constant score + Fuzzy
"query": {
"bool": {
"should": [
{
"constant_score": {
"filter": {
"fuzzy": {
"name_jamo": {
"value": "something",
"fuzziness": "2",
"prefix_length": 1,
"max_expansions": 50,
"transpositions": false,
"boost": 0.5
}
}
},
"boost": 0.01
}
}
],
"disable_coord": false,
"adjust_pure_negative": true,
"minimum_should_match": "1",
"boost": 1.0
}
}
From common sense, it seems that the performance should be good when using the Constant score, but it is the opposite. Why?