lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dario Dentale" <dario.dent...@portalis.it>
Subject Re: Unable to change default boolean operator to AND
Date Thu, 15 May 2003 13:44:13 GMT
I tryied in this way with lucene-1.3-rc1, but doesn't work: it use always OR
operator.
It is a bug or I'm wrong?

Thanx,
Dario

----- Original Message ----- 
From: "Otis Gospodnetic" <otis_gospodnetic@yahoo.com>
To: "Lucene Users List" <lucene-user@jakarta.apache.org>
Sent: Wednesday, April 16, 2003 8:17 AM
Subject: Re: Unable to change default boolean operator to AND


> 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


Mime
View raw message