Dear Wiki user, You have subscribed to a wiki page or wiki category on "Solr Wiki" for change notification.
The following page has been changed by NoblePaul: http://wiki.apache.org/solr/DataImportHandler The comment on the change is: encodeUrl and escapeSql ------------------------------------------------------------------------------ === Custom formatting in query and url using Functions === While the namespace concept is useful , the user may want to put some computed value into the query or url for example there is a Date object and your datasource accepts Date in some custom format . There are a few functions provided by the !DataImportHandler which can do some of these. * ''formatDate'' : It is used like this `'${dataimporter.functions.formatDate(item.ID, yyyy-MM-dd HH:mm)}'` . The first argument can be a valid value from the !VariableResolver and the second cvalue can be a a format string (use !SimpledateFormat) . The first argument can be a computed value eg: `'${dataimporter.functions.formatDate('NOW-3DAYS', yyyy-MM-dd HH:mm)}'` and it uses the syntax of the datemath parser in Solr. (note that it must enclosed in single quotes) - - + * ''escapeSql'' : Use this to escape special sql characters . eg : `'${dataimporter.functions.escapeSql(item.ID)}'` . Takes only one argument and must be a valid value in the !VaraiableResolver. + * ''encodeUrl'' : Us this to encode urls . eg : `'${dataimporter.functions.encodeUrl(item.ID)}'` . Takes only one argument and must be a valid value in the !VaraiableResolver
