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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidcommit(SnContext context, java.lang.String indexId)Makes sure that documents are stored on the index storage and are visible for queries.voidcreateIndex(SnContext context, java.lang.String indexId)Creates an index (if it does not exist).SnIndexerOperationcreateIndexerOperation(SnContext context, SnIndexerOperationType indexerOperationType, int totalItems)Creates a new indexer operation.voiddeleteIndex(SnContext context, java.lang.String indexId)Deletes an index (if it exists).SnDocumentBatchResponseexecuteDocumentBatch(SnContext context, java.lang.String indexId, SnDocumentBatchRequest documentBatchRequest, java.lang.String indexerOperationId)Executes a document batch.voidexportConfiguration(SnContext context)Exports the configuration to the search provider.TgetSearchProviderConfiguration(SnContext context)Returns the search provider configuration.SnSearchResultsearch(SnContext context, java.lang.String indexId, SnSearchQuery searchQuery)Executes a search query on a specific index.SnSuggestResultsuggest(SnContext context, java.lang.String indexId, SnSuggestQuery suggestQuery)Executes a suggest query on a specific index.SnIndexerOperationupdateIndexerOperationStatus(SnContext context, java.lang.String indexerOperationId, SnIndexerOperationStatus status, java.lang.String errorMessage)Updates the status of an indexer operation.
-
-
-
Method Detail
-
getSearchProviderConfiguration
T getSearchProviderConfiguration(SnContext context)
Returns the search provider configuration.- Returns:
- the search provider configuration
- Throws:
SnException- if an error occurs
-
exportConfiguration
void exportConfiguration(SnContext context) throws SnException
Exports the configuration to the search provider.- Parameters:
context- - the context- Throws:
SnException- if an error occurs
-
createIndex
void createIndex(SnContext context, java.lang.String indexId) throws SnException
Creates an index (if it does not exist).- Parameters:
context- - the contextindexId- - the index id- Throws:
SnException- if an error occurs
-
deleteIndex
void deleteIndex(SnContext context, java.lang.String indexId) throws SnException
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
SnIndexerOperation updateIndexerOperationStatus(SnContext context, java.lang.String indexerOperationId, SnIndexerOperationStatus status, java.lang.String errorMessage) throws SnException
Updates the status of an indexer operation.- Parameters:
context- - the contextstatus- - the statuserrorMessage- - the errorMessage- Throws:
SnException- if an error occurs
-
executeDocumentBatch
SnDocumentBatchResponse executeDocumentBatch(SnContext context, java.lang.String indexId, SnDocumentBatchRequest documentBatchRequest, java.lang.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
void commit(SnContext context, java.lang.String indexId) throws SnException
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, java.lang.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, java.lang.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
-
-