[ckan-dev] Case insensitive package sort

Khalegh Mamakani khalegh at highwaythreesolutions.com
Mon Jun 23 21:30:08 UTC 2014


Hi everybody,

When sorting the list of packages, ckan tackes character cases into account. I tried to do a case insensitive sorting by changing the Solr schema, but it wasn’t successful. 
Ckan uses title_string as a copy of package title for sorting. The index_package method of PackageSearchIndex class assigns the value of title to title string :


        # add to string field for sorting
        title = pkg_dict.get('title')
        if title:
            pkg_dict['title_string'] = title

But, shouldn’t it use title.lower() instead?  It might be even better to use a configuration attribute to let the user set the his/her own sorting preferences and based on that assigns title or title.lower() to title_string.

Does any body know a better way of achieving a case insensitive sort?

Thanks,
Khalegh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20140623/cfd9786f/attachment-0002.html>


More information about the ckan-dev mailing list