0
votes

I'm using SolrNet to map Solr Index Documents and Results to classes and use the server for a desktop search application. What I need from Solr is to give a query string, and return a list of documents with two details : the unique id for that document, and the score for that document

But the score i want is not the score that SOLR calculates by itself. I need a score that reflects only the frequency of that string in the document (in other words, hit-count in that document). How do I change how SOLR scores documents so that the score generated for each document is either equal to or proportional to the hit-count?

1
one suggestion i had found online was not to edit SOLR's scoring method, but rather just use highlighting to display snippets and then count the no. of snippets : but in my case, the size of my document repository is very large and storing the doctext field in the index as well is not a viable option at all.Vivek Kuruvilla

1 Answers

1
votes

have you looked to function queries? specifically termfreq can be helpful for you.

http://wiki.apache.org/solr/FunctionQuery#termfreq

you can sort just by termfreq using http://solrurl/?q=myterm&sort=termfreq(text,'myterm') desc