lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ramrakhiani, Vikas" <Vikas-Ramrakhi...@deshaw.com>
Subject Unable to change default boolean operator to AND
Date Wed, 16 Apr 2003 06:07:38 GMT
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


Mime
View raw message