Class ParseLongFieldUpdateProcessorFactory
- 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.ParseLongFieldUpdateProcessorFactory
-
- All Implemented Interfaces:
NamedListInitializedPlugin
,SolrCoreAware
public class ParseLongFieldUpdateProcessorFactory extends ParseNumericFieldUpdateProcessorFactory
Attempts to mutate selected fields that have only CharSequence-typed values into Long values. 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 long field type.
If all values are parseable as long (or are already Long), then the field will be mutated, replacing each value with its parsed Long equivalent; otherwise, no mutation will occur.
The locale to use when parsing field values, which will affect the recognized grouping separator character, 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 "12 345 899" as 12345899L (the grouping separator character is U+00AO NO-BREAK SPACE).<processor class="solr.ParseLongFieldUpdateProcessorFactory"> <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).- Since:
- 4.4.0
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.solr.update.processor.FieldMutatingUpdateProcessorFactory
FieldMutatingUpdateProcessorFactory.SelectorParams
-
Nested classes/interfaces inherited from class org.apache.solr.update.processor.UpdateRequestProcessorFactory
UpdateRequestProcessorFactory.RunAlways
-
-
Field Summary
-
Fields inherited from class org.apache.solr.update.processor.ParseNumericFieldUpdateProcessorFactory
locale
-
-
Constructor Summary
Constructors Constructor Description ParseLongFieldUpdateProcessorFactory()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description UpdateRequestProcessor
getInstance(SolrQueryRequest req, SolrQueryResponse rsp, UpdateRequestProcessor next)
protected boolean
isSchemaFieldTypeCompatible(FieldType type)
Returns true if the given FieldType is compatible with this parsing factory.static Object
parsePossibleLong(Object srcVal, NumberFormat numberFormat)
-
Methods inherited from class org.apache.solr.update.processor.ParseNumericFieldUpdateProcessorFactory
getDefaultSelector, init
-
Methods inherited from class org.apache.solr.update.processor.FieldMutatingUpdateProcessorFactory
getSelector, inform, parseSelectorExclusionParams, parseSelectorParams
-
-
-
-
Method Detail
-
getInstance
public UpdateRequestProcessor getInstance(SolrQueryRequest req, SolrQueryResponse rsp, UpdateRequestProcessor next)
- Specified by:
getInstance
in classUpdateRequestProcessorFactory
-
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 classParseNumericFieldUpdateProcessorFactory
-
parsePossibleLong
public static Object parsePossibleLong(Object srcVal, NumberFormat numberFormat)
-
-