You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Karl Koch <Th...@gmx.net> on 2004/03/02 14:27:45 UTC

Search one keyword in two fields - How?

Hi,

hat do I need to search for one single keyword in two fields of one index?
Can someone provide an easy example or tell me where to find it?

Cheers,
Karl

-- 
+++ NEU bei GMX und erstmalig in Deutschland: TÜV-geprüfter Virenschutz +++
100% Virenerkennung nach Wildlist. Infos: http://www.gmx.net/virenschutz


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


Re: Search one keyword in two fields - How?

Posted by Otis Gospodnetic <ot...@yahoo.com>.
You can use MultiFieldQueryParser, or you can construct a BooleanQuery
with two TermQueries as its two clauses, and combine them with OR.

Otis

--- Karl Koch <Th...@gmx.net> wrote:
> Hi,
> 
> hat do I need to search for one single keyword in two fields of one
> index?
> Can someone provide an easy example or tell me where to find it?
> 
> Cheers,
> Karl
> 
> -- 
> +++ NEU bei GMX und erstmalig in Deutschland: T�V-gepr�fter
> Virenschutz +++
> 100% Virenerkennung nach Wildlist. Infos:
> http://www.gmx.net/virenschutz
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: lucene-user-help@jakarta.apache.org
> 


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