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

Michael McCandless commented on LUCENE-5618:
--------------------------------------------

In SegmentReader.initDocValuesProducers, when there are no DV updates,
can't you just init dvp right off (not lazily)?  Because up above we
only call it if FIS.hasDocValues.

I think what Rob meant by the double-lookup is we should just call
dvFields.get(field) first, and only if that's null do we do the logic
to initialize it.  Ie, the common case here is retrieving a DV field
that's already loaded.

in this code from ReadersAndUpdates.writeFieldUpdates:

{noformat}
    // update the doc-values updates files
    assert !newDVFiles.isEmpty();
    for (Entry<Integer,Set<String>> e : 
info.getDocValuesUpdatesFiles().entrySet()) {
     if (!newDVFiles.containsKey(e.getKey())) {
       newDVFiles.put(e.getKey(), e.getValue());
     }
    }
{noformat}

Why would the newDVFiles contain e.getKey()?  Aren't we only writing
the new generation update here?  Also the indent is off a bit.


> DocValues updates send wrong fieldinfos to codec producers
> ----------------------------------------------------------
>
>                 Key: LUCENE-5618
>                 URL: https://issues.apache.org/jira/browse/LUCENE-5618
>             Project: Lucene - Core
>          Issue Type: Bug
>            Reporter: Robert Muir
>            Assignee: Shai Erera
>            Priority: Blocker
>             Fix For: 4.9
>
>         Attachments: LUCENE-5618.patch, LUCENE-5618.patch, LUCENE-5618.patch
>
>
> Spinoff from LUCENE-5616.
> See the example there, docvalues readers get a fieldinfos, but it doesn't 
> contain the correct ones, so they have invalid field numbers at read time.
> This should really be fixed. Maybe a simple solution is to not write 
> "batches" of fields in updates but just have only one field per gen? 
> This removes many-many relationships and would make things easy to understand.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

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

Reply via email to