You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Mohammad Norouzi <mn...@gmail.com> on 2007/08/02 08:22:26 UTC

Solr's NumberUtils doesnt work

Hi
I am using NumberUtils to encode and decode numbers while indexing and
searching, when I am going to decode the number retrieved from an index it
throws exception for some fields
the exception message is:

Caused by: java.lang.StringIndexOutOfBoundsException: String index out of
range: 1
    at java.lang.String.charAt(Unknown Source)
    at org.apache.solr.util.NumberUtils.SortableStr2int(NumberUtils.java
:125)
    at org.apache.solr.util.NumberUtils.SortableStr2int(NumberUtils.java:37)
    at com.payvand.lucene.util.ExtendedNumberUtils.decodeInteger(
ExtendedNumberUtils.java:123)


I dont know why this happen, I am wondering if it has something to do with
character encoding. have you had such problem?

thanks

-- 
Regards,
Mohammad Norouzi
--------------------------
see my blog: http://brainable.blogspot.com/
another in Persian: http://fekre-motefavet.blogspot.com/

Re: Solr's NumberUtils doesnt work

Posted by testn <te...@doramail.com>.
How did you encode your integer into String? Did you use int2sortableStr?



is_maximum wrote:
> 
> Hi
> I am using NumberUtils to encode and decode numbers while indexing and
> searching, when I am going to decode the number retrieved from an index it
> throws exception for some fields
> the exception message is:
> 
> Caused by: java.lang.StringIndexOutOfBoundsException: String index out of
> range: 1
>     at java.lang.String.charAt(Unknown Source)
>     at org.apache.solr.util.NumberUtils.SortableStr2int(NumberUtils.java
> :125)
>     at
> org.apache.solr.util.NumberUtils.SortableStr2int(NumberUtils.java:37)
>     at com.payvand.lucene.util.ExtendedNumberUtils.decodeInteger(
> ExtendedNumberUtils.java:123)
> 
> 
> I dont know why this happen, I am wondering if it has something to do with
> character encoding. have you had such problem?
> 
> thanks
> 
> -- 
> Regards,
> Mohammad Norouzi
> --------------------------
> see my blog: http://brainable.blogspot.com/
> another in Persian: http://fekre-motefavet.blogspot.com/
> 
> 

-- 
View this message in context: http://www.nabble.com/Solr%27s-NumberUtils-doesnt-work-tf4204371.html#a11963213
Sent from the Lucene - Java Users mailing list archive at Nabble.com.


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