Interface SnSearchProvider<T extends AbstractSnSearchProviderConfiguration>
- All Known Implementing Classes:
AbstractSnSearchProvider,CSSearchSnSearchProvider
public interface SnSearchProvider<T extends AbstractSnSearchProviderConfiguration>
Abstraction for different search provider implementations.
-
Method Summary
Modifier and TypeMethodDescriptionvoidabortIndexerOperation(SnContext context, String indexerOperationId, String message) Marks an indexer operation as aborted.voidMakes sure that documents are stored on the index storage and are visible for queries.voidcompleteIndexerOperation(SnContext context, String indexerOperationId) Marks an indexer operation as completed.createIndex(SnContext context) Creates an index.createIndexerOperation(SnContext context, SnIndexerOperationType indexerOperationType, int totalItems) Creates a new indexer operation.voiddeleteIndex(SnContext context, String indexId) Deletes an index (if it exists).executeDocumentBatch(SnContext context, String indexId, SnDocumentBatchRequest documentBatchRequest, String indexerOperationId) Executes a document batch.voidexportConfiguration(SnExportConfiguration exportConfiguration, List<Locale> locales) Exports the configuration to the search provider.voidfailIndexerOperation(SnContext context, String indexerOperationId, String message) Marks an indexer operation as failed.getSearchProviderConfiguration(SnIndexConfiguration indexConfiguration) Returns the search provider configuration.search(SnContext context, String indexId, SnSearchQuery searchQuery) Executes a search query on a specific index.suggest(SnContext context, String indexId, SnSuggestQuery suggestQuery) Executes a suggest query on a specific index.updateIndexerOperationStatus(SnContext context, String indexerOperationId, SnIndexerOperationStatus status, String errorMessage) Deprecated, for removal: This API element is subject to removal in a future version.
-
Method Details
-
getSearchProviderConfiguration
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
Creates an index.- Parameters:
context- - the context- Throws:
SnException- if an error occurs
-
deleteIndex
Deletes an index (if it exists).- Parameters:
context- - the contextindexId- - 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
@Deprecated(since="2211", forRemoval=true) SnIndexerOperation updateIndexerOperationStatus(SnContext context, String indexerOperationId, SnIndexerOperationStatus status, String errorMessage) throws SnException Deprecated, for removal: This API element is subject to removal in a future version.Updates the status of an indexer operation.- Parameters:
context- - the contextstatus- - the statuserrorMessage- - the errorMessage- Throws:
SnException- if an error occurs
-
completeIndexerOperation
Marks an indexer operation as completed.- Parameters:
context- - the contextindexerOperationId- - the indexer operation id- Throws:
SnException- if an error occurs
-
abortIndexerOperation
void abortIndexerOperation(SnContext context, String indexerOperationId, String message) throws SnException Marks an indexer operation as aborted.- Parameters:
context- - the contextindexerOperationId- - the indexer operation idmessage- - the message- Throws:
SnException- if an error occurs
-
failIndexerOperation
void failIndexerOperation(SnContext context, String indexerOperationId, String message) throws SnException Marks an indexer operation as failed.- Parameters:
context- - the contextindexerOperationId- - the indexer operation idmessage- - the message- 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 contextindexId- - the index iddocumentBatchRequest- - the document batch requestindexerOperationId- - the indexer operation id- Returns:
- the document batch response
- Throws:
SnException- if an error occurs
-
commit
Makes sure that documents are stored on the index storage and are visible for queries.- Parameters:
context- - the contextindexId- - 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 contextindexId- - the index idsearchQuery- - 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 contextindexId- - the index idsuggestQuery- - the suggest query- Returns:
- the suggest result
- Throws:
SnException- if an error occurs
-
completeIndexerOperation(SnContext, String),abortIndexerOperation(SnContext, String, String)andfailIndexerOperation(SnContext, String, String).