lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gregory Dearing <gregdear...@gmail.com>
Subject Re: BooleanScorer - Maximum Prohibited Scorers?
Date Thu, 17 Apr 2014 15:22:33 GMT
David,

I believe I misunderstood your question in my earlier response.

I think you can create a logical "MaximumNumberMustNotMatch" by nesting
Boolean Queries.

1.) Create a Boolean Query, using 'SHOULD' clauses and setting Minimum
Number Should Match.

2. ) Wrap the BooleanQuery with a 'MUST_NOT' BooleanClause.

3.) Add the negating BooleanClause to a second BooleanQuery.

-Greg






On Thu, Apr 17, 2014 at 10:40 AM, Gregory Dearing <gregdearing@gmail.com>wrote:

> David,
>
> Any document that matches a MUST_NOT clause will not match the
> BooleanQuery.  By definition.
>
> This means that "maximumNumberMustNotMatch" is effectively hardcoded to
> zero.
>
> -Greg
>
>
> On Wed, Apr 16, 2014 at 3:59 PM, David Stimpert <dave@genomoncology.com>wrote:
>
>> Hello,
>> I have found useful functionality in BooleanQuery which allows me to
>> specify a minimum number of matching optional terms
>> (i.e. setMinimumNumberShouldMatch).  I do not, however, see similar
>> functionality available for setting the maximum number of MUST_NOTs (i.e.
>> setMaximumNumberMustNotMatch).  I am starting to look into how I could
>> customize this functionality.  Does this seem feasible?  Do you foresee
>> any
>> major challenges?  Any advice?
>>
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message