Class ParseBooleanFieldUpdateProcessorFactory
- All Implemented Interfaces:
NamedListInitializedPlugin,SolrCoreAware
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>- Since:
- 4.4.0
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.solr.update.processor.FieldMutatingUpdateProcessorFactory
FieldMutatingUpdateProcessorFactory.SelectorParamsNested classes/interfaces inherited from class org.apache.solr.update.processor.UpdateRequestProcessorFactory
UpdateRequestProcessorFactory.RunAlways -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetDefaultSelector(SolrCore core) Returns true if the field doesn't match any schema field or dynamic field, or if the matched field's type is BoolFieldgetInstance(SolrQueryRequest req, SolrQueryResponse rsp, UpdateRequestProcessor next) voidinit(org.apache.solr.common.util.NamedList<?> args) Handles common initialization related to source fields for constructing the FieldNameSelector to be used.static ObjectparsePossibleBoolean(Object srcVal, boolean caseSensitive, Set<String> trueValues, Set<String> falseValues) Methods inherited from class org.apache.solr.update.processor.FieldMutatingUpdateProcessorFactory
getSelector, inform, parseSelectorExclusionParams, parseSelectorParams
-
Constructor Details
-
ParseBooleanFieldUpdateProcessorFactory
public ParseBooleanFieldUpdateProcessorFactory()
-
-
Method Details
-
getInstance
public UpdateRequestProcessor getInstance(SolrQueryRequest req, SolrQueryResponse rsp, UpdateRequestProcessor next) - Specified by:
getInstancein classUpdateRequestProcessorFactory
-
init
public void init(org.apache.solr.common.util.NamedList<?> args) Description copied from class:FieldMutatingUpdateProcessorFactoryHandles common initialization related to source fields for constructing the FieldNameSelector to be used.Will error if any unexpected init args are found, so subclasses should remove any subclass-specific init args before calling this method.
- Specified by:
initin interfaceNamedListInitializedPlugin- Overrides:
initin classFieldMutatingUpdateProcessorFactory- Parameters:
args- non-null list of initialization parameters (may be empty)
-
getDefaultSelector
Returns true if the field doesn't match any schema field or dynamic field, or if the matched field's type is BoolField- Overrides:
getDefaultSelectorin classFieldMutatingUpdateProcessorFactory- See Also:
-
parsePossibleBoolean
-