Hmmm, I think you should be able to rely on the fact that Fields are
stored in order of indexing and then read back in that same order.
Thus, index your documents making sure that the documentType is the
first Field on the Document (and for performance reasons, the other
fields you want to load are next). Then, in your FieldSelector, you
can, upon seeing the documentType, set the appropriate flags for when
the other Fields are read..
Otherwise, the reading twice approach makes sense.
-Grant
On Nov 30, 2007, at 6:27 AM, Timo Nentwig wrote:
Hi!
I do have different document types (Books, Magazines, Author
whatever) in the
index and a FieldSelector is document type specific (for Books LOAD
isbn and
title for Author name, ...). The document type can be determined by
a field
surprisingly called documentType.
How am I going to do this? Reading twice? First
IndexReader.document() only
the documentType and then choose proper FieldSelector and read again?
Thanks,
timo
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------
Grant Ingersoll
http://lucene.grantingersoll.com
Lucene Helpful Hints:
http://wiki.apache.org/lucene-java/BasicsOfPerformance
http://wiki.apache.org/lucene-java/LuceneFAQ
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]