lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Morus Walter <morus.wal...@tanto.de>
Subject Re: problems search number range
Date Thu, 18 Nov 2004 11:49:11 GMT
d2clon@desarrolladores.org writes:
> 
> i need to solve this search:
> number: -10
> range: -50 TO 5
> 
> i need help.. 
> i dont find anything using google.. 
> 
If your numbers are in the interval MIN/MAX and MIN<0 you can shift
that to a positive interval 0 ... (MAX-MIN) by subtracting MIN from
each number.

Alternatively you have to find a string represantation providing the
correct order for signed integers.
E.g.
-0010
-0001
00000
00001
00020
should work (in the range -9999..99999), since '0' has a higher ascii 
(unicode) code than '-'.
Of course the analayzer has to preserve the '-' and the '-' should not
be eaten by the query parser in case you use it. I don't know if there are
problems with that, but I suspect that at least for the query parser.

Morus

---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org


Mime
View raw message