lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christoph Kaser <lucene_l...@iconparc.de>
Subject Re: Replacement for Filter-as-abstract-class in Lucene 5.4?
Date Fri, 15 Jan 2016 08:49:38 GMT
Isn't that what ConstantScoreQuery does? The only difference is that it 
returns 1.0f as score instead of 0.0f.

Regards
Christoph

Am 15.01.2016 um 09:27 schrieb Uwe Schindler:
> I had the same problem while migrating old code. Filter is very convenient to use, so
why is it deprecated? I agree we should convert all internal filters to use this, but people
from the outside, that just quickly want to create a Filter based on simple stuff like bitsets,
should get an easy api without multi-pass stuff or the need to implement a full scorer returning
0 as score.
>
> So I tend to rename the current filter class as BaseNonScoringQuery. In 5.x keep Filter
deprecated (maybe simply as empty abstract subclass of this one).
>
> Uwe
>
> -----
> Uwe Schindler
> H.-H.-Meier-Allee 63, D-28213 Bremen
> http://www.thetaphi.de
> eMail: uwe@thetaphi.de
>
>
>> -----Original Message-----
>> From: Trejkaz [mailto:trejkaz@trypticon.org]
>> Sent: Friday, January 15, 2016 1:52 AM
>> To: Lucene Users Mailing List <java-user@lucene.apache.org>
>> Subject: Fwd: Replacement for Filter-as-abstract-class in Lucene 5.4?
>>
>> Hi all.
>>
>> Filter is now deprecated, which I already knew was in the pipeline.
>>
>> The docs say:
>>
>>     "Use Query objects instead: when queries are wrapped in a
>>      ConstantScoreQuery or in a BooleanClause.Occur.FILTER clause,
>>      they automatically disable the score computation so the Filter
>>      class does not provide benefits compared to queries anymore."
>>
>> That's fair enough and an easy change to do on the caller side.
>>
>> The other thing we are using Filter for is the other thing it mentions
>> in the Javadoc:
>>
>>     "Convenient base class for building queries that only perform
>>      matching, but no scoring. The scorer produced by such queries
>>      always returns 0 as score."
>>
>> What is the new convenient way to implement your own queries that
>> don't do scoring?
>>
>> TX
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>> For additional commands, e-mail: java-user-help@lucene.apache.org
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message