Date: 2004-05-11T19:20:02
Editor: 150.101.152.16 <>
Wiki: Jakarta Lucene Wiki
Page: SearchNumericalFields
URL: http://wiki.apache.org/jakarta-lucene/SearchNumericalFields
no comment
Change Log:
------------------------------------------------------------------------------
@@ -71,7 +71,7 @@
If you want a numerical field that may contain positive and negitive numbers, you
still need to format them as strings. What you must ensure is that for any numbers a
and b, if a<b then format(a)<format(b). The problem cases are
* when one number is negative and the other is positve
- * when both are negitive, ie; -200 is less than -1, even though "-100" is
lexocographically '''greater''' than "-2"
+ * when both are negitive, ie; -200 is less than -1, even though "-200" is
lexocographically '''greater''' than "-1"
The "trick" to handle these problems are:
* use a prefix char for positive and negative numbers so that a negative string is
always less than positive. '-' and '0' are suitable for this
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]