lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Karl Wettin (JIRA)" <>
Subject [jira] Commented: (LUCENE-1312) InstantiatedIndexReader does not implement getFieldNames properly
Date Wed, 25 Jun 2008 00:11:45 GMT


Karl Wettin commented on LUCENE-1312:

bq. The error I was seeing in SegmenMerger was related to how InstantiatedIndex keeps Document
in memory, so any editting of the Document after the Document is returned by InstantiatedIndexReader
later messes up SegmentMerger.

Do you still have the exception? Can you paste it here?

It's a bit dangerous to go modifying the Document instances returned by InstantiatedIndexReader
unless you are really sure of what you are doing. The documents are the actual index document
instances and not a deserialized clones as when using the Directory implementations. 

If you delete a field of such a document it's gone from the index. If you add a new field
not previously known in the index, it will not be in sync with field options and you'll probably
see strange side effects when merging with other indices, et c.  

This could also be seen as a great feature that was lost in documentation. One of my favorites
is to store the domain object(s) as Fieldable in the document(s) representing them.

I'll add an appropriate comment about this in the javadocs.

> InstantiatedIndexReader does not implement getFieldNames properly
> -----------------------------------------------------------------
>                 Key: LUCENE-1312
>                 URL:
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: contrib/*
>            Reporter: Jason Rutherglen
>            Assignee: Karl Wettin
>         Attachments: lucene-1312.patch, lucene-1312.patch, lucene-1312.patch, lucene-1312.patch,
> Causes error in org.apache.lucene.index.SegmentMerger.mergeFields

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

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

View raw message