Dear CowBoyX .

    if you use lucene query function with boolean query . You can try to use
the BooleanQuery to create the logic with yourself.

    Like the code:
   BooleanQuery query = new BooleanQuery();
   query.add(new TermQuery() , BooleanClause.Occur.MUST);  // for +

    or
    query.add(new TermQuery(), BooleanClause.Occur.MUST_NOT); // for -

you can find the information with lucene javadoc
http://lucene.zones.apache.org:8080/hudson/job/Lucene-Nightly/javadoc/

Classes with BooleanQuery  and BooleanClause.Occur

above


Chris.

  Search Team in PCHOME co. in Taiwan.



2008/1/2, CowboyX <[EMAIL PROTECTED]>:
>
>
> Hi,
>
> Ive search to see if anyone has asked this before, and i couldn't find
> anything. Apologies if this is a stupid question.
>
> What's the difference between the "AND" and the "+" boolean operators.
> Also
> the "NOT" and "-" boolean operators? Are each of these pair of operators
> functionally equivalent?
>
> From the examples provided in the Query Syntax documentation at:
>
> http://lucene.apache.org/java/docs/queryparsersyntax.html#Boolean%20operators
> it looks as if these are the same.
>
> Any comments would be welcome on this.
> --
> View this message in context:
> http://www.nabble.com/Question-about-Boolean-Operators-tp14573890p14573890.html
> Sent from the Lucene - Java Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
Chris Lin
[EMAIL PROTECTED]
Taipei , Taiwan.
-----------------------------------------------------------

Reply via email to