lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gus Kormeier <>
Subject MultiFieldQueryParser.setOperator()
Date Mon, 09 Feb 2004 19:07:33 GMT
Sorry if this is a newbie question,

I want to change the default search to use AND instead of OR when combining
words.  The default Lucene does a great job at finding documents, but I
would like to return 30 instead of 3,000 hits when someone types multiple
For instance here:

I am using:

String [] fields = {"name","brand","description","teaser" };
Analyzer analyzer = new StandardAnalyzer();
Query query = MultiFieldQueryParser.parse(line, fields, analyzer);

I was going to try something like this:
       MultiFieldQueryParser mfqp = new MultiFieldQueryParser(line /* what
is this string to the constructor? */ ,analyzer);
       Query query = MultiFieldQueryParser.parse(line, fields, analyzer);

But parse(String line,String [] fields,Analyzer a) is static, so
setOperator() has no effect on it.

I was expecting to see a constructor where I could set the String[] for
which fields to search, but it isn't there(API 1.3).  Otherwise the
MultiFieldQueryParser works great for my purposes.

Am I reading the API wrong?  Is there a way to search Multi fields and

One solution I can see, would it be better to Index all of the fields into
one blob of a field as well, and just search off of that?

Thanks in Advance,

P.S. Have been very impressed with the speed and flexibility of Lucene so

Gus Kormeier - tech | <<>> |

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message