Re: BigDecimal values

2008-11-22 Thread Yonik Seeley
On Thu, Nov 20, 2008 at 9:30 AM, Sergey Kabashnyuk <[EMAIL PROTECTED]> wrote: > Thanks Ian > > Unfortunately, I have to index any possible number of java.math.BigDecimal > I can rephrase my question this way: > > How can I convert java.math.BigDecimal numbers in to string > for its storing in lexic

Re: BigDecimal values

2008-11-21 Thread Michael Ludwig
Michael Ludwig schrieb: I assume what you mean is formatting the number so that the lexicographical order of any possible sequence of acceptable numbers is the same as its numerical order. You must find a canonical representation like the scientific notation and then tweak it as follows: * "N"

RE: BigDecimal values

2008-11-20 Thread Steven A Rowe
ary precision, its scale representation is an int (32 bits), and its significand ("unscaled value") can have at most Integer.MAX_VALUE bits (c.f. java.math.BigInteger.bitLength():int[4]). If the width of the exponent field is made so that it can express all long values (64 bits), I *th

Re: BigDecimal values

2008-11-20 Thread Michael Ludwig
Sergey Kabashnyuk schrieb: Unfortunately, I have to index any possible number of java.math.BigDecimal Hi Sergey, quite a lot of numbers are possible for BigDecimal. Somehow the range must be bounded. Let's first draw the line where, for a given BigDecimal bd, the result of bd.toString(), whic

Re: BigDecimal values

2008-11-20 Thread Sergey Kabashnyuk
Thanks Ian Unfortunately, I have to index any possible number of java.math.BigDecimal I can rephrase my question this way: How can I convert java.math.BigDecimal numbers in to string for its storing in lexicographical order Sergey Kabashnyuk eXo Platform SAS Hi Lucene only indexes strings.

Re: BigDecimal values

2008-11-20 Thread Ian Lea
Hi Lucene only indexes strings. The standard advice for numeric is to pad to desired width with leading zeros, if likely to be used in range searches. How varied are the numbers you're going to be working with? I only work with stuff with 2 decimal places and tend to lose that. e.g. 2.22 woul

BigDecimal values

2008-11-20 Thread Sergey Kabashnyuk
Hello I want to ask community an advice: what is the best way to index and search java.math.BigDecimal values in lucene 2.4. Any code snippets are welcome. Sergey Kabashnyuk eXo Platform SAS - To unsubscribe, e-mail: [EMAIL P