Erik Hatcher wrote:

2. How do I search for negative numbers in a range. For example field:[-3 TO
2] ?

I don't mind hacking code such that my numbers are indexed as +00000001 and -00000001 and then I can override the query parser to change my query to [-0000003 TO +0000002]. However.. "+" is less then "-" in Ascii terms so a range search isn't going to work terrifically well.. Is there a standard
approach??


You could leave the "+" off for positive numbers. That'd do the trick, right? "-" < "0" lexicographically.

As Gwyn pointed out, that would make -3 > -2. Personally, I'd use unsigned numbers and shift the range -- for 16 bit numbers I'd map -32768..32767 to 0..65535 by adding 32768. I guess you could do that by having overriding getRangeQuery() (LIA, p207 -- wonderful book).

jch

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

Reply via email to