Class SearchClient

    • Method Detail

      • initIndex

        public SearchIndex<?> initIndex​(@Nonnull
                                        String indexName)
        Get the index object initialized (no server call needed for initialization)
        Parameters:
        indexName - The name of the Algolia index
        Throws:
        IllegalArgumentException - When indexName is null or empty
      • initIndex

        public <T> SearchIndex<T> initIndex​(@Nonnull
                                            String indexName,
                                            @Nonnull
                                            Class<T> clazz)
        Get the index object initialized (no server call needed for initialization)
        Type Parameters:
        T - the type of the objects in this index
        Parameters:
        indexName - The name of the Algolia index
        clazz - class of the object in this index
        Throws:
        IllegalArgumentException - When indexName is null or empty
      • waitTask

        public void waitTask​(@Nonnull
                             String indexName,
                             long taskID)
        Wait for a task to complete before executing the next line of code, to synchronize index updates. All write operations in Algolia are asynchronous by design.
        Specified by:
        waitTask in interface SearchClientBase
        Parameters:
        indexName - The indexName to wait on
        taskID - The Algolia taskID
        Throws:
        AlgoliaRetryException - When the retry has failed on all hosts
        AlgoliaApiException - When the API sends an http error code
        AlgoliaRuntimeException - When an error occurred during the serialization
      • waitTask

        public void waitTask​(@Nonnull
                             String indexName,
                             long taskID,
                             long timeToWait)
        Wait for a task to complete before executing the next line of code, to synchronize index updates. All write operations in Algolia are asynchronous by design.
        Parameters:
        indexName - The indexName to wait on
        taskID - The Algolia taskID
        timeToWait - The time to wait between each call
        Throws:
        AlgoliaRetryException - When the retry has failed on all hosts
        AlgoliaApiException - When the API sends an http error code
        AlgoliaRuntimeException - When an error occurred during the serialization
      • waitTask

        public void waitTask​(@Nonnull
                             String indexName,
                             long taskID,
                             RequestOptions requestOptions)
        Wait for a task to complete before executing the next line of code, to synchronize index updates. All write operations in Algolia are asynchronous by design.
        Parameters:
        indexName - The indexName to wait on
        taskID - The Algolia taskID
        requestOptions - Options to pass to this request
        Throws:
        AlgoliaRetryException - When the retry has failed on all hosts
        AlgoliaApiException - When the API sends an http error code
        AlgoliaRuntimeException - When an error occurred during the serialization
      • waitTask

        public void waitTask​(@Nonnull
                             String indexName,
                             long taskID,
                             long timeToWait,
                             RequestOptions requestOptions)
        Wait for a task to complete before executing the next line of code, to synchronize index updates. All write operations in Algolia are asynchronous by design.
        Specified by:
        waitTask in interface SearchClientBase
        Parameters:
        indexName - The indexName to wait on
        taskID - The Algolia taskID
        timeToWait - The time to wait between each call
        requestOptions - Options to pass to this request
        Throws:
        AlgoliaRetryException - When the retry has failed on all hosts
        AlgoliaApiException - When the API sends an http error code
        AlgoliaRuntimeException - When an error occurred during the serialization
      • waitAppTask

        public void waitAppTask​(long taskID)
        Wait for a dictionary task to complete before executing the next line of code. All write operations in Algolia are asynchronous by design.
        Specified by:
        waitAppTask in interface SearchClientBase
        Parameters:
        taskID - The Algolia taskID
        Throws:
        AlgoliaRetryException - When the retry has failed on all hosts
        AlgoliaApiException - When the API sends an http error code
        AlgoliaRuntimeException - When an error occurred during the serialization
      • waitAppTask

        public void waitAppTask​(long taskID,
                                RequestOptions requestOptions)
        Wait for a dictionary task to complete before executing the next line of code. All write operations in Algolia are asynchronous by design.
        Parameters:
        taskID - The Algolia taskID
        requestOptions - Options to pass to this request
        Throws:
        AlgoliaRetryException - When the retry has failed on all hosts
        AlgoliaApiException - When the API sends an http error code
        AlgoliaRuntimeException - When an error occurred during the serialization
      • waitAppTask

        public void waitAppTask​(long taskID,
                                long timeToWait,
                                RequestOptions requestOptions)
        Wait for a dictionary task to complete before executing the next line of code. All write operations in Algolia are asynchronous by design.
        Specified by:
        waitAppTask in interface SearchClientBase
        Parameters:
        taskID - The Algolia taskID
        timeToWait - The time to wait between each call
        requestOptions - Options to pass to this request
        Throws:
        AlgoliaRetryException - When the retry has failed on all hosts
        AlgoliaApiException - When the API sends an http error code
        AlgoliaRuntimeException - When an error occurred during the serialization