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

Shai Erera commented on LUCENE-5345:
------------------------------------

I don't think that's the case (but I'm not near the code to double-check). 
LongFieldSource is only used in the ctor which takes a field name, and as 
documented - reads the values from the respective NDV field. Mike's test uses 
Expression and its ValueSource.

I think a solution could be to separate RangeAccumulator into a 
NumericRangeAccumulator and ValueSourceRangeAccumulator. The former always 
reads from an NDV and takes whatever range. The latter could restrict to only 
taking DoubleRange, and always call vs.doubleVal, since that seems like the 
only API a ValueSource has to impl. Or, it takes any Range, but always calls 
vs.doubleVal and converts it to Long, and the Range can convert it back?

> range facets don't work with float/double fields
> ------------------------------------------------
>
>                 Key: LUCENE-5345
>                 URL: https://issues.apache.org/jira/browse/LUCENE-5345
>             Project: Lucene - Core
>          Issue Type: Bug
>          Components: modules/facet
>            Reporter: Michael McCandless
>             Fix For: 5.0, 4.7
>
>         Attachments: LUCENE-5345.patch
>
>
> With LUCENE-5297 we generalized range faceting to accept a ValueSource.
> But, when I tried to use this to facet by distance (< 1 km, < 2 km, etc.), 
> it's not working ... the problem is that the RangeAccumulator always uses 
> .longVal and assumes this was a double encoded as a long (via DoubleField).



--
This message was sent by Atlassian JIRA
(v6.1#6144)

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

Reply via email to