lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Grant Ingersoll <>
Subject Re: FieldSelector
Date Fri, 30 Nov 2007 11:59:13 GMT
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.


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:
> For additional commands, e-mail:

Grant Ingersoll

Lucene Helpful Hints:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message