lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Erick Erickson" <erickerick...@gmail.com>
Subject Re: Search with AND by default
Date Tue, 12 Jun 2007 19:34:28 GMT
QueryParser.setDefaultOperator(QueryParser.Operator.AND).

Erick

On 6/12/07, Frank Schima <fjs@foraker.com> 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: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

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