I'm working on ElasticSearch Plugin to retrieve total frequency of searched term. I've already created maven project and successfully deployed my test plugin into ElasticSearch but I have no idea how to write override function to perform this task.
I have found out that there is a getTotalTermFreq() function in
org.elasticsearch.index.similarity.ScriptedSimilarity.Term class/object which returns the total number of occurrences of this term in the index, or -1 if this statistic is not available. But, I have no idea how to use this function in plugin!
I already tried looking in to other open source plugins available on github but couldn't find anything useful or I can say I didn't understand that much because of my no-experience in Java.
Can someone please help?
Thanks in advance.