lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yonik Seeley" <yo...@apache.org>
Subject Re: Force a query to match at least two clauses
Date Fri, 06 Oct 2006 17:47:15 GMT
See BooleanQuery.setMinimumNumberShouldMatch()
There isn't currently any QueryParser support, so you have to create
the query pragmatically.


-Yonik
http://incubator.apache.org/solr Solr, the open-source Lucene search server

On 10/6/06, Ryan Heinen <ryan.heinen@elasticpath.com> wrote:
> Hello,
>
> If I want make sure that only documents that contain at least two of the
> N TermQueries A, B, C, and D (N=4) are considered matches, what is the
> best way to approach this? I know I can expand it out into several
> boolean clauses like so:
>
> (+A +B) (+A +C) (+A +D) (+B +C) (+B +D) (+C +D)
>
> But unfortunately that doesn't really scale well as N increases. Also a
> solution where the minimum number of clauses to match is variable would
> be ideal.
>
> Does anyone know of a way to accomplish this?
>
> Thanks,
>
> Ryan

---------------------------------------------------------------------
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