Class LuceneIndexSchemaManager

java.lang.Object
org.hibernate.search.backend.lucene.schema.management.impl.LuceneIndexSchemaManager
All Implemented Interfaces:
IndexSchemaManager

public class LuceneIndexSchemaManager extends Object implements IndexSchemaManager
  • Constructor Details

  • Method Details

    • createIfMissing

      public CompletableFuture<?> createIfMissing(OperationSubmitter operationSubmitter)
      Description copied from interface: IndexSchemaManager
      Creates the schema if it doesn't already exist.

      Does not change or validate anything if the schema already exists.

      Specified by:
      createIfMissing in interface IndexSchemaManager
      Parameters:
      operationSubmitter - How to handle request to submit operation when the queue is full.
      Returns:
      A future.
    • createOrValidate

      public CompletableFuture<?> createOrValidate(ContextualFailureCollector failureCollector, OperationSubmitter operationSubmitter)
      Description copied from interface: IndexSchemaManager
      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.

      Specified by:
      createOrValidate in interface IndexSchemaManager
      Parameters:
      failureCollector - A collector for validation failures.
      operationSubmitter - How to handle request to submit operation when the queue is full.
      Returns:
      A future.
    • createOrUpdate

      public CompletableFuture<?> createOrUpdate(OperationSubmitter operationSubmitter)
      Description copied from interface: IndexSchemaManager
      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.

      Specified by:
      createOrUpdate in interface IndexSchemaManager
      Parameters:
      operationSubmitter - How to handle request to submit operation when the queue is full.
      Returns:
      A future.
    • dropIfExisting

      public CompletableFuture<?> dropIfExisting(OperationSubmitter operationSubmitter)
      Description copied from interface: IndexSchemaManager
      Drops the schema and all indexed data if it exists.

      Does not change anything if the schema does not exist.

      Specified by:
      dropIfExisting in interface IndexSchemaManager
      Parameters:
      operationSubmitter - How to handle request to submit operation when the queue is full.
      Returns:
      A future.
    • dropAndCreate

      public CompletableFuture<?> dropAndCreate(OperationSubmitter operationSubmitter)
      Description copied from interface: IndexSchemaManager
      Drops the schema and all indexed data if it exists, then creates the schema.
      Specified by:
      dropAndCreate in interface IndexSchemaManager
      Parameters:
      operationSubmitter - How to handle request to submit operation when the queue is full.
      Returns:
      A future.
    • validate

      public CompletableFuture<?> validate(ContextualFailureCollector failureCollector, OperationSubmitter operationSubmitter)
      Description copied from interface: IndexSchemaManager
      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.

      Specified by:
      validate in interface IndexSchemaManager
      Parameters:
      failureCollector - A collector for validation failures.
      operationSubmitter - How to handle request to submit operation when the queue is full.
      Returns:
      A future.
    • exportExpectedSchema

      public void exportExpectedSchema(IndexSchemaCollector collector)
      Description copied from interface: IndexSchemaManager
      Accepts a collector that will receive the schema export represented by this index schema manager.
      Specified by:
      exportExpectedSchema in interface IndexSchemaManager
    • computeSizeInBytes

      public CompletableFuture<Long> computeSizeInBytes(OperationSubmitter operationSubmitter)