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

Sebastian Müller commented on SOLR-4647:
----------------------------------------

think I hit that problem. Create a schema with normal fields (e.g. id)
and an DocValues field (e.g. feature). If you want to get the DocValues
field value (/select?q=id:123&fl=feature) no value is returned.

Setting the DocValues field stored=true or false doesn't change
anything. The value is not returned.

We worked around that by using an own Field implementation that
programmatically set the stored flag true:

public class OwnDocValuesField extends Field {
      public static final FieldType TYPE = new FieldType();
      static {
        TYPE.setDocValueType(FieldInfo.DocValuesType.BINARY);
        //set to true, so we are able to retrieve the docvalues via fl
parameter
        TYPE.setStored(true);
        TYPE.freeze();
      }

    public OwnDocValuesField(String name, BytesRef value) {
        super(name, TYPE);
        fieldsData = value;
    }
}

We use this class in an own FieldType implementation. I guess our
problem is caused by the issue described in SOLR-4647.

I cannot estimate if this is a bug or if DocValues works as designed,
and simply should not be used this way. Does anyone know that?

lg
Sebastian

                
> Grouping is broken on docvalues-only fields
> -------------------------------------------
>
>                 Key: SOLR-4647
>                 URL: https://issues.apache.org/jira/browse/SOLR-4647
>             Project: Solr
>          Issue Type: Bug
>    Affects Versions: 4.2
>            Reporter: Adrien Grand
>              Labels: newdev
>
> There are a few places where grouping uses 
> FieldType.toObject(SchemaField.createField(String, float)) to translate a 
> String field value to an Object. The problem is that createField returns null 
> when the field is neither stored nor indexed, even if it has doc values.
> An option to fix it could be to use the ValueSource instead to resolve the 
> Object value (similarily to NumericFacets).

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

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

Reply via email to