You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Robert Muir (JIRA)" <ji...@apache.org> on 2013/06/18 12:37:21 UTC

[jira] [Commented] (LUCENE-5063) Allow GrowableWriter to store negative values

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

Robert Muir commented on LUCENE-5063:
-------------------------------------

On one hand we pay the price of an add:
{code}
     @Override
     public long get(int docID) {
-      return values[docID];
+      return minValue + values.get(docID);
     }
{code}

But we get no benefit...
{code}
+ * <p>Beware that this class will accept to set negative values but in order
+ * to do this, it will grow the number of bits per value to 64.
{code}

This doesn't seem right...
                
> Allow GrowableWriter to store negative values
> ---------------------------------------------
>
>                 Key: LUCENE-5063
>                 URL: https://issues.apache.org/jira/browse/LUCENE-5063
>             Project: Lucene - Core
>          Issue Type: Improvement
>            Reporter: Adrien Grand
>            Assignee: Adrien Grand
>            Priority: Trivial
>             Fix For: 4.4
>
>         Attachments: LUCENE-5063.patch
>
>
> For some use-cases, it would be convenient to be able to store negative values in a GrowableWriter, for example to use it in FieldCache: The first term is the minimum value and one could use a GrowableWriter to store deltas between this minimum value and the current value. (The need for negative values comes from the fact that maxValue - minValue might be larger than Long.MAX_VALUE.)

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