Can ES provide hooks to customized tf/idf when building index

can ES provide hooks to customized tf/ifd for terms when build index?

ES has a DFS-query-then-fetch type, but it is really time consuming.
if provide the hooks, the reindex can be complete with reading the tf/ifd from original index and use overall tf/idf from original index for new index.

The tf and idf are calculated by Lucene. However, you could implement a custom Similarity, which controls how _score is calculated. Similarity has access to CollectionStatistics and TermStatistics, but can also access numeric doc values, so you could access an additional field you've stored with your own idf (although note this would be per document). I'm not sure how you would get the idf out in order to do this reindexing though. It could possibly be done with an advanced script.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.