You may not sort on a tokenized field. You may not sort on a multiValued field. You can only have one term in a field.

If there are more search terms than documents, A) sorting doesn't mean anything and B) Lucene will throw an exception.

Erick Erickson wrote:
In general, the behavior when sorting is not predictable when
sorting on a tokenized field, which "text" is. What would
it mean to sort on a field with "erick" "Moazzam" as tokens
in a single document? Should it be in the "e"s or the "m"s?

That said, you probably want to watch out for case....

Best
Erick

On Fri, Oct 22, 2010 at 10:02 AM, Moazzam Khan<moazz...@gmail.com>  wrote:

For anyone who faced the same problem, changing the field to string
from text worked!

-Moazzam

On Fri, Oct 22, 2010 at 8:50 AM, Moazzam Khan<moazz...@gmail.com>  wrote:
The field type of the first name and last name is text. Could that be
why it's not sorting properly? I just changed it to string and started
a full-import. Hopefully that will work.

Thanks,
Moazzam

On Thu, Oct 21, 2010 at 7:42 PM, Jayendra Patil
<jayendra.patil....@gmail.com>  wrote:
need additional information .....
Sorting is easy in Solr just by passing the sort parameter

However, when it comes to text sorting it depends on how you analyse
and tokenize your fields
Sorting does not work on fields with multiple tokens.

http://wiki.apache.org/solr/FAQ#Why_Isn.27t_Sorting_Working_on_my_Text_Fields.3F
On Thu, Oct 21, 2010 at 7:24 PM, Moazzam Khan<moazz...@gmail.com>
wrote:
Hey guys,

I have a list of people indexed in Solr. I am trying to sort by their
first names but I keep getting results that are not alphabetically
sorted (I see the names starting with W before the names starting with
A). I have a feeling that the results are first being sorted by
relevancy then sorted by first name.

Is there a way I can get the results to be sorted alphabetically?

Thanks,
Moazzam

Reply via email to