Re: problems search number range

2004-11-18 Thread Morus Walter
[EMAIL PROTECTED] writes:
> 
> this solution was the first that i tried.. but this does not run correctly.. 
> because:
> 
> when we try to sort this number in alphanumeric order we obtain that number 
> -0010 is higher than -0001
> 
right. I failed to see that.
So you would have to use a complement for negative numbers as well e.g. using
-9989 for -10, -9998 for -1, ...

But shifting the interval is easier of course.

Morus

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



Re: problems search number range

2004-11-18 Thread [EMAIL PROTECTED]
hi morus & company;

On Thursday 18 November 2004 12:49, Morus Walter wrote:
> [EMAIL PROTECTED] 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.

thx, this is just what i have done.. 



>
> Alternatively you have to find a string represantation providing the
> correct order for signed integers.
> E.g.
> -0010
> -0001
> 0
> 1
> 00020
> should work (in the range -..9), 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.


this solution was the first that i tried.. but this does not run correctly.. 
because:

when we try to sort this number in alphanumeric order we obtain that number 
-0010 is higher than -0001

so, the final solution is what you comment us at the beginning of your post.

thx a lot
d2clon

>
> Morus
>
> -
> 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]



Re: problems search number range

2004-11-18 Thread Morus Walter
[EMAIL PROTECTED] 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
0
1
00020
should work (in the range -..9), 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



problems search number range

2004-11-18 Thread [EMAIL PROTECTED]
(excuse me for my english)

hi people:
i am trying to do a search between two numbers.. 
at the very beginning it was all right, 
for example: when i had the number 20 and i searched between 10 and 30

query= 'number:[10 TO 30]'

then lucene found it.. but..

if i change the range numbers: 5 and 130 i started to have problems..
lucene didn't find the number 20 yet¡

i solved this changing the format of the numbers and putting this: 
number to look for: "020"
range: "005", "130"
query= 'number:[005 TO 030]

up to this point all correct.. 

but then another problem starts:
i need to use negative numbers and then all becomes crazy for me...

i need to solve this search:
number: -10
range: -50 TO 5

i need help.. 
i dont find anything using google.. 

thanks
d2clon





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