I have a rails application that is using thinking_sphinx for the searching. My problem is that the result returned is sorted with capitals first and lower case after it at the bottom. I'd like to mix them so that both 'A' and 'a' comes before 'B'. This is the method I'm using:
Company.search(query, :star => true, :page => params[:page], :per_page => 20, :order => :name, :sort_mode => :asc)
You have to configure sphinx to transform the input, making uppercase letters become lowercase letters. You can do this with the "charset_table" config.
And here's a complementary tutorial on how to configure it with thinking_sphinx.
Maurício's answer is almost on the right track - but that's for transforming the text that Sphinx indexes for fields. When you're sorting, you're doing that by attributes (which don't use the charset table transformations).
What you'll need to do is separate the sorting attribute of name out from the field, and force the attribute version to use lowercase:
And then searching becomes:
After researching many hours I got simple and elegant solution for case insensitive search. Just define your index in following way.