lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <e...@ehatchersolutions.com>
Subject Re: n-Field search w/PhraseQuery
Date Wed, 06 Jul 2005 21:11:03 GMT

On Jul 6, 2005, at 3:01 PM, Yousef Ourabi wrote:

> Quick question on the proper-way of searching multiple fields for  
> phrases?
>
> Would I do this:
> BooleanQuery titleOrContent = new BooleanQuery();
> PhraseQuery titlePhraseSearch = new PhraseQuery(); (add filed x,  
> and term 1, 2)
> PhraseQuery contentPhraseSearch = new PhraseQuery(); (add field y,  
> and term 2,4)
>
> OR
>
> PhraseQuery phraseQuery = new PhraseQuery(); add field x, t 1,2 then
> add field y, t 2 4?

With those two options, you don't really have a choice.  PhraseQuery  
only can use a single field.  It doesn't really make sense for it to  
be otherwise.

     Erik


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message