I want to build custom Elasticsearch scoring function and see that combines TF-IDF similarities of some document fields with relative given parameters with the help. As Elasticsearch scripts provide access to some Lucene functionality with Lucene expressions language, I hope it's possible to use Lucene implementation of a TF-IDF.
Unfortunately, I see almost no documentation and examples for lucene expression scripts for scoring functions. Is it possible? And how?
This won't be possible in expressions; they only have access to the fields of a document and parameters, along with a few static helper functions. You would need to write a native java script. See the advanced scripting example in our docs.
@rjernst Thank you for response. I am actually implementing it on painless. It's feasible (though not convenient). Do you see any advantage to implement it on Java (especially from time performance point of view)?
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.