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: Search all instead of specified/default field
Date Tue, 30 Dec 2003 00:35:17 GMT
On Dec 29, 2003, at 5:37 PM, Thomas Krämer wrote:
> with the apache commons digester i can read each record into a lucene 
> document and push each tag as key-value pair, where the tag name (eg. 
> creator) is the lucene field name and the text enclosed by it the 
> corresponding string value.
>
> for a lot of purposes it is much more comfortable to have the 
> possibility to search over all fields.
>
> does an alternative exist to performing as many queries as there are 
> fields in the index
> (all the same term but different fields)?

One common way to do it is index all text you want searchable into a 
single default field, just glue it all together.

Another option is to use the MultiFieldQueryParser, which automatically 
OR's the same query for each field together for you.

Personally, I'd recommend a single searchable field.

	Erik


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


Mime
View raw message