lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jon Crowell" <jcrow...@dsg.harvard.edu>
Subject NOT, exclude, prohibit, !, -
Date Thu, 24 Jul 2003 18:33:08 GMT
Hi.  I've been reading the Query Syntax page at
http://jakarta.apache.org/lucene/docs/queryparsersyntax.html and I'm not
sure I understand the difference between the prohibit operator (-) and the
exclude operator (!).

It seems that NOT is the exclude operator and the short form is !.  I quote:


     The NOT operator excludes documents that contain the
     term after NOT. This is equivalent to a difference
     using sets. The symbol ! can be used in place of the
     word NOT.

     To search for documents that contain "jakarta apache"
     but not "jakarta lucene" use the query: 

    "jakarta apache" NOT "jakarta lucene"


The minus sign (-) is described in its own section as the prohibit operator.
I quote:


     The "-" or prohibit operator excludes documents that
     contain the term after the "-" symbol.

     To search for documents that contain "jakarta apache"
     but not "jakarta lucene" use the query: 
     
     "jakarta apache" -"jakarta lucene"


My question is: what is the difference between these two operators?  If
there is no difference, then why are there two operators?

Thanks,

Jon


   




---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org


Mime
View raw message