thanks for the previous responses. i have the following file. and i am using the /update/csv handler to index this into solr! my questions is do i have to transform this file before i can index the first field as a date to the required format … or can i use the map parameter to achieve the same ..
2011-12-16 21:16:36,510 Total: 2139 Free: 1569
2011-12-16 21:17:07,593 Total: 2139 Free: 1572
2011-12-16 21:17:38,819 Total: 2139 Free: 1572
2011-12-16 21:18:09,789 Total: 2138 Free: 1567
2011-12-16 21:18:40,667 Total: 2139 Free: 1580
i tried using the map parameter thus ..
fieldnames=logged_dt,val_s
f.logged_dt.map=* *:*T*Z
basically i want each line to be transformed to this
2011-12-16T21:16:36Z,510 Total: 2139 Free: 1569
so it conforms to the specified date format..! am i missing something ? can i use the map parameter to do it or do i need to transform my input file ?
All Update handlers are pretty strict about the formats and dates usually suffer the most.
So, you cannot do this directly in CSV. And map does not support regular expressions – just direct values.
However, you can use Update Request Processor which can be added to any request processor using update.chain parameter in solrconfig.xml. You best bet is to use RegexReplaceProcessorFactory (requires Solr 4). It takes standard Java regular expressions including group replacement.