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 TypeMethodDescriptionCreates the schema if it doesn't already exist.Creates the schema if it doesn't already exist, or updates the existing schema to match requirements expressed by the mapper.createOrValidate(ContextualFailureCollector failureCollector) Creates the schema if it doesn't already exist, or validates the existing schema against requirements expressed by the mapper.Drops the schema and all indexed data if it exists, then creates the schema.Drops the schema and all indexed data if it exists.validate(ContextualFailureCollector failureCollector) Validates the existing schema against requirements expressed by the mapper.
-
Method Details
-
createIfMissing
CompletableFuture<?> createIfMissing()Creates the schema if it doesn't already exist.Does not change or validate anything if the schema already exists.
- Returns:
- A future.
-
createOrValidate
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.- Returns:
- A future.
-
createOrUpdate
CompletableFuture<?> 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.- Returns:
- A future.
-
dropIfExisting
CompletableFuture<?> dropIfExisting()Drops the schema and all indexed data if it exists.Does not change anything if the schema does not exists.
- Returns:
- A future.
-
dropAndCreate
CompletableFuture<?> dropAndCreate()Drops the schema and all indexed data if it exists, then creates the schema.- Returns:
- A future.
-
validate
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.- Returns:
- A future.
-