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 Roshan Kamble <Ro...@smartstreamrdu.com> on 2016/05/06 05:22:33 UTC

BigDecimal Solr Field in schema

Hello All,

I am using Solr 6.0.0 in cloud mode and have requirement to support all number in BigDecimal

Does anyone know which solr field type should be used for BigDecimal?

I tried using DoubleTrieField but it does not meet the requirement and round up very big number approx. after 16 digit.


Regards,
Roshan
________________________________
The information in this email is confidential and may be legally privileged. It is intended solely for the addressee. Access to this email by anyone else is unauthorised. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful.

Re: BigDecimal Solr Field in schema

Posted by Shawn Heisey <ap...@elyograg.org>.
On 5/5/2016 11:22 PM, Roshan Kamble wrote:
> I am using Solr 6.0.0 in cloud mode and have requirement to support all number in BigDecimal
>
> Does anyone know which solr field type should be used for BigDecimal?
>
> I tried using DoubleTrieField but it does not meet the requirement and round up very big number approx. after 16 digit.

Solr has built-in support for the basic Java numeric types -- the ones
that don't need an "import" statement to use, like Integer, Float,
Double, etc.  BigDecimal is in the java.math package and requires an
import to use.

For something that is not covered by the built-in field classes, you
will need a custom solr schema class that knows how to handle your data,
and that class will need to use Lucene classes (perhaps those will need
to be custom too) to read and write the information in the Lucene index.

Thereare plenty of posts/issues about this that went nowhere:

Here's an old stackoverflow post about doing it in Lucene -- but I am
not sure that this work actually went anywhere:

http://stackoverflow.com/questions/2730200/how-to-index-bigdecimal-values-in-lucene-3-0-1

The lucidimagination.com links in that SO post do not work any more.

Another issue:

https://jira.kuali.org/browse/KITSKMS-1058

Yet another email (onthis mailing list):

http://osdir.com/ml/solr-user.lucene.apache.org/2011-09/msg00636.html

Thanks,
Shawn