Package com.atlassian.jira.search.index
Interface IndexSchema.Builder
- All Known Implementing Classes:
DefaultIndexSchema.Builder
- Enclosing interface:
IndexSchema
public static interface IndexSchema.Builder
Builder for
IndexSchema-
Method Summary
Modifier and TypeMethodDescriptionAdds a field to the schemaAdds multiple fields to the schemaaddFields(Collection<Field> fields) Adds multiple fields to the schemaaddRelation(String parentDocumentType, String childDocumentType) Adds a relation between two document typesaddRelations(String parentDocumentType, Collection<String> childDocumentTypes) Adds a relation between a parent document type and multiple child document typesbuild()Builds the schemabooleanfieldIsDefined(String fieldName) Checks if a field is defined in the schemaremoveField(String fieldName) Removes a field from the schemasetFields(Collection<Field> fields) Sets the schema fieldssetRelations(Map<String, Collection<String>> relations) Sets the relations between document types, replacing any existing relationsversionField(LongField field)
-
Method Details
-
versionField
- Parameters:
field- the field to be used as the version field- Returns:
- the builder
-
setFields
Sets the schema fields- Parameters:
fields- the schema fields- Returns:
- the builder
-
addField
Adds a field to the schema- Parameters:
field- the field to be added to the schema- Returns:
- the builder
-
addFields
Adds multiple fields to the schema- Parameters:
fields- the fields to be added to the schema- Returns:
- the builder
-
addFields
Adds multiple fields to the schema- Parameters:
fields- the fields to be added to the schema- Returns:
- the builder
-
removeField
Removes a field from the schema- Parameters:
fieldName- the name of the field to be removed. Does nothing if the field is not present- Returns:
- the builder
-
fieldIsDefined
Checks if a field is defined in the schema- Parameters:
fieldName- the name of the field to check- Returns:
- true if the field is defined, false otherwise
-
addRelation
Adds a relation between two document types- Parameters:
parentDocumentType- the parent document typechildDocumentType- the child document type- Returns:
- the builder
-
addRelations
Adds a relation between a parent document type and multiple child document types- Parameters:
parentDocumentType- the parent document typechildDocumentTypes- the child document types- Returns:
- the builder
-
setRelations
Sets the relations between document types, replacing any existing relations- Parameters:
relations- the relations between document types- Returns:
- the builder
-
build
IndexSchema build()Builds the schema- Returns:
- the schema
- Throws:
FieldAlreadyExistsException- if multiple fields exist with the same name
-