That's always what happens (not just in Solr) when you store numbers
as text. You could store them as text-sortable numbers with leading
zeros (e.g. 04 vs. 45), but then what happens when you hit a 100?
Alternatively, if that field has only numbers, index it as a numeric
type. Make sure to use one of the new types (see recent Solr example),
not the old type that also has the same problem.

Regards,
  Alex.
Personal: http://www.outerthoughts.com/ and @arafalov
Solr resources: http://www.solr-start.com/ and @solrstart
Solr popularizers community: https://www.linkedin.com/groups?gid=6713853


On Tue, Jul 15, 2014 at 2:24 PM, madhav bahuguna
<madhav.bahug...@gmail.com> wrote:
> Iam trying to sort my records but the result i get is not correct
> My url query--
> http://localhost:8983/solr/select/?&q=*:*&fl=business_point&sort=business_point+desc
>
> Iam trying to sort my records by business_points but the result i get is in
> like this
> 9
> 8
> 7
> 6
> 5
> 45
> 4
> 4
> 10
> 1
>
> Whys am i getting my results in the wrong order
> my schema looks like this
> <field name="business_point" type="text_general" indexed="true"
> stored="true" required="false" multiValued="false"/>
>
> --
> Regards
> Madhav Bahuguna

Reply via email to