Interface IndexSchemaManager
-
public interface IndexSchemaManager
A manager for the schema of a single index, i.e. the data structure in which index data is stored. It includes the core index files, but also any additional configuration required by the backend such as field metadata or analyzer definitions.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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description CompletableFuture<?>
createIfMissing()
Creates the schema if it doesn't already exist.CompletableFuture<?>
createOrUpdate()
Creates the schema if it doesn't already exist, or updates the existing schema to match requirements expressed by the mapper.CompletableFuture<?>
createOrValidate(ContextualFailureCollector failureCollector)
Creates the schema if it doesn't already exist, or validates the existing schema against requirements expressed by the mapper.CompletableFuture<?>
dropAndCreate()
Drops the schema and all indexed data if it exists, then creates the schema.CompletableFuture<?>
dropIfExisting()
Drops the schema and all indexed data if it exists.CompletableFuture<?>
validate(ContextualFailureCollector failureCollector)
Validates the existing schema against requirements expressed by the mapper.
-
-
-
Method Detail
-
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
CompletableFuture<?> createOrValidate(ContextualFailureCollector failureCollector)
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
CompletableFuture<?> validate(ContextualFailureCollector failureCollector)
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.
-
-