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 Otis Gospodnetic <ot...@yahoo.com> on 2011/08/02 16:02:33 UTC

How to cut off hits with score below threshold?

Hello,

If one wanted to cut off hits whose score is below some threshold (I know, I know, one doesn't typically want to do this), what are the most elegant options?
I can think of 2 options, but I wonder if there are better choices:

1) custom Collector (problem: one can't specify a custom Collector via an API, so one would have to modify Solr source code)

2) custom SearchComponent that filters hits with score < threshold (problem: if hits are removed from results then too few hits will be returned to the client, so one has to either request more rows from Solr or re-request more hits or do both to avoid this problem)

Is there something better one can do?

Thanks,
Otis
----
Sematext is hiring Search Engineers -- http://sematext.com/about/jobs.html

Re: How to cut off hits with score below threshold?

Posted by Markus Jelsma <ma...@openindex.io>.
I've created an issue to track this funny behaviour:
https://issues.apache.org/jira/browse/SOLR-2689

On Tuesday 02 August 2011 16:46:18 Markus Jelsma wrote:
> Be careful with that approach as it will return score=1.0f for all
> documents (fl=*,score). This, however, doesn't affect the outcome of the
> frange.
> 
> Feels like a bug though
> 
> On Tuesday 02 August 2011 16:29:16 karsten-solr@gmx.de wrote:
> > Hi Otis,
> > 
> > is this the same question as
> > http://lucene.472066.n3.nabble.com/Filter-by-relevance-td1837486.html
> > ?
> > 
> > If yes, perhaps something like (http://search-lucene.com/m/4AHNF17wIJW1/)
> > q={!frange l=0.85}query($qq)
> > qq=<the original relevancy query>
> > will help?
> > 
> > (BTW, a also would like to specify a custom Collector via API in Solr,
> > possible an issue?)
> > 
> > Best regards
> > 
> >   Karsten
> > 
> > in context:
> > http://lucene.472066.n3.nabble.com/How-to-cut-off-hits-with-score-below-t
> > hr eshold-td3219064.html
> > 
> > -------- Original-Nachricht --------
> > 
> > > If one wanted to cut off hits whose score is below some threshold (I
> > > know, I know, one doesn't typically want to do this), what are the most
> > > elegant options?

-- 
Markus Jelsma - CTO - Openindex
http://www.linkedin.com/in/markus17
050-8536620 / 06-50258350

Re: How to cut off hits with score below threshold?

Posted by Markus Jelsma <ma...@openindex.io>.
Be careful with that approach as it will return score=1.0f for all documents 
(fl=*,score). This, however, doesn't affect the outcome of the frange.

Feels like a bug though

On Tuesday 02 August 2011 16:29:16 karsten-solr@gmx.de wrote:
> Hi Otis,
> 
> is this the same question as
> http://lucene.472066.n3.nabble.com/Filter-by-relevance-td1837486.html
> ?
> 
> If yes, perhaps something like (http://search-lucene.com/m/4AHNF17wIJW1/)
> q={!frange l=0.85}query($qq)
> qq=<the original relevancy query>
> will help?
> 
> (BTW, a also would like to specify a custom Collector via API in Solr,
> possible an issue?)
> 
> Best regards
>   Karsten
> 
> 
> in context:
> http://lucene.472066.n3.nabble.com/How-to-cut-off-hits-with-score-below-thr
> eshold-td3219064.html
> 
> -------- Original-Nachricht --------
> 
> > If one wanted to cut off hits whose score is below some threshold (I
> > know, I know, one doesn't typically want to do this), what are the most
> > elegant options?

-- 
Markus Jelsma - CTO - Openindex
http://www.linkedin.com/in/markus17
050-8536620 / 06-50258350

Re: How to cut off hits with score below threshold?

Posted by ka...@gmx.de.
Hi Otis,

is this the same question as
http://lucene.472066.n3.nabble.com/Filter-by-relevance-td1837486.html
?

If yes, perhaps something like (http://search-lucene.com/m/4AHNF17wIJW1/)
q={!frange l=0.85}query($qq)
qq=<the original relevancy query>
will help?

(BTW, a also would like to specify a custom Collector via API in Solr, possible an issue?)

Best regards
  Karsten


in context:
http://lucene.472066.n3.nabble.com/How-to-cut-off-hits-with-score-below-threshold-td3219064.html

-------- Original-Nachricht --------
> If one wanted to cut off hits whose score is below some threshold (I know,
> I know, one doesn't typically want to do this), what are the most elegant
> options?