[
https://issues.apache.org/jira/browse/LUCENE-5990?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14159533#comment-14159533
]
Robert Muir commented on LUCENE-5990:
-------------------------------------
I will also think about assertingcodec and how it could check for such things.
maybe its producer on init could save fieldinfos, e.g. for DV
{code}
public DocValuesProducer fieldsProducer(SegmentReadState state) throws
IOException {
// save ref to state.fieldinfos
}
{code}
then whenever getXXXDocValues(FieldInfo) is called, it could lookup by number
or by name and assert the FieldInfo is the same instance.
> Merging should pass correct fieldinfos to producers always
> ----------------------------------------------------------
>
> Key: LUCENE-5990
> URL: https://issues.apache.org/jira/browse/LUCENE-5990
> Project: Lucene - Core
> Issue Type: Bug
> Reporter: Robert Muir
>
> I think its been a longstanding issue, but I noticed it in the bulk merge
> code today and see that we can fix it...
> instead of:
> {code}
> DocumentStoredFieldVisitor visitor = new DocumentStoredFieldVisitor();
> storedFieldsReader.visitDocument(docID, visitor);
> Document doc = visitor.getDocument();
> addDocument(doc, mergeState.mergeFieldInfos);
> {code}
> we should do:
> {code}
> addDocument(doc, mergeState.fieldInfos[i]);
> {code}
> This is a lot more consistent and reduce the possibility of scary bugs during
> merge because the codec does something strange. We should look into all merge
> logic to see if it can be improved here.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]