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

Yonik Seeley commented on SOLR-8865:
------------------------------------

bq. remember this double addition was due to the toSolrDoc method that converts 
a tlog document (which has only one field) to a Lucene document and then back 
again to a Solr document.

Ah, I see... creating the lucene document creates both a docValue field and a 
stored field for the same field.
But this would hold for multi-valued fields as well, meaning the part of this 
patch that checks if the value has already been added won't work for 
multi-valued fields?

Seems like a better approach would be to fix the code that creates duplicates 
in the first place... so in this code:
{code}
    for (IndexableField f : doc.getFields()) {
      if (f.fieldType().stored()) {
        out.add((IndexableField) f);
      } else {
        SchemaField schemaField = schema.getFieldOrNull(f.name());
        if (schemaField != null && schemaField.hasDocValues() && 
schemaField.useDocValuesAsStored()) {
          out.add((IndexableField) f);
        }
      }
    }
{code}
Drive it off of our schema... if the field is both stored and has docValues, 
then we can simply avoid one of them.

> real-time get does not retrieve values from docValues
> -----------------------------------------------------
>
>                 Key: SOLR-8865
>                 URL: https://issues.apache.org/jira/browse/SOLR-8865
>             Project: Solr
>          Issue Type: Bug
>            Reporter: Yonik Seeley
>             Fix For: 6.0
>
>         Attachments: SOLR-8865.patch, SOLR-8865.patch, SOLR-8865.patch, 
> SOLR-8865.patch
>
>
> Uncovered during ad-hoc testing... the _version_ field, which has 
> stored=false docValues=true is not retrieved with realtime-get



--
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