Interface SnSearchProvider<T extends AbstractSnSearchProviderConfiguration>

    • 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 context
        indexId - - 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 context
        indexId - - the index id
        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 context
        status - - the status
        errorMessage - - 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 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,
                    java.lang.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,
                              java.lang.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,
                                java.lang.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