java.lang.Object
org.apache.lucene.index.FieldInfos.Builder
- Enclosing class:
- FieldInfos
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionBuilder
(FieldInfos.FieldNumbers globalFieldNumbers) Creates a new instance with the givenFieldInfos.FieldNumbers
. -
Method Summary
Modifier and TypeMethodDescriptionAdds the provided FieldInfo to this Builder if this field doesn't exist in this Builder.(package private) FieldInfo
Adds the provided FieldInfo with the provided dvGen to this Builder if this field doesn't exist in this Builder.private boolean
Called only from assert(package private) FieldInfos
finish()
-
Field Details
-
byName
-
globalFieldNumbers
-
finished
private boolean finished
-
-
Constructor Details
-
Builder
Builder(FieldInfos.FieldNumbers globalFieldNumbers) Creates a new instance with the givenFieldInfos.FieldNumbers
.
-
-
Method Details
-
getSoftDeletesFieldName
-
add
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 schemaIllegalArgumentException
- 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
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 adddvGen
- – 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 schemaIllegalArgumentException
- 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
-
assertNotFinished
private boolean assertNotFinished()Called only from assert -
finish
FieldInfos finish()
-