Custom Ranking Functions (Custom Similarity Providers) on run time


I was trying to use a Similarity provider in query time. For example, as
starting point, I want to disable idf or assign 1 to all terms for some

According to email-list and my observations this modules didn't documented
yet. I added this
ES/lib but I can not choose similarity on runtime like following
requests. How can we use a custom similarity provider on the fly?

curl -XGET devjak:9200/_search?pretty=true -d '{"similarity":{"search":

{"type": "org.elasticsearch.index.similarity.CustomSimilarityProvider"}},

Also, it is nonsense to ES change sort field as tf for ES, because it
doesn't know which calculations should be applied to tf's of each term. So
following query didn't work as expected.

curl -XGET devjak:9200/_search?pretty=true -d '{"explain":


Lastly, maybe we can re-define score calculation on scripting. Is there
anyway to access tf and idf at scripting part?


Thanks for your help indeed,

Jak Akdemir