[ 
https://issues.apache.org/jira/browse/LUCENE-7456?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15517448#comment-15517448
 ] 

Michael McCandless commented on LUCENE-7456:
--------------------------------------------

It's a little spooky how sneaky this patch needs to be, temporarily
overwriting MergeState members, adding a FilterFieldsProducer,
FilterFieldsInfos.

Can we improve those latter two classes to e.g. reject a field that
was not in the restricted set, if you call
{{FilterFieldInfos.fieldInfo}} or {{FilterFieldsProducer.terms}} on an
invalid field name?

The FilterFieldsInfos is also in a precarious state, having to include
all incoming FieldInfo instances so the numbers are consistent, yet
only overriding the iterator.

Methods like {{FilterFieldInfos.hasProx}}, etc., are also wrong, which can
result in sneaky future bugs for codecs that rely on this.

I don't really like the complexity in this patch: I think this is a little too 
much
sneakiness.  Yet, I don't know of a cleaner way to fix the bug.

Stepping back a bit, can you describe the use case motivating allowing
your custom codec to override the default merging for doc values /
postings?


> PerField(DocValues|Postings)Format do not call the per-field merge methods
> --------------------------------------------------------------------------
>
>                 Key: LUCENE-7456
>                 URL: https://issues.apache.org/jira/browse/LUCENE-7456
>             Project: Lucene - Core
>          Issue Type: Bug
>          Components: core/codecs
>    Affects Versions: 6.2.1
>            Reporter: Julien MASSENET
>         Attachments: LUCENE-7456.patch
>
>
> While porting some old codec code from Lucene 4.3.1, I couldn't get the 
> per-field formats to call upon the per-field merge methods; the default merge 
> method was always being called.
> I think this is a side-effect of LUCENE-5894.
> Attached is a patch with a test that reproduces the error and an associated 
> fix that pass the unit tests.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to