public class ParseDateFieldUpdateProcessorFactory extends FieldMutatingUpdateProcessorFactory
Attempts to mutate selected fields that have only CharSequence-typed values into Date values. Solr will continue to index date/times in the UTC time zone, but the input date/times may be expressed using other time zones, and will be converted to UTC when they are mutated.
The default selection behavior is to mutate both those fields that don't match a schema field, as well as those fields that match a schema field with a field type that uses class solr.DateField or a sub-class, including solr.TrieDateField.
If all values are parseable as dates (or are already Date), then the field will be mutated, replacing each value with its parsed Date equivalent; otherwise, no mutation will occur.
One or more date "format" specifiers must be specified. See Joda-time's DateTimeFormat javadocs for a description of format strings.
A default time zone name or offset may optionally be specified for those dates that don't include an explicit zone/offset. NOTE: three-letter zone designations like "EST" are not parseable (with the single exception of "UTC"), because they are ambiguous. If no default time zone is specified, UTC will be used. See Wikipedia's list of TZ database time zone names.
The locale to use when parsing field values using the specified formats may
optionally be specified. If no locale is configured, then Locale.ROOT
will be used. The following configuration specifies the French/France locale and
two date formats that will parse the strings "le mardi 8 janvier 2013" and
"le 28 déc. 2010 à 15 h 30", respectively. Note that either individual <str>
elements or <arr>-s of <str> elements may be used to specify the
date format(s):
<processor class="solr.ParseDateFieldUpdateProcessorFactory">
<str name="defaultTimeZone">Europe/Paris</str>
<str name="locale">fr_FR</str>
<arr name="format">
<str>'le' EEEE dd MMMM yyyy</str>
<str>'le' dd MMM. yyyy 'à' HH 'h' mm</str>
</arr>
</processor>
See Locale for a description of acceptable language, country (optional)
and variant (optional) values, joined with underscore(s).
FieldMutatingUpdateProcessorFactory.SelectorParamsUpdateRequestProcessorFactory.RunAlways| Modifier and Type | Field and Description |
|---|---|
static org.slf4j.Logger |
log |
| Constructor and Description |
|---|
ParseDateFieldUpdateProcessorFactory() |
| Modifier and Type | Method and Description |
|---|---|
FieldMutatingUpdateProcessor.FieldNameSelector |
getDefaultSelector(SolrCore core)
Returns true if the field doesn't match any schema field or dynamic field,
or if the matched field's type is BoolField
|
UpdateRequestProcessor |
getInstance(SolrQueryRequest req,
SolrQueryResponse rsp,
UpdateRequestProcessor next) |
void |
init(NamedList args)
Handles common initialization related to source fields for
constructing the FieldNameSelector to be used.
|
getBooleanArg, getSelector, inform, oneOrMany, parseSelectorExclusionParams, parseSelectorParamspublic ParseDateFieldUpdateProcessorFactory()
public UpdateRequestProcessor getInstance(SolrQueryRequest req, SolrQueryResponse rsp, UpdateRequestProcessor next)
getInstance in class UpdateRequestProcessorFactorypublic void init(NamedList args)
FieldMutatingUpdateProcessorFactoryinit in interface NamedListInitializedPlugininit in class FieldMutatingUpdateProcessorFactorypublic FieldMutatingUpdateProcessor.FieldNameSelector getDefaultSelector(SolrCore core)
getDefaultSelector in class FieldMutatingUpdateProcessorFactoryFieldMutatingUpdateProcessor.SELECT_ALL_FIELDSCopyright © 2000-2015 Apache Software Foundation. All Rights Reserved.