You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "David Smiley (JIRA)" <ji...@apache.org> on 2018/09/24 14:05:00 UTC

[jira] [Comment Edited] (LUCENE-8513) Remove MultiFields.getFields and minimize use of MultiFields instance

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

David Smiley edited comment on LUCENE-8513 at 9/24/18 2:04 PM:
---------------------------------------------------------------

The result of this patch is that the sole usage remaining is {{org.apache.lucene.codecs.FieldsConsumer#merge}}. I didn't move this class to that package and weaken the visibility because there presently are a bunch of static methods still here but soon there won't be via LUCENE-7875. That one should have happened first but I got interested in this one this weekend.  It doesn't matter.
 * Removed static getFields and an inner class related to that.
 * Updated various tests accordingly – where most changes were. It'd be nice if getIndexedFields were sorted order but wasn't hard to get around.
 * SlowCompositeReaderWrapper (now in Solr) is the primary non-test user. It was straight-forward to update using MultiFields.getTerms.
 * Fixed bug in MultiFields.getTerms that created a ReaderSlice with a readerIndex one smaller than it should have been. This was my bug. Apparently there has been no consumer of this bit of metadata to date that also got it via MultiFields.getTerms or else the bug would have been identified already. When I made SlowCompositeReaderWrapper switch to use getTerms, it uncovered this bug by code elsewhere in Solr related to faceting.


was (Author: dsmiley):
The result of this patch is that the sole usage remaining is {{org.apache.lucene.codecs.FieldsConsumer#merge}}. I didn't move this class to that package and weaken the visibility because there presently are a bunch of static methods still here but soon there won't be via LUCENE-7875. That one should have happened first but I got interested in this one this weekend.  It doesn't matter.
 * Removed static getFields and an inner class related to that.
 * Updated various tests accordingly – where most changes were. It'd be nice if getIndexedFields were sorted order but wasn't hard to get around.
 * SlowCompositeReaderWrapper (now in Solr) is the primary non-test user. It was straight-forward to update using MultiFields.getTerms.
 * Fixed bug in MultiFields.getTerms that created a ReaderSlice with a readerIndex one smaller than it should have been. This was my bug. Apparently there has been no consumer of this bit of metadata to date that also got it via MultiFields.getTerms or else the bug would have been identified already. When I made SlowCompositeReaderWrapper switch to use getTerms, it uncovered a bug elsewhere in Solr using this class related to faceting which examined it.

> Remove MultiFields.getFields and minimize use of MultiFields instance
> ---------------------------------------------------------------------
>
>                 Key: LUCENE-8513
>                 URL: https://issues.apache.org/jira/browse/LUCENE-8513
>             Project: Lucene - Core
>          Issue Type: Improvement
>            Reporter: David Smiley
>            Assignee: David Smiley
>            Priority: Major
>             Fix For: master (8.0)
>
>         Attachments: LUCENE-8513.patch
>
>
> As part of a longer term objective of removing the {{Fields}} class, in this issue I focus on minimizing the use of _instances of_ {{MultiFields}} such as {{MultiFields.getFields}} and using it's constructor.  This is _not_ about the static utility methods here like {{getTerms}}.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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