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

Cao Manh Dat commented on SOLR-9989:
------------------------------------

bq. One question I had during review was the FacetRange.Calc implementations 
and why the ifs vs having separate implementations?

I don't know the reason for the having separate implementation in PointField, 
either
>From {{PointFields.createFields}}
{code}
if (!sf.multiValued()) {
        if (numericValue instanceof Integer || numericValue instanceof Long) {
                bits = numericValue.longValue();
        } else if (numericValue instanceof Float) {
                bits = Float.floatToIntBits(numericValue.floatValue());
        } else {
                assert numericValue instanceof Double;
                bits = Double.doubleToLongBits(numericValue.doubleValue());
        }
        fields.add(new NumericDocValuesField(sf.getName(), bits));
} else {
        // MultiValued
        if (numericValue instanceof Integer || numericValue instanceof Long) {
                bits = numericValue.longValue();
        } else if (numericValue instanceof Float) {
                bits = 
NumericUtils.floatToSortableInt(numericValue.floatValue());
        } else {
                assert numericValue instanceof Double;
                bits = 
NumericUtils.doubleToSortableLong(numericValue.doubleValue());
        }
        fields.add(new SortedNumericDocValuesField(sf.getName(), bits));
}
{code}

Thanks [[email protected]]

> Add support for PointFields in FacetModule (JSON Facets)
> --------------------------------------------------------
>
>                 Key: SOLR-9989
>                 URL: https://issues.apache.org/jira/browse/SOLR-9989
>             Project: Solr
>          Issue Type: Improvement
>      Security Level: Public(Default Security Level. Issues are Public) 
>          Components: Facet Module
>            Reporter: Tomás Fernández Löbbe
>         Attachments: SOLR-9989.patch, SOLR-9989.patch, SOLR-9989.patch
>
>
> Followup task of SOLR-8396



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

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

Reply via email to