okfn/ckan — pull request #267 by tobes (2013-03-11 13:48:44+00:00)
Title: Invalid dates on a "_date" ending field will crash the indexing

This commit 783cf829 introduced a new dynamic field on the Solr schema to index automatically as dates every field ending in "_date". Unfortunately Solr is quite picky in terms of its format and will return an error even with values like "2012-01-02"

SearchIndexError: HTTP code=400, reason=Invalid Date String:'2012-01-02'

There needs to be a check before indexing and format the date to a suitable format for Solr. It may be worth adding the dependency of [dateutil](http://labix.org/python-dateutil) for this.