qp.setOperator(QueryParser.DEFAULT_OPERATOR_AND);
--- "Ramrakhiani, Vikas" <Vikas-Ramrakhiani@deshaw.com> wrote:
> I was trying to implement default boolean operator AND in the demo
> code
> SearchFiles.java.
> I did the following :-
>
> QueryParser qp = new QueryParser("contents", analyzer);
> System.out.println("Value for AND operator is: " +
> qp.DEFAULT_OPERATOR_AND);
> qp.setOperator(1);
> Query query = qp.parse(line, "contents", analyzer);
> System.out.println("Query is " + query);
> System.out.println("Searching for: " + query.toString("contents"));
> System.out.println("Operator is: " + qp.getOperator());
>
> But what I get is still the default OR opertor:
>
> Query: asd asd
> Value for AND operator is: 1
> Query is contents:asd contents:asd
> Searching for: asd asd
> Operator is: 1
>
> What am I doing wrong ?
>
> thanks for your help,
> vikas.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: lucene-user-help@jakarta.apache.org
>
__________________________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo
http://search.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org
|