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