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:26:54 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, 


Kilometers 
17 
111 
97 
923 
65 
611 

Values in 'Kilometers' after soting are 

Kilometers 
97
923 
65 
611 
17 
111 


The 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,50000 

Kilometers 
20000 
10000 
40000 
50000 
20000 
when i try to sort now it is working perfectly 
Kilometers 
10000 
20000 
30000 
40000 
50000 
Datatypes that I have tried are, 



   <field name="adi_f10001" type="wc_keywordText" indexed="true"
stored="true" multiValued="false"/>



   <field name="adi_f10001" type="long" indexed="true" stored="true"
multiValued="false"/>




   <field name="adi_f10001" type="double" indexed="true" stored="true"
multiValued="false"/>



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-tp4050834.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Solr sorting is not working properly on long Fields

Posted by ballusethuraman <ba...@gmail.com>.
Yes I did.. But there is no change in result..



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

Re: Solr sorting is not working properly on long Fields

Posted by Gora Mohanty <go...@mimirtech.com>.
On 24 March 2013 11:56, ballusethuraman <ba...@gmail.com> wrote:
> Hi, I am having a column named 'Kilometers' and when I try to sort with that
> it is not working properly.
[...]
> 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.
[...]

Did you reindex after changing the data type of the column to
long?

Regards,
Gora