QueryParser.setDefaultOperator(QueryParser.Operator.AND).

Erick

On 6/12/07, Frank Schima <[EMAIL PROTECTED]> wrote:


I'm searching my index and if a user types multiple words (e.g. "two
words")
in the search field, I want both of the search terms to appear in the
resulting hits, but it appears to be doing an OR by default. How can I get
an AND by default instead?

Here's how i create my Search:

QueryParser qp = new MultiFieldQueryParser( new String[] {"content",
"content_title"}, new StandardAnalyzer() );
Query query = qp.parse(strTerms);


Thanks!
Frank


--
View this message in context:
http://www.nabble.com/Search-with-AND-by-default-tf3909294.html#a11084504
Sent from the Lucene - Java Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Reply via email to