lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From karl wettin <karl.wet...@gmail.com>
Subject Re: search in all fields
Date Thu, 18 Jan 2007 11:17:23 GMT

18 jan 2007 kl. 09.54 skrev David:

> Hi all:
>     I study Lucene and I want build search on all the fields, I find
> MultiFieldQueryParser can search on multiple fields, but we must  
> specify
> fields. maybe we can add a field named all_field that contain all  
> the fields
> when indexing, but it make the index file larger.
>    so how to make search on all fields without specify any fields ?
> Appreciate your help!

You can use the IndexReader to see what fields is in an index.

<http://lucene.apache.org/java/docs/api/org/apache/lucene/index/ 
IndexReader.html#getFieldNames 
(org.apache.lucene.index.IndexReader.FieldOption)>

<http://lucene.apache.org/java/docs/api/org/apache/lucene/index/ 
IndexReader.FieldOption.html>

HTH

-- 
karl

---------------------------------------------------------------------
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