You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by ballusethuraman <ba...@gmail.com> on 2013/03/24 07:21:05 UTC

Solr Sorting is not working properly on long Fields

Hi,      I am having a column named 'Kilometers' and when I try to sort with
that it is not working properly.The values in 'Kilometers' column
are,Kilometers171119792365611Values in 'Kilometers' after soting are
Kilometers979236561117111The Problem here is, when 97 is compared with 923
it is taking 97 as bigger number since 97 is greater than 923. Initially
Kilometers column was having string as datatype and I thought the problem
could be because of that and i changed the datatype of that column to
'long'. Even then i couldn't see any change in the results.But when I insert
values which are having same number of digits say, 10000, 20000,
30000,40000,50000Kilometers2000010000400005000020000  when i try to sort now
it is working perfectlyKilometers1000020000300004000050000Datatypes that I
have tries are,         Can anyone helpme to get rid out of this problem...
Thanks in Advance....



--
View this message in context: http://lucene.472066.n3.nabble.com/Solr-Sorting-is-not-working-properly-on-long-Fields-tp4050833.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Solr Sorting is not working properly on long Fields

Posted by SUJIT PAL <su...@comcast.net>.
Hi ballusethuraman, 

I am sure you have done this already, but just to be sure, did you reindex your existing kilometer data after you changed the data type from string to long? If not, then you should.

-sujit

On Mar 23, 2013, at 11:21 PM, ballusethuraman wrote:

> Hi,      I am having a column named 'Kilometers' and when I try to sort with
> that it is not working properly.The values in 'Kilometers' column
> are,Kilometers171119792365611Values in 'Kilometers' after soting are
> Kilometers979236561117111The Problem here is, when 97 is compared with 923
> it is taking 97 as bigger number since 97 is greater than 923. Initially
> Kilometers column was having string as datatype and I thought the problem
> could be because of that and i changed the datatype of that column to
> 'long'. Even then i couldn't see any change in the results.But when I insert
> values which are having same number of digits say, 10000, 20000,
> 30000,40000,50000Kilometers2000010000400005000020000  when i try to sort now
> it is working perfectlyKilometers1000020000300004000050000Datatypes that I
> have tries are,         Can anyone helpme to get rid out of this problem...
> Thanks in Advance....
> 
> 
> 
> --
> View this message in context: http://lucene.472066.n3.nabble.com/Solr-Sorting-is-not-working-properly-on-long-Fields-tp4050833.html
> Sent from the Solr - User mailing list archive at Nabble.com.