Interface IndexSchemaManager
A schema has to be created before indexing and searching can happen.
A schema can become obsolete, in which case it needs to be updated (not always possible) or re-created (will drop any indexed data).
-
Method Summary
Modifier and TypeMethodDescriptioncreateIfMissing
(OperationSubmitter operationSubmitter) Creates the schema if it doesn't already exist.createOrUpdate
(OperationSubmitter operationSubmitter) Creates the schema if it doesn't already exist, or updates the existing schema to match requirements expressed by the mapper.createOrValidate
(ContextualFailureCollector failureCollector, OperationSubmitter operationSubmitter) Creates the schema if it doesn't already exist, or validates the existing schema against requirements expressed by the mapper.dropAndCreate
(OperationSubmitter operationSubmitter) Drops the schema and all indexed data if it exists, then creates the schema.dropIfExisting
(OperationSubmitter operationSubmitter) Drops the schema and all indexed data if it exists.void
exportExpectedSchema
(IndexSchemaCollector collector) Accepts a collector that will receive the schema export represented by this index schema manager.validate
(ContextualFailureCollector failureCollector, OperationSubmitter operationSubmitter) Validates the existing schema against requirements expressed by the mapper.
-
Method Details
-
createIfMissing
Creates the schema if it doesn't already exist.Does not change or validate anything if the schema already exists.
- Parameters:
operationSubmitter
- How to handle request to submit operation when the queue is full.- Returns:
- A future.
-
createOrValidate
CompletableFuture<?> createOrValidate(ContextualFailureCollector failureCollector, OperationSubmitter operationSubmitter) Creates the schema if it doesn't already exist, or validates the existing schema against requirements expressed by the mapper.If the schema exists and validation happens, validation failures do not trigger an exception, but instead are pushed to the given collector.
- Parameters:
failureCollector
- A collector for validation failures.operationSubmitter
- How to handle request to submit operation when the queue is full.- Returns:
- A future.
-
createOrUpdate
Creates the schema if it doesn't already exist, or updates the existing schema to match requirements expressed by the mapper.Updating the schema may be impossible (for example if the type of a field changed). In this case, the future will ultimately be completed with a
SearchException
.- Parameters:
operationSubmitter
- How to handle request to submit operation when the queue is full.- Returns:
- A future.
-
dropIfExisting
Drops the schema and all indexed data if it exists.Does not change anything if the schema does not exist.
- Parameters:
operationSubmitter
- How to handle request to submit operation when the queue is full.- Returns:
- A future.
-
dropAndCreate
Drops the schema and all indexed data if it exists, then creates the schema.- Parameters:
operationSubmitter
- How to handle request to submit operation when the queue is full.- Returns:
- A future.
-
validate
CompletableFuture<?> validate(ContextualFailureCollector failureCollector, OperationSubmitter operationSubmitter) Validates the existing schema against requirements expressed by the mapper.If the schema does not exist, a failure is pushed to the given collector.
If the index exists and validation happens, validation failures do not trigger an exception, but instead are pushed to the given collector.
- Parameters:
failureCollector
- A collector for validation failures.operationSubmitter
- How to handle request to submit operation when the queue is full.- Returns:
- A future.
-
exportExpectedSchema
Accepts a collector that will receive the schema export represented by this index schema manager.
-