You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by Grant Ingersoll <gs...@syr.edu> on 2004/02/03 22:02:09 UTC

Fields and Documents

Hi,

I have written some tests for SegmentReader and SegmentMerger.  In it, I create a document that has several fields, at least one of every kind.  I then write out the document using a DocumentWriter.  My next step is to read it back in, using the SegmentReader (since I am testing the segment reader, this test is similar to the TestDoc test).  I then assert that the two documents are equal in the sense that all of the Fields that existed in the original Document exist in the one that was just read in.  Much to my suprise, they do not.  Namely, they differ in the fact that the Unstored fields are not preseved across writing.

The relevant code for this appears to be in FieldsWriter, where it explicitly writes out only those that where isStored() == true.  

I guess I would expect that the meta-information about a Document would be preserved across writing.  Is my understanding correct or am I missing something?  If my understanding is correct, I can submit the patch.

Thanks for any help,
Grant Ingersoll

----------------------------------------------------------------------
Grant Ingersoll
Sr. Software Engineer
Center for Natural Language Processing
Syracuse University
http://www.cnlp.org



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


Re: Fields and Documents

Posted by Doug Cutting <cu...@apache.org>.
Grant Ingersoll wrote:
> The relevant code for this appears to be in FieldsWriter, where it explicitly writes out only those that where isStored() == true.  

That's the correct behaviour.  Only fields that are stored are written.

Doug

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