org.apache.solr.update.processor
Class ParseDoubleFieldUpdateProcessorFactory
java.lang.Object
org.apache.solr.update.processor.UpdateRequestProcessorFactory
org.apache.solr.update.processor.FieldMutatingUpdateProcessorFactory
org.apache.solr.update.processor.ParseNumericFieldUpdateProcessorFactory
org.apache.solr.update.processor.ParseDoubleFieldUpdateProcessorFactory
- All Implemented Interfaces:
- NamedListInitializedPlugin, SolrCoreAware
public class ParseDoubleFieldUpdateProcessorFactory
- extends ParseNumericFieldUpdateProcessorFactory
Attempts to mutate selected fields that have only CharSequence-typed values
into Double values. If required, rounding uses ceiling mode:
RoundingMode.CEILING
. Grouping separators (',' in the ROOT locale)
are parsed.
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.DoubleField, solr.TrieDoubleField, or
solr.SortableDoubleField.
If all values are parseable as double (or are already Double), then the field
will be mutated, replacing each value with its parsed Double equivalent;
otherwise, no mutation will occur.
The locale to use when parsing field values, which will affect the recognized
grouping separator and decimal characters, may optionally be specified. If
no locale is configured, then Locale.ROOT
will be used. The following
configuration specifies the Russian/Russia locale, which will parse the string
string "12 345,899" as double value 12345.899 (the grouping separator
character is U+00AO NO-BREAK SPACE).
<processor class="solr.ParseDoubleFieldUpdateProcessorFactory">
<str name="locale">ru_RU</str>
</processor>
See Locale
for a description of acceptable language, country (optional)
and variant (optional) values, joined with underscore(s).
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ParseDoubleFieldUpdateProcessorFactory
public ParseDoubleFieldUpdateProcessorFactory()
getInstance
public UpdateRequestProcessor getInstance(SolrQueryRequest req,
SolrQueryResponse rsp,
UpdateRequestProcessor next)
- Specified by:
getInstance
in class UpdateRequestProcessorFactory
isSchemaFieldTypeCompatible
protected boolean isSchemaFieldTypeCompatible(FieldType type)
- Description copied from class:
ParseNumericFieldUpdateProcessorFactory
- Returns true if the given FieldType is compatible with this parsing factory.
- Specified by:
isSchemaFieldTypeCompatible
in class ParseNumericFieldUpdateProcessorFactory
Copyright © 2000-2013 Apache Software Foundation. All Rights Reserved.