Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

getting similarity score in Solr

Tags:

solr

lucene

How can I get similarity score between the query and each of retrieved documents in Solr?

Furthermore, how can I set Solr retrieval method? For example, chose between Vector Space model or Document Language Model.

Is it possible?

like image 722
hasan Avatar asked Feb 21 '13 14:02

hasan


2 Answers

As you mentioned in your own answer, you can specify Solr you want to retrieve the score of every document using fl=*, score. You can see it reading this documentation

First of all, Lucene/Solr, only provides TF-IDF (VSM based) scoring strategy. If you decided to plug-in third party Similarity implementations, you can change the scoring strategy used by Solr, but you can't change it in query basis. In fact, you need to reload the core to change it.

like image 182
Samuel García Avatar answered Oct 11 '22 13:10

Samuel García


as mentioned here https://stackoverflow.com/a/9262300/1593370 you can add score field to the result by adding fl=*,score to your request.

but I still cant find a way to chose the retrieval method.

like image 33
hasan Avatar answered Oct 11 '22 15:10

hasan