lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yonik Seeley" <yo...@apache.org>
Subject Re: combining negative queries and OR
Date Tue, 04 Nov 2008 16:03:53 GMT
On Tue, Nov 4, 2008 at 1:21 AM, Joe Pollard <joe.pollard@bazaarvoice.com> wrote:
> I am trying to decide if this is a solr or a lucene problem, using solr
> 1.3:
>
> take this example --
>
> (-productName:"whatever") OR (anotherField:"Johnny")
>
> I would expect to get back records that have anotherField=Johnny, but
> also, any records that don't have 'whatever' as the productName.

Lucene can't really do pure negative queries... Solr currently only
allows negative queries at the top level... so the sub-query
(-productName:"whatever") matches nothing.  Try

(*:* -productName:"whatever") OR (anotherField:"Johnny")

-Yonik

Mime
View raw message