lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gregor Heinrich" <Gregor.Heinr...@igd.fhg.de>
Subject RE: AND instead OR for the search
Date Tue, 05 Aug 2003 16:12:34 GMT
Hi.

Is it possible to have a similar behaviour in MultiFieldQueryParser?

Thanks, gregor

-----Original Message-----
From: hui [mailto:hui@triplehop.com]
Sent: Tuesday, August 05, 2003 5:49 PM
To: Lucene Users List; Sebastien X
Subject: Re: AND instead OR for the search


Thank you, Sebastien. It works now.
I think most people are going to do the same thing when they upgrade to 1.3
by leaving the  parse() method from 1.2 there since it is supported in 1.3.

I am having another problem now after I switched to 1.3 from 1.2.  The web
application seach within Jboss 2.4/ Tomcat 3.1 does not work any more. But a
standalone application search works fine on the same index.  The index  was
created on Lucene 1.2.  Here is the exception
[Default] java.lang.NullPointerException
[Default]       at org.apache.lucene.search.Hits.getMoreDocs(Hits.java:90)
[Default]
[Default]       at org.apache.lucene.search.Hits.<init>(Hits.java:80)
[Default]
[Default]       at
org.apache.lucene.search.Searcher.search(Searcher.java:71)
[Default]
[Default]       at
org.apache.lucene.search.Searcher.search(Searcher.java:65)

Any idea about this?

Regards,
Hui



----- Original Message -----
From: "Sebastien X" <cvwebmaster@noos.fr>
To: <lucene-user@jakarta.apache.org>
Sent: Tuesday, August 05, 2003 9:51 AM
Subject: Re: AND instead OR for the search


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


---------------------------------------------------------------------
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