All Known Implementing Classes:
AbstractSnSearchProvider, CSSearchSnSearchProvider

public interface SnSearchProvider<T extends AbstractSnSearchProviderConfiguration>
Abstraction for different search provider implementations.
  • Method Details

    • getSearchProviderConfiguration

      T getSearchProviderConfiguration(SnIndexConfiguration indexConfiguration) throws SnException
      Returns the search provider configuration.
      Parameters:
      indexConfiguration - - the index configuration
      Returns:
      the search provider configuration
      Throws:
      SnException - if an error occurs
    • exportConfiguration

      void exportConfiguration(SnExportConfiguration exportConfiguration, List<Locale> locales) throws SnException
      Exports the configuration to the search provider.
      Parameters:
      exportConfiguration - - the export configuration
      Throws:
      SnException - if an error occurs
    • createIndex

      SnIndex createIndex(SnContext context) throws SnException
      Creates an index.
      Parameters:
      context - - the context
      Throws:
      SnException - if an error occurs
    • deleteIndex

      void deleteIndex(SnContext context, String indexId) throws SnException
      Deletes an index (if it exists).
      Parameters:
      context - - the context
      indexId - - the index id
      Throws:
      SnException - if an error occurs
    • createIndexerOperation

      SnIndexerOperation createIndexerOperation(SnContext context, SnIndexerOperationType indexerOperationType, int totalItems) throws SnException
      Creates a new indexer operation.
      Parameters:
      context - - the context
      Throws:
      SnException - if an error occurs
    • updateIndexerOperationStatus

      SnIndexerOperation updateIndexerOperationStatus(SnContext context, String indexerOperationId, SnIndexerOperationStatus status, String errorMessage) throws SnException
      Updates the status of an indexer operation.
      Parameters:
      context - - the context
      status - - the status
      errorMessage - - the errorMessage
      Throws:
      SnException - if an error occurs
    • executeDocumentBatch

      SnDocumentBatchResponse executeDocumentBatch(SnContext context, String indexId, SnDocumentBatchRequest documentBatchRequest, String indexerOperationId) throws SnException
      Executes a document batch.
      Parameters:
      context - - the context
      indexId - - the index id
      documentBatchRequest - - the document batch request
      indexerOperationId - - the indexer operation id
      Returns:
      the document batch response
      Throws:
      SnException - if an error occurs
    • commit

      void commit(SnContext context, String indexId) throws SnException
      Makes sure that documents are stored on the index storage and are visible for queries.
      Parameters:
      context - - the context
      indexId - - the index id
      Throws:
      SnException - if an error occurs
    • search

      SnSearchResult search(SnContext context, String indexId, SnSearchQuery searchQuery) throws SnException
      Executes a search query on a specific index.
      Parameters:
      context - - the context
      indexId - - the index id
      searchQuery - - the search query
      Returns:
      the search result
      Throws:
      SnException - if an error occurs
    • suggest

      SnSuggestResult suggest(SnContext context, String indexId, SnSuggestQuery suggestQuery) throws SnException
      Executes a suggest query on a specific index.
      Parameters:
      context - - the context
      indexId - - the index id
      suggestQuery - - the suggest query
      Returns:
      the suggest result
      Throws:
      SnException - if an error occurs