Class FieldInfos.Builder

java.lang.Object
org.apache.lucene.index.FieldInfos.Builder
Enclosing class:
FieldInfos

static final class FieldInfos.Builder extends Object
  • Field Details

  • Constructor Details

  • Method Details

    • getSoftDeletesFieldName

      public String getSoftDeletesFieldName()
    • getParentFieldName

      public String getParentFieldName()
      Returns the name of the parent document field or null if no parent field is configured
    • add

      public FieldInfo add(FieldInfo fi)
      Adds the provided FieldInfo to this Builder if this field doesn't exist in this Builder. Also adds a new field with its schema options to the global FieldNumbers if the field doesn't exist globally in the index. The field number is reused if possible for consistent field numbers across segments.

      If the field already exists: 1) the provided FieldInfo's schema is checked against the existing field and 2) the provided FieldInfo's attributes are added to the existing FieldInfo's attributes.

      Parameters:
      fi - – FieldInfo to add
      Returns:
      The existing FieldInfo if the field with this name already exists in the builder, or a new constructed FieldInfo with the same schema as provided and a consistent global field number.
      Throws:
      IllegalArgumentException - if there already exists field with this name in Builder but with a different schema
      IllegalArgumentException - if there already exists field with this name globally but with a different schema.
      IllegalStateException - if the Builder is already finished building and doesn't accept new fields.
    • add

      FieldInfo add(FieldInfo fi, long dvGen)
      Adds the provided FieldInfo with the provided dvGen to this Builder if this field doesn't exist in this Builder. Also adds a new field with its schema options to the global FieldNumbers if the field doesn't exist globally in the index. The field number is reused if possible for consistent field numbers across segments.

      If the field already exists: 1) the provided FieldInfo's schema is checked against the existing field and 2) the provided FieldInfo's attributes are added to the existing FieldInfo's attributes.

      Parameters:
      fi - – FieldInfo to add
      dvGen - – doc values generation of the FieldInfo to add
      Returns:
      The existing FieldInfo if the field with this name already exists in the builder, or a new constructed FieldInfo with the same schema as provided and a consistent global field number.
      Throws:
      IllegalArgumentException - if there already exists field with this name in Builder but with a different schema
      IllegalArgumentException - if there already exists field with this name globally but with a different schema.
      IllegalStateException - if the Builder is already finished building and doesn't accept new fields.
    • fieldInfo

      public FieldInfo fieldInfo(String fieldName)
    • assertNotFinished

      private boolean assertNotFinished()
      Called only from assert
    • finish

      FieldInfos finish()