Best way to do case insensitive sorting

149 views
Skip to first unread message

Randy

unread,
Nov 24, 2009, 5:25:10 PM11/24/09
to Sunspot
If I index a field :title and then sort by that field I get results
like:

A
B
a
b

Now, of course I can add a separate :sort_title that is lower cased,
but I'd rather not do that for every string field I need to index.
Another solution is to modify the Solf.StrField type in schema.xml to
the following.

<fieldtype class='solr.TextField' name='string'
positionIncrementGap='100'>
<analyzer>
<tokenizer class='solr.StandardTokenizerFactory' />
<filter class='solr.StandardFilterFactory' />
<filter class='solr.LowerCaseFilterFactory' />
</analyzer>
</fieldtype>

However, I am not sure if I am introducing some other issues with
this. Anyone else have a way to solve this problem?
Reply all
Reply to author
Forward
0 new messages