Which is the best way of disabling IDF?


(Sergio Lopez) #1

Hello,

in Elasticsearch documentation there are references on how to disable TF-IDF. However, I need to just disable IDF (while keeping TF, queryNorm, ...)

Which would be the best way of archiving that?

Thank you.


(Mark Walkom) #2

https://www.elastic.co/guide/en/elasticsearch/reference/2.4/query-dsl-function-score-query.html might be an option.


(Sergio Lopez) #3

Thanks for your answer. I indeed explored this option before. However, I do not see a clear way of just "disabling" IDF.

Any idea?


(Christoph) #4

Hi,

AFAIK there is no simple option that just turns of IDF, since customizing the similarity calculation is very much an expert thing. If you don't want to go the function score query route, I think the only option left is to write your own lucene similarity and use it as a plug in. I found a blog and a project describing this here, but didn't try this myself, but maybe this is a starting point for exploration: http://stefansavev.com/blog/custom-similarity-for-elasticsearch/


(Sergio Lopez) #5

Thanks for your reply.

I'll go for the custom similarity.


(system) #6