public class ParseBooleanFieldUpdateProcessorFactory extends FieldMutatingUpdateProcessorFactory
Attempts to mutate selected fields that have only CharSequence-typed values into Boolean values.
The default selection behavior is to mutate both those fields that don't match a schema field, as well as those fields that do match a schema field and have a field type that uses class solr.BooleanField.
If all values are parseable as boolean (or are already Boolean), then the field will be mutated, replacing each value with its parsed Boolean equivalent; otherwise, no mutation will occur.
The default true and false values are "true" and "false", respectively, and match case-insensitively. The following configuration changes the acceptable values, and requires a case-sensitive match - note that either individual <str> elements or <arr>-s of <str> elements may be used to specify the trueValue-s and falseValue-s:
<processor class="solr.ParseBooleanFieldUpdateProcessorFactory">
<str name="caseSensitive">true</str>
<str name="trueValue">True</str>
<str name="trueValue">Yes</str>
<arr name="falseValue">
<str>False</str>
<str>No</str>
<:/arr>
</processor>FieldMutatingUpdateProcessorFactory.SelectorParamsUpdateRequestProcessorFactory.RunAlways| Constructor and Description |
|---|
ParseBooleanFieldUpdateProcessorFactory() |
| 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 ParseBooleanFieldUpdateProcessorFactory()
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.