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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to