java.lang.Object
org.apache.lucene.index.FieldInfos.FieldNumbers
- Enclosing class:
FieldInfos
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Map
<String, FieldInfos.FieldDimensions> private final Map
<String, DocValuesType> private final Map
<String, IndexOptions> private int
private final String
private final boolean
private final Map
<String, FieldInfos.FieldVectorProperties> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) int
Returns the global field number for the given field name.(package private) void
clear()
(package private) FieldInfo
constructFieldInfo
(String fieldName, DocValuesType dvType, int newFieldNumber) Construct a new FieldInfo based on the options in global field numbers.(package private) void
setDocValuesType
(int number, String name, DocValuesType dvType) (package private) void
verifyConsistent
(Integer number, String name, DocValuesType dvType) (package private) void
(package private) void
verifyOrCreateDvOnlyField
(String fieldName, DocValuesType dvType, boolean fieldMustExist) This function is called fromIndexWriter
to verify if doc values of the field can be updated.private void
private void
verifySoftDeletedFieldName
(String fieldName, boolean isSoftDeletesField)
-
Field Details
-
numberToName
-
nameToNumber
-
indexOptions
-
docValuesType
-
dimensions
-
vectorProps
-
omitNorms
-
storeTermVectors
-
lowestUnassignedFieldNumber
private int lowestUnassignedFieldNumber -
softDeletesFieldName
-
strictlyConsistent
private final boolean strictlyConsistent
-
-
Constructor Details
-
FieldNumbers
FieldNumbers(String softDeletesFieldName, int indexCreatedVersionMajor)
-
-
Method Details
-
verifyFieldInfo
-
addOrGet
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
-
verifySameSchema
-
verifyOrCreateDvOnlyField
This function is called fromIndexWriter
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 fielddvType
- - expected doc values typefieldMustExist
- – 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
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 fielddvType
- doc values typenewFieldNumber
- a new field number- Returns:
null
iffieldName
doesn't exist in the map or is not of the samedvType
returns a new FieldInfo based based on the options in global field numbers
-
setDocValuesType
-
verifyConsistent
-
getFieldNames
-
clear
void clear()
-