Elasticsearch score disable IDF

前端 未结 1 917
夕颜
夕颜 2020-12-30 07:33

I\'m using ES for searching a huge list of human names employing fuzzy search techniques.

TF is applicable for scoring, but IDF is really not required for me in this

相关标签:
1条回答
  • 2020-12-30 08:15

    When create index, we can put our own similarity calculate method into the setting parts, if you need only disable IDF and use others as the default setting, you can write just a simple script such as:

    "script": {"source": "double tf = Math.sqrt(doc.freq); double idf = 1.0; double norm = 1/Math.sqrt(doc.length); return query.boost * tf * idf * norm;"`}
    

    This is shown here.

    0 讨论(0)
提交回复
热议问题