Class PrimitiveFieldType

Direct Known Subclasses:
BoolField, EnumFieldType, NumericFieldType, StrField

public abstract class PrimitiveFieldType extends FieldType
Abstract class defining shared behavior for primitive types Intended to be used as base class for non-analyzed fields like int, float, string, date etc, and set proper defaults for them
  • Constructor Details

    • PrimitiveFieldType

      public PrimitiveFieldType()
  • Method Details

    • init

      protected void init(IndexSchema schema, Map<String,String> args)
      Description copied from class: FieldType
      subclasses should initialize themselves with the args provided and remove valid arguments. leftover arguments will cause an exception. Common boolean properties have already been handled.
      Overrides:
      init in class FieldType
    • checkSupportsDocValues

      protected void checkSupportsDocValues()
      Description copied from class: FieldType
      Called by FieldType.checkSchemaField(SchemaField) if the field has docValues. By default none do.
      Overrides:
      checkSupportsDocValues in class FieldType
    • enableDocValuesByDefault

      protected boolean enableDocValuesByDefault()
      Description copied from class: FieldType
      Returns whether this field type should enable docValues by default for schemaVersion >= 1.7. This should not be enabled for fields that did not have docValues implemented by Solr 9.7, as users may have indexed documents without docValues (since they weren't supported). Flipping the default docValues values when they upgrade to a new version will break their index compatibility.

      New field types can enable this without issue, as long as they support docValues.

      Overrides:
      enableDocValuesByDefault in class FieldType
    • getDefaultMultiValueSelectorForSort

      public FieldType.MultiValueSelector getDefaultMultiValueSelectorForSort(SchemaField field, boolean reverse)
      Description copied from class: FieldType
      Method for indicating which FieldType.MultiValueSelector (if any) should be used when sorting on a multivalued field of this type for the specified direction (asc/desc). The default implementation returns null (for all inputs).
      Overrides:
      getDefaultMultiValueSelectorForSort in class FieldType
      Parameters:
      field - The SchemaField (of this type) in question
      reverse - false if this is an ascending sort, true if this is a descending sort.
      Returns:
      the implicit selector to use for this direction, or null if implicit sorting on the specified direction is not supported and should return an error.
      See Also: