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 Tom Burton-West <tb...@umich.edu> on 2013/08/22 22:42:11 UTC

How to set discountOverlaps="true" in Solr 4x schema.xml

If I am using solr.SchemaSimilarityFactory to allow different similarities
for different fields, do I set "discountOverlaps="true" on the factory or
per field?

What is the syntax?   The below does not seem to work

<similarity class="solr.BM25SimilarityFactory" discountOverlaps="true"  >
<similarity class="solr.SchemaSimilarityFactory" discountOverlaps="true"
 />

Tom

RE: How to set discountOverlaps="true" in Solr 4x schema.xml

Posted by Markus Jelsma <ma...@openindex.io>.
Yes, discountOverlaps is used in computeNorm which is used at index time. You should see a change after reindexing.

Cheers,
Markus
 
-----Original message-----
> From:Tom Burton-West <tb...@umich.edu>
> Sent: Thursday 22nd August 2013 23:32
> To: solr-user@lucene.apache.org
> Subject: Re: How to set discountOverlaps=&quot;true&quot; in Solr 4x schema.xml
> 
> I should have said that I have set it both to "true" and to "false" and
> restarted Solr each time and the rankings and info in the debug query
> showed no change.
> 
> Does this have to be set at index time?
> 
> Tom
> 
> 
> 
> >
> 

Re: How to set discountOverlaps="true" in Solr 4x schema.xml

Posted by Tom Burton-West <tb...@umich.edu>.
I should have said that I have set it both to "true" and to "false" and
restarted Solr each time and the rankings and info in the debug query
showed no change.

Does this have to be set at index time?

Tom



>

Re: How to set discountOverlaps="true" in Solr 4x schema.xml

Posted by Tom Burton-West <tb...@umich.edu>.
Thanks Markus,

I set it , but it seems to make no difference in the score or statistics
listed in the debugQuery or in the ranking.   I'm using a field with
CommonGrams and a huge list of common words, so there should be a huge
difference in the document length with and without discountOverlaps.

Is the default for Solr 4 true?

 <similarity class="solr.BM25SimilarityFactory"  >
      <float name="k1">1.2</float>
      <float name="b">0.75</float>
<bool name="discountOverlaps">false</bool>
          </similarity>



On Thu, Aug 22, 2013 at 4:58 PM, Markus Jelsma
<ma...@openindex.io>wrote:

> Hi Tom,
>
> Don't set it as attributes but as lists as Solr uses everywhere:
> <similarity class="solr.SchemaSimilarityFactory">
>   <bool name="discountOverlaps">true</bool>
> </similarity>
>
> For BM25 you can also set k1 and b which is very convenient!
>
> Cheers
>
>
> -----Original message-----
> > From:Tom Burton-West <tb...@umich.edu>
> > Sent: Thursday 22nd August 2013 22:42
> > To: solr-user@lucene.apache.org
> > Subject: How to set discountOverlaps=&quot;true&quot; in Solr 4x
> schema.xml
> >
> > If I am using solr.SchemaSimilarityFactory to allow different
> similarities
> > for different fields, do I set "discountOverlaps="true" on the factory or
> > per field?
> >
> > What is the syntax?   The below does not seem to work
> >
> > <similarity class="solr.BM25SimilarityFactory" discountOverlaps="true"  >
> > <similarity class="solr.SchemaSimilarityFactory" discountOverlaps="true"
> >  />
> >
> > Tom
> >
>

RE: How to set discountOverlaps="true" in Solr 4x schema.xml

Posted by Markus Jelsma <ma...@openindex.io>.
Hi Tom,

Don't set it as attributes but as lists as Solr uses everywhere:
<similarity class="solr.SchemaSimilarityFactory">
  <bool name="discountOverlaps">true</bool>
</similarity>

For BM25 you can also set k1 and b which is very convenient!

Cheers
 
 
-----Original message-----
> From:Tom Burton-West <tb...@umich.edu>
> Sent: Thursday 22nd August 2013 22:42
> To: solr-user@lucene.apache.org
> Subject: How to set discountOverlaps=&quot;true&quot; in Solr 4x schema.xml
> 
> If I am using solr.SchemaSimilarityFactory to allow different similarities
> for different fields, do I set "discountOverlaps="true" on the factory or
> per field?
> 
> What is the syntax?   The below does not seem to work
> 
> <similarity class="solr.BM25SimilarityFactory" discountOverlaps="true"  >
> <similarity class="solr.SchemaSimilarityFactory" discountOverlaps="true"
>  />
> 
> Tom
>