You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Pushkar Raste <pu...@gmail.com> on 2015/09/10 20:21:16 UTC

Issue while adding Long.MAX_VALUE to a TrieLong field

Hi,
I am trying to following add document (value for price.long is
Long.MAX_VALUE)

  <doc>
        <field name="id">411</field>
        <field name="name">one</field>
        <field name="price.long">9223372036854775807</field>
    </doc>

However upon querying my collection value I get back for "price.long" is
9223372036854776000

Definition for 'price.long' field and 'long' look like following

<field name="price.long" type="long" indexed="true" stored="true" />
<fieldType name="long" class="solr.TrieLongField" precisionStep="0"
positionIncrementGap="0"/>

My test case shows that MAX Value Solr can store without losing precision
is  18014398509481982. This is equivalent to ('Long.MAX_VALUE >> 9) - 1'
 (Not really sure if this computation really means something).


Can someone help to understand why TrieLong can't accept values >
18014398509481982

Re: Issue while adding Long.MAX_VALUE to a TrieLong field

Posted by Yonik Seeley <ys...@gmail.com>.
On Thu, Sep 10, 2015 at 2:21 PM, Pushkar Raste <pu...@gmail.com> wrote:
> Hi,
> I am trying to following add document (value for price.long is
> Long.MAX_VALUE)
>
>   <doc>
>         <field name="id">411</field>
>         <field name="name">one</field>
>         <field name="price.long">9223372036854775807</field>
>     </doc>
>
> However upon querying my collection value I get back for "price.long" is
> 9223372036854776000

The value probably isn't actually rounded in solr, but in the client.
If you are looking at this from the admin console, then it's the
javascript there that is unfortunately rounding the displayed value.

http://stackoverflow.com/questions/1379934/large-numbers-erroneously-rounded-in-javascript

https://issues.apache.org/jira/browse/SOLR-6364

We should really fix the admin somehow... this has bitten quite a few people.

-Yonik