lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Harshvardhan Ojha <>
Subject RE: Problem with sorting solr docs
Date Tue, 03 Jul 2012 11:57:32 GMT

Thanks for reply.
I want to sort my docs on name field, it is working well only if I have all fields populated
But my latlng field is optional, every doc will not have this value. So those docs are not
getting sorted.

Harshvardhan Ojha

-----Original Message-----
From: Rafał Kuć [] 
Sent: Tuesday, July 03, 2012 5:24 PM
Subject: Re: Problem with sorting solr docs


Your query suggests that you are sorting on the 'name' field instead of the latlng field (sort=name

The question is what you are trying to achieve ? Do you want to sort your documents from a
given geographical point ? If that's the case you may want to look here:
and look at the possibility of sorting on the distance from a given point. 

 Rafał Kuć
 Sematext :: :: Solr - Lucene - Nutch - ElasticSearch

I have 260 docs which I want to sort on a single field latlng.
<str name="id">1</str>
<str name="name">Amphoe Khanom</str>
<str name="latlng">1.0,1.0</str>
My query is :
http://localhost:8080/solr/select?q=*:*&sort=name +asc
This query sorts all documents except those which doesn’t have latlng, and I can’t keep
any default value for this field. 
My question is how can I sort all docs on latlng?
Harshvardhan Ojha  | Software Developer - Technology Development
    |, 243 SP Infocity, Udyog Vihar Phase 1, Gurgaon, Haryana - 122 016, India

What's new?: Inspire - Discover an inspiring new way to plan and book travel online.

Office Map




View raw message