Clarke
Clarke

Reputation: 295

Solr CSV import that has a field with a non standard date format

I am trying to import several .csv files that contain a few fields with a date format of "yyyyMMdd". I quickly found that the DataImportHandler does not easily support csv files. In the DataImportHandler, it is possible to use the LineEntityProcessor and then a RegexTransformer, but that is pretty messy. The next method I tried was to post the file to the CSVRequestHandler, but I have not found a way to specify what SimpleDateFormat to use to parse the field. I have been searching for a way around this problem, but I think I am doomed to either a pre-processing step, or mucking with the RegexTransformer. Any help would be greatly appreciated.

Edit: I should add that I am on Solr 3.5.

Upvotes: 2

Views: 1035

Answers (2)

C. Kelly
C. Kelly

Reputation: 162

Have you looked into the DateFormatTransformer?

Upvotes: 0

Persimmonium
Persimmonium

Reputation: 15791

or. to stay within solr. index it in a string field. and using an UpdateProcessor copy it to a date field in the right format. preety easy

Upvotes: 1

Related Questions