lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sebastien X" <cvwebmas...@noos.fr>
Subject Re: AND instead OR for the search
Date Tue, 05 Aug 2003 13:51:14 GMT
Hi all and thanks for your precedent help.

I've try the setOperator() method :

First I use this code :
QueryParser qp = new QueryParser("content", analyzer);
qp.setOperator(QueryParser.DEFAULT_OPERATOR_AND);
query = qp.parse(queryString, "contents", analyzer);

But it does not work (Or is always use in the query).

Then, I look the QueryParser and we could use another parse() method:
That's my second code :
QueryParser qp = new QueryParser("content", analyzer);
qp.setOperator(QueryParser.DEFAULT_OPERATOR_AND);
query = qp.parse(queryString);

And this work good :-)  (And is now use by default)

Hui : I think this could solve your problem.

S├ębastien
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message