You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by SR <r....@gmail.com> on 2012/11/03 17:51:16 UTC

customize similarity function

Solr 4.0

I want to avoid the TF.IDF and use a "binary" model, i.e., if the keyword is in the document, the score is 1, no matter how frequent the keyword is in that document. If the keyword is not in the document, than the score is zero. I also want to avoid the idf.

e.g.,

query: pizza

doc: pizza pizza

the score of "pizza" within doc should be 1.

Any idea on how this can be achieved?

Thanks,
-SR

Re: customize similarity function

Posted by Otis Gospodnetic <ot...@gmail.com>.
Hi,

Look where Similarity implementation is specified in solrconfig.xml.  Find
that class in Lucene and you will see tf and idf methods you need for your
implementation, which you can then specify I'm solrconfig. Reindexing
required.

Otis
--
Performance Monitoring - http://sematext.com/spm
On Nov 3, 2012 12:51 PM, "SR" <r....@gmail.com> wrote:

> Solr 4.0
>
> I want to avoid the TF.IDF and use a "binary" model, i.e., if the keyword
> is in the document, the score is 1, no matter how frequent the keyword is
> in that document. If the keyword is not in the document, than the score is
> zero. I also want to avoid the idf.
>
> e.g.,
>
> query: pizza
>
> doc: pizza pizza
>
> the score of "pizza" within doc should be 1.
>
> Any idea on how this can be achieved?
>
> Thanks,
> -SR