Skip to content

Commit

Permalink
[#1148] remove white space stripping from indexing
Browse files Browse the repository at this point in the history
we now do it in a validator
  • Loading branch information
joetsoi committed Aug 22, 2013
1 parent 6650a96 commit a52f8bf
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions ckan/lib/search/index.py
Expand Up @@ -225,17 +225,6 @@ def index_package(self, pkg_dict, defer_commit=False):
# mark this CKAN instance as data source:
pkg_dict['site_id'] = config.get('ckan.site_id')

# Strip a selection of the fields.
# These fields are possible candidates for sorting search results on,
# so we strip leading spaces because solr will sort " " before "a" or "A".
for field_name in ['title']:
try:
value = pkg_dict.get(field_name)
if value:
pkg_dict[field_name] = value.lstrip()
except KeyError:
pass

# add a unique index_id to avoid conflicts
import hashlib
pkg_dict['index_id'] = hashlib.md5('%s%s' % (pkg_dict['id'],config.get('ckan.site_id'))).hexdigest()
Expand Down

0 comments on commit a52f8bf

Please sign in to comment.