org.apache.solr.update.processor

Class ParseBooleanFieldUpdateProcessorFactory

  • All Implemented Interfaces:
    NamedListInitializedPlugin, SolrCoreAware


    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>