You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Shai Erera (JIRA)" <ji...@apache.org> on 2013/11/20 17:41:36 UTC

[jira] [Commented] (LUCENE-5345) range facets don't work with float/double fields

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

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

I'm not sure either if the problem is in ValueSource which implements longVal() to return {{(long) doubleVal(doc)}}, or that we need to check the actual range type in RangeAccumulator and somehow pull the right value and pass it to the right method (e.g. maybe adding Range.accept variant for int/float/double)... we could have these variants throw UOE (or return false) at the base Range class and have each Range override that one that it cares about. But then it means we need to duplicate the code which traverses the ranges to work with the right value...

I'll think about it more.

At any rate, I think the test should move to demo/ so that we don't introduce the dependency on expressions in the facet module.

> 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: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org