Class FieldInfos.FieldNumbers

  • Enclosing class:
    FieldInfos

    static final class FieldInfos.FieldNumbers
    extends java.lang.Object
    • Field Detail

      • numberToName

        private final java.util.Map<java.lang.Integer,​java.lang.String> numberToName
      • nameToNumber

        private final java.util.Map<java.lang.String,​java.lang.Integer> nameToNumber
      • indexOptions

        private final java.util.Map<java.lang.String,​IndexOptions> indexOptions
      • docValuesType

        private final java.util.Map<java.lang.String,​DocValuesType> docValuesType
      • omitNorms

        private final java.util.Map<java.lang.String,​java.lang.Boolean> omitNorms
      • storeTermVectors

        private final java.util.Map<java.lang.String,​java.lang.Boolean> storeTermVectors
      • lowestUnassignedFieldNumber

        private int lowestUnassignedFieldNumber
      • softDeletesFieldName

        private final java.lang.String softDeletesFieldName
      • strictlyConsistent

        private final boolean strictlyConsistent
    • Constructor Detail

      • FieldNumbers

        FieldNumbers​(java.lang.String softDeletesFieldName,
                     int indexCreatedVersionMajor)
    • Method Detail

      • 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​(java.lang.String fieldName,
                                                boolean isSoftDeletesField)
      • verifySameSchema

        private void verifySameSchema​(FieldInfo fi)
      • verifyOrCreateDvOnlyField

        void verifyOrCreateDvOnlyField​(java.lang.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:
        java.lang.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​(java.lang.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
      • setDocValuesType

        void setDocValuesType​(int number,
                              java.lang.String name,
                              DocValuesType dvType)
      • verifyConsistent

        void verifyConsistent​(java.lang.Integer number,
                              java.lang.String name,
                              DocValuesType dvType)
      • getFieldNames

        java.util.Set<java.lang.String> getFieldNames()
      • clear

        void clear()