Custom Ranking Functions (Custom Similarity Providers) on run time

Hi,

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
queries.

According to email-list and my observations this modules didn't documented
yet. I added this
pluginhttps://github.com/tlrx/elasticsearch-custom-similarity-providerin
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"}},
"fields":["id"],"size":10,"from":0,"sort":["_score"],"query":{"query_string":{"query":"nokia
facebook"}}}'

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":

true,"fields":["id"],"size":10,"from":0,"sort":["_tf"],"query":{"query_string":{"query":"nokia
facebook"}}}'

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

ES:0.19.7

Thanks for your help indeed,

Jak Akdemir

--