Class FieldInfos.FieldNumbers

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

static final class FieldInfos.FieldNumbers extends Object
  • Field Details

  • Constructor Details

    • FieldNumbers

      FieldNumbers(String softDeletesFieldName, int indexCreatedVersionMajor)
  • Method Details

    • verifyFieldInfo

      void verifyFieldInfo(FieldInfo fi)
    • addOrGet

      int addOrGet(FieldInfo fi)
      Returns the global field number for the given field name. If the name does not exist yet it tries to add it with the given preferred field number assigned if possible otherwise the first unassigned field number is used as the field number.
    • verifySoftDeletedFieldName

      private void verifySoftDeletedFieldName(String fieldName, boolean isSoftDeletesField)
    • verifySameSchema

      private void verifySameSchema(FieldInfo fi)
    • verifyOrCreateDvOnlyField

      void verifyOrCreateDvOnlyField(String fieldName, DocValuesType dvType, boolean fieldMustExist)
      This function is called from IndexWriter to verify if doc values of the field can be updated. If the field with this name already exists, we verify that it is doc values only field. If the field doesn't exists and the parameter fieldMustExist is false, we create a new field in the global field numbers.
      Parameters:
      fieldName - - name of the field
      dvType - - expected doc values type
      fieldMustExist - – if the field must exist.
      Throws:
      IllegalArgumentException - if the field must exist, but it doesn't, or if the field exists, but it is not doc values only field with the provided doc values type.
    • constructFieldInfo

      FieldInfo constructFieldInfo(String fieldName, DocValuesType dvType, int newFieldNumber)
      Construct a new FieldInfo based on the options in global field numbers. This method is not synchronized as all the options it uses are not modifiable.
      Parameters:
      fieldName - name of the field
      dvType - doc values type
      newFieldNumber - a new field number
      Returns:
      null if fieldName doesn't exist in the map or is not of the same dvType returns a new FieldInfo based based on the options in global field numbers
    • getFieldNames

      Set<String> getFieldNames()
    • clear

      void clear()