Thanks for the info.  The Date formatter doesn't work because it can only
deal with positive longs.  My problem was how to handle the negatives but
I got it figured out.



Thanks!



--- Lucene Users List" <[EMAIL PROTECTED]
wrote:

Quick reference:

> 

> http://wiki.apache.org/jakarta-lucene/SearchNumericalFields

> 

> If you are stuck, you can always encode the long in a string format
(the 

> date formatter in lucene might do this already). Or even, you could
also 

> treat it like a date and use your long like a date filter.

> 

>
HTH,

> sv

> 

> On 6 May 2004 [EMAIL PROTECTED] wrote:

> 

>
> Hi,

> > 

> > What's the best way to store numbers for range searching?
 If someone

> > has some info about this I'd love to see it.

> > 

> > This
is my current plan:

> > When I convert the number to a string I will zero
pad it so range searches

> > work.  The conversions will be like this for
integers:

> >    1 to 10000000001

> > 

> >    2 to 10000000002

> > 1000
to 10000001000

> > 

> > I'm just adding a "1" to the

> > start of the string
(or adding 1000000000).  This is so negative numbers work

> > too!  They
will just be subtracted from a long (1000000000):

> >    -1 to 09999999999

> > 

> >    -2 to 09999999998

> > -1000 to 09999999000

> > 

> > This
works great for range

> > searches.  But how do I convert negative longs?
 I can't subtract 1000000000000000000

> > from a long can I?  It too big
to fit in another long.

> > 

> > Any advice is appreciated!

> > 

> > -Reece

> > 

> > ---------------------------------------------------------------------

> > To unsubscribe, e-mail: [EMAIL PROTECTED]

>
> For additional commands, e-mail: [EMAIL PROTECTED]

>
> 

> 

> 

> ---------------------------------------------------------------------

> To unsubscribe, e-mail: [EMAIL PROTECTED]

> For
additional commands, e-mail: [EMAIL PROTECTED]

> 

> 



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to