You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Bill Tschumy <bi...@otherwise.com> on 2004/09/07 17:41:00 UTC
Use of "+" and "-" in queries
I don't understand the difference in using + and - in queries compared
to using AND and NOT. Even the Query Syntax document seems a bit
confused. In the section on the NOT operator it says:
> To search for documents that contain "jakarta apache" but not
"jakarta lucene" use the query:
>
>
Re: Use of "+" and "-" in queries
Posted by Otis Gospodnetic <ot...@yahoo.com>.
Hi Bill,
No difference, it's just that Lucene's query syntax recognizes both
'NOT' and '-' and uses them the same way - to exclude certain documents
from sesrch results.
Otis
--- Bill Tschumy <bi...@otherwise.com> wrote:
> I don't understand the difference in using + and - in queries
> compared
> to using AND and NOT. Even the Query Syntax document seems a bit
> confused. In the section on the NOT operator it says:
>
> > To search for documents that contain "jakarta apache" but not
> "jakarta lucene" use the query:
> >
> >
> > "jakarta apache" NOT "jakarta lucene"
> >
>
> Then in the section on the - operator you read this:
>
> > To search for documents that contain "jakarta apache" but not
> "jakarta lucene" use the query:
> >
> >
> > "jakarta apache" -"jakarta lucene"
> >
>
> So what's the difference?
>
> --
> Bill Tschumy
> Otherwise -- Austin, TX
> http://www.otherwise.com
>
> >
---------------------------------------------------------------------
> To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: lucene-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org