lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steven Rowe <>
Subject Re: negative queries
Date Fri, 15 Jun 2007 14:00:35 GMT
Hi Antony,

Antony Sequeira wrote:
> In the attached test file I am using string queries and showing the
> failure case.

The attachment didn't make it for some reason.

> Basically I get the impression that I can not have a clause like
> +(-x:y) anywhere in my query.

What follows assumes that the "+(...)" wraps the user input, and is your
attempt to work around the exclusively-negative-query problem.

You can directly use MatchAllDocsQuery[1], or you can use Yonik Seeley's
fix to allow this kind of thing in QueryParser syntax[2] (the "*:*"
construct, which inserts a MatchAllDocsQuery for you), first available
in release 2.1 -- something like "*:* -x:y" should do the trick for you.

Did the *:* construct ever make it into the docs?  I see the patch for
LUCENE-723 doesn't contain any doc changes.  This should be mentioned in
the QP syntax documentation[3], shouldn't it?  And I think Daniel Noll
is right, this looks like an FAQ.


[2] <>
[3] <>

Steve Rowe
Center for Natural Language Processing

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message