Class SearchIndex<T>

    • Method Detail

      • getObject

        public T getObject​(@Nonnull
                           String objectID)
        Retrieve one or more objects, potentially from the index, in a single API call.
        Parameters:
        objectID - ID of the object within that index
        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
      • getObject

        public T getObject​(@Nonnull
                           String objectID,
                           @Nonnull
                           List<String> attributesToRetrieve,
                           RequestOptions requestOptions)
        Retrieve one or more objects, potentially from the index, in a single API call.
        Parameters:
        objectID - ID of the object within that index
        attributesToRetrieve - List of attributes to retrieve. By default, all retrievable attributes are returned.
        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
      • getObject

        public T getObject​(@Nonnull
                           String objectID,
                           RequestOptions requestOptions)
        Retrieve one or more objects, potentially from the index, in a single API call.
        Parameters:
        objectID - ID of the object within that index
        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
      • getObjectAsync

        public CompletableFuture<T> getObjectAsync​(@Nonnull
                                                   String objectID)
        Retrieve one or more objects, potentially from the index, in a single API call.
        Parameters:
        objectID - ID of the object within that index
        Throws:
        AlgoliaRetryException - When the retry has failed on all hosts
        AlgoliaApiException - When the API sends an http error code
        AlgoliaRuntimeException - When the class doesn't have an objectID field or a Jacksonannotation @JsonProperty(\"objectID\"")
      • getObjectAsync

        public CompletableFuture<T> getObjectAsync​(@Nonnull
                                                   String objectID,
                                                   @Nonnull
                                                   List<String> attributesToRetrieve,
                                                   RequestOptions requestOptions)
        Retrieve one or more objects, potentially from the index, in a single API call.
        Parameters:
        objectID - ID of the object within that index
        attributesToRetrieve - List of attributes to retrieve. By default, all retrievable attributes are returned.
        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
      • getObjects

        public List<T> getObjects​(@Nonnull
                                  List<String> objectIDs,
                                  List<String> attributesToRetrieve)
        Retrieve one or more objects, potentially from the index, in a single API call.
        Parameters:
        objectIDs - ID of the object within that index
        attributesToRetrieve - List of attributes to retrieve. By default, all retrievable attributes are returned.
        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
      • getObjects

        public List<T> getObjects​(@Nonnull
                                  List<String> objectIDs,
                                  RequestOptions requestOptions)
        Retrieve one or more objects, potentially from the index, in a single API call.
        Parameters:
        objectIDs - ID of the object within that index
        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
      • getObjects

        public List<T> getObjects​(@Nonnull
                                  List<String> objectIDs,
                                  List<String> attributesToRetrieve,
                                  RequestOptions requestOptions)
        Retrieve one or more objects, potentially from the index, in a single API call.
        Parameters:
        objectIDs - ID of the object within that index
        attributesToRetrieve - List of attributes to retrieve. By default, all retrievable attributes are returned.
        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
      • getObjectsAsync

        public CompletableFuture<List<T>> getObjectsAsync​(@Nonnull
                                                          List<String> objectIDs,
                                                          List<String> attributesToRetrieve)
        Retrieve one or more objects, potentially from the index, in a single API call.
        Parameters:
        objectIDs - ID of the object within that index
        attributesToRetrieve - List of attributes to retrieve. By default, all retrievable attributes are returned.
        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
      • getObjectsAsync

        public CompletableFuture<List<T>> getObjectsAsync​(@Nonnull
                                                          List<String> objectIDs,
                                                          List<String> attributesToRetrieve,
                                                          RequestOptions requestOptions)
        Retrieve one or more objects, potentially from the index, in a single API call.
        Parameters:
        objectIDs - ID of the object within that index
        attributesToRetrieve - List of attributes to retrieve. By default, all retrievable attributes are returned.
        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
      • partialUpdateObject

        public UpdateObjectResponse partialUpdateObject​(@Nonnull
                                                        T data)
        Update one or more attributes of an existing object. This method enables you to update only a part of an object by singling out one or more attributes of an existing object and performing the following actions:
        Parameters:
        data - Data to update
        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
      • partialUpdateObject

        public UpdateObjectResponse partialUpdateObject​(@Nonnull
                                                        T data,
                                                        RequestOptions requestOptions)
        Update one or more attributes of an existing object. This method enables you to update only a part of an object by singling out one or more attributes of an existing object and performing the following actions:
        Parameters:
        data - Data to update
        requestOptions - Options to pass to this request
        Throws:
        AlgoliaRuntimeException - When the class doesn't have an objectID field or a Jackson annotation @JsonProperty(\"objectID\"")
        AlgoliaRetryException - When the retry has failed on all hosts
        AlgoliaApiException - When the API sends an http error code
      • partialUpdateObject

        public UpdateObjectResponse partialUpdateObject​(@Nonnull
                                                        T data,
                                                        @Nonnull
                                                        Boolean createIfNotExists)
        Update one or more attributes of an existing object. This method enables you to update only a part of an object by singling out one or more attributes of an existing object and performing the following actions:
        Parameters:
        data - Data to update
        createIfNotExists - When true, a partial update on a nonexistent object will create the object (generating the objectID and using the attributes as defined in the object). WHen false, a partial update on a nonexistent object will be ignored (but no error will be sent back).
        Throws:
        AlgoliaRuntimeException - When the class doesn't have an objectID field or a Jackson annotation @JsonProperty(\"objectID\"")
        AlgoliaRetryException - When the retry has failed on all hosts
        AlgoliaApiException - When the API sends an http error code
      • partialUpdateObject

        public UpdateObjectResponse partialUpdateObject​(@Nonnull
                                                        T data,
                                                        @Nonnull
                                                        Boolean createIfNotExists,
                                                        RequestOptions requestOptions)
        Update one or more attributes of an existing object. This method enables you to update only a part of an object by singling out one or more attributes of an existing object and performing the following actions:
        Parameters:
        data - Data to update
        createIfNotExists - When true, a partial update on a nonexistent object will create the object (generating the objectID and using the attributes as defined in the object). WHen false, a partial update on a nonexistent object will be ignored (but no error will be sent back).
        requestOptions - Options to pass to this request
        Throws:
        AlgoliaRuntimeException - When the class doesn't have an objectID field or a Jackson annotation @JsonProperty(\"objectID\"")
        AlgoliaRetryException - When the retry has failed on all hosts
        AlgoliaApiException - When the API sends an http error code
      • partialUpdateObjectAsync

        public CompletableFuture<UpdateObjectResponse> partialUpdateObjectAsync​(@Nonnull
                                                                                T data)
        Update one or more attributes of an existing object. This method enables you to update only a part of an object by singling out one or more attributes of an existing object and performing the following actions:
        Parameters:
        data - Data to update
        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
      • partialUpdateObjectAsync

        public CompletableFuture<UpdateObjectResponse> partialUpdateObjectAsync​(@Nonnull
                                                                                T data,
                                                                                RequestOptions requestOptions)
        Update one or more attributes of an existing object. This method enables you to update only a part of an object by singling out one or more attributes of an existing object and performing the following actions:
        Parameters:
        data - Data to update
        requestOptions - Options to pass to this request
        Throws:
        AlgoliaRuntimeException - When the class doesn't have an objectID field or a Jackson annotation @JsonProperty(\"objectID\"")
        AlgoliaRetryException - When the retry has failed on all hosts
        AlgoliaApiException - When the API sends an http error code
      • partialUpdateObjectAsync

        public CompletableFuture<UpdateObjectResponse> partialUpdateObjectAsync​(@Nonnull
                                                                                T data,
                                                                                @Nonnull
                                                                                Boolean createIfNotExists)
        Update one or more attributes of an existing object. This method enables you to update only a part of an object by singling out one or more attributes of an existing object and performing the following actions:
        Parameters:
        data - Data to update
        createIfNotExists - When true, a partial update on a nonexistent object will create the object (generating the objectID and using the attributes as defined in the object). WHen false, a partial update on a nonexistent object will be ignored (but no error will be sent back).
        Throws:
        AlgoliaRuntimeException - When the class doesn't have an objectID field or a Jackson annotation @JsonProperty(\"objectID\"")
        AlgoliaRetryException - When the retry has failed on all hosts
        AlgoliaApiException - When the API sends an http error code
      • partialUpdateObjectAsync

        public CompletableFuture<UpdateObjectResponse> partialUpdateObjectAsync​(@Nonnull
                                                                                T data,
                                                                                @Nonnull
                                                                                Boolean createIfNotExists,
                                                                                RequestOptions requestOptions)
        Update one or more attributes of an existing object. This method enables you to update only a part of an object by singling out one or more attributes of an existing object and performing the following actions:
        Parameters:
        data - Data to update
        createIfNotExists - When true, a partial update on a nonexistent object will create the object (generating the objectID and using the attributes as defined in the object). WHen false, a partial update on a nonexistent object will be ignored (but no error will be sent back).
        requestOptions - Options to pass to this request
        Throws:
        AlgoliaRuntimeException - When the class doesn't have an objectID field or a Jackson annotation @JsonProperty(\"objectID\"")
        AlgoliaRetryException - When the retry has failed on all hosts
        AlgoliaApiException - When the API sends an http error code
      • partialUpdateObjects

        public BatchIndexingResponse partialUpdateObjects​(@Nonnull
                                                          Iterable<T> data)
        Update one or more attributes of an existing object. This method enables you to update only a part of an object by singling out one or more attributes of an existing object and performing the following actions:
        Parameters:
        data - The data to send to the API
        Throws:
        AlgoliaRetryException - When the retry has failed on all hosts
        AlgoliaApiException - When the API sends an http error code
        AlgoliaRuntimeException - When the class doesn't have an objectID field or a Jacksonannotation @JsonProperty(\"objectID\"")
      • partialUpdateObjects

        public BatchIndexingResponse partialUpdateObjects​(@Nonnull
                                                          Iterable<T> data,
                                                          RequestOptions requestOptions)
        Update one or more attributes of an existing object. This method enables you to update only a part of an object by singling out one or more attributes of an existing object and performing the following actions:
        Parameters:
        data - The data to send to the API
        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 the class doesn't have an objectID field or a Jacksonannotation @JsonProperty(\"objectID\"")
      • partialUpdateObjects

        public BatchIndexingResponse partialUpdateObjects​(@Nonnull
                                                          Iterable<T> data,
                                                          boolean createIfNotExists)
        Update one or more attributes of an existing object. This method enables you to update only a part of an object by singling out one or more attributes of an existing object and performing the following actions:
        Parameters:
        data - The data to send to the API
        createIfNotExists - When true, a partial update on a nonexistent object will create the object (generating the objectID and using the attributes as defined in the object). WHen false, a partial update on a nonexistent object will be ignored (but no error will be sent back).
        Throws:
        AlgoliaRetryException - When the retry has failed on all hosts
        AlgoliaApiException - When the API sends an http error code
        AlgoliaRuntimeException - When the class doesn't have an objectID field or a Jacksonannotation @JsonProperty(\"objectID\"")
      • partialUpdateObjects

        public BatchIndexingResponse partialUpdateObjects​(@Nonnull
                                                          Iterable<T> data,
                                                          boolean createIfNotExists,
                                                          RequestOptions requestOptions)
        Update one or more attributes of an existing object. This method enables you to update only a part of an object by singling out one or more attributes of an existing object and performing the following actions:
        Parameters:
        data - The data to send to the API
        createIfNotExists - When true, a partial update on a nonexistent object will create the object (generating the objectID and using the attributes as defined in the object). WHen false, a partial update on a nonexistent object will be ignored (but no error will be sent back).
        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 the class doesn't have an objectID field or a Jacksonannotation @JsonProperty(\"objectID\"")
      • partialUpdateObjectsAsync

        public CompletableFuture<BatchIndexingResponse> partialUpdateObjectsAsync​(@Nonnull
                                                                                  Iterable<T> data)
        Update one or more attributes of an existing object. This method enables you to update only a part of an object by singling out one or more attributes of an existing object and performing the following actions:
        Parameters:
        data - The data to send to the API
        Throws:
        AlgoliaRetryException - When the retry has failed on all hosts
        AlgoliaApiException - When the API sends an http error code
        AlgoliaRuntimeException - When the class doesn't have an objectID field or a Jacksonannotation @JsonProperty(\"objectID\"")
      • partialUpdateObjectsAsync

        public CompletableFuture<BatchIndexingResponse> partialUpdateObjectsAsync​(@Nonnull
                                                                                  Iterable<T> data,
                                                                                  RequestOptions requestOptions)
        Update one or more attributes of an existing object. This method enables you to update only a part of an object by singling out one or more attributes of an existing object and performing the following actions:
        Parameters:
        data - The data to send to the API
        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 the class doesn't have an objectID field or a Jacksonannotation @JsonProperty(\"objectID\"")
      • partialUpdateObjectsAsync

        public CompletableFuture<BatchIndexingResponse> partialUpdateObjectsAsync​(@Nonnull
                                                                                  Iterable<T> data,
                                                                                  boolean createIfNotExists)
        Update one or more attributes of an existing object. This method enables you to update only a part of an object by singling out one or more attributes of an existing object and performing the following actions:
        Parameters:
        data - The data to send to the API
        createIfNotExists - When true, a partial update on a nonexistent object will create the object (generating the objectID and using the attributes as defined in the object). WHen false, a partial update on a nonexistent object will be ignored (but no error will be sent back).
        Throws:
        AlgoliaRetryException - When the retry has failed on all hosts
        AlgoliaApiException - When the API sends an http error code
        AlgoliaRuntimeException - When the class doesn't have an objectID field or a Jacksonannotation @JsonProperty(\"objectID\"")
      • partialUpdateObjectsAsync

        public CompletableFuture<BatchIndexingResponse> partialUpdateObjectsAsync​(@Nonnull
                                                                                  Iterable<T> data,
                                                                                  boolean createIfNotExists,
                                                                                  RequestOptions requestOptions)
        Update one or more attributes of an existing object. This method enables you to update only a part of an object by singling out one or more attributes of an existing object and performing the following actions:
        Parameters:
        data - The data to send to the API
        createIfNotExists - When true, a partial update on a nonexistent object will create the object (generating the objectID and using the attributes as defined in the object). WHen false, a partial update on a nonexistent object will be ignored (but no error will be sent back).
        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 the class doesn't have an objectID field or a Jacksonannotation @JsonProperty(\"objectID\"")
      • saveObject

        public BatchIndexingResponse saveObject​(@Nonnull
                                                T data)
        This method allows you to create records on your index by sending one or more objects Each object contains a set of attributes and values, which represents a full record on an index.
        Parameters:
        data - The data to send
        Throws:
        AlgoliaRetryException - When the retry has failed on all hosts
        AlgoliaApiException - When the API sends an http error code
        AlgoliaRuntimeException - When the class doesn't have an objectID field or a Jacksonannotation @JsonProperty(\"objectID\"")
      • saveObject

        public BatchIndexingResponse saveObject​(@Nonnull
                                                T data,
                                                boolean autoGenerateObjectID)
        This method allows you to create records on your index by sending one or more objects Each object contains a set of attributes and values, which represents a full record on an index.
        Parameters:
        data - The data to send
        autoGenerateObjectID - If set to true, the method will perform "ADD_OBJECT", otherwise will perform an "UpdateObject"
        Throws:
        AlgoliaRetryException - When the retry has failed on all hosts
        AlgoliaApiException - When the API sends an http error code
        AlgoliaRuntimeException - When the class doesn't have an objectID field or a Jacksonannotation @JsonProperty(\"objectID\"") and autoGenerateObjectID = false
      • saveObject

        public BatchIndexingResponse saveObject​(@Nonnull
                                                T data,
                                                RequestOptions requestOptions)
        This method allows you to create records on your index by sending one or more objects Each object contains a set of attributes and values, which represents a full record on an index.
        Parameters:
        data - The data to send
        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 the class doesn't have an objectID field or a Jacksonannotation @JsonProperty(\"objectID\"")
      • saveObject

        public BatchIndexingResponse saveObject​(@Nonnull
                                                T data,
                                                boolean autoGenerateObjectID,
                                                RequestOptions requestOptions)
        This method allows you to create records on your index by sending one or more objects Each object contains a set of attributes and values, which represents a full record on an index.
        Parameters:
        data - The data to send
        autoGenerateObjectID - If set to true, the method will perform "ADD_OBJECT", otherwise will perform an "UpdateObject"
        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 the class doesn't have an objectID field or a Jacksonannotation @JsonProperty(\"objectID\"") and autoGenerateObjectID = false
      • saveObjectAsync

        public CompletableFuture<BatchIndexingResponse> saveObjectAsync​(@Nonnull
                                                                        T data)
        This method allows you to create records on your index by sending one or more objects Each object contains a set of attributes and values, which represents a full record on an index.
        Parameters:
        data - The data to send
        Throws:
        AlgoliaRetryException - When the retry has failed on all hosts
        AlgoliaApiException - When the API sends an http error code
        AlgoliaRuntimeException - When the class doesn't have an objectID field or a Jacksonannotation @JsonProperty(\"objectID\"")
      • saveObjectAsync

        public CompletableFuture<BatchIndexingResponse> saveObjectAsync​(@Nonnull
                                                                        T data,
                                                                        boolean autoGenerateObjectID)
        This method allows you to create records on your index by sending one or more objects Each object contains a set of attributes and values, which represents a full record on an index.
        Parameters:
        data - The data to send
        autoGenerateObjectID - If set to true, the method will perform "ADD_OBJECT", otherwise will perform an "UpdateObject"
        Throws:
        AlgoliaRetryException - When the retry has failed on all hosts
        AlgoliaApiException - When the API sends an http error code
        AlgoliaRuntimeException - When the class doesn't have an objectID field or a Jacksonannotation @JsonProperty(\"objectID\"") and autoGenerateObjectID = false
      • saveObjectAsync

        public CompletableFuture<BatchIndexingResponse> saveObjectAsync​(@Nonnull
                                                                        T data,
                                                                        RequestOptions requestOptions)
        This method allows you to create records on your index by sending one or more objects Each object contains a set of attributes and values, which represents a full record on an index.
        Parameters:
        data - The data to send
        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 the class doesn't have an objectID field or a Jacksonannotation @JsonProperty(\"objectID\"")
      • saveObjectAsync

        public CompletableFuture<BatchIndexingResponse> saveObjectAsync​(@Nonnull
                                                                        T data,
                                                                        boolean autoGenerateObjectID,
                                                                        RequestOptions requestOptions)
        This method allows you to create records on your index by sending one or more objects Each object contains a set of attributes and values, which represents a full record on an index.
        Parameters:
        data - The data to send
        autoGenerateObjectID - If set to true, the method will perform "ADD_OBJECT", otherwise will perform an "UpdateObject"
        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 the class doesn't have an objectID field or a Jacksonannotation @JsonProperty(\"objectID\"") and autoGenerateObjectID = false
      • saveObjects

        public BatchIndexingResponse saveObjects​(@Nonnull
                                                 Iterable<T> data)
        This method allows you to create records on your index by sending one or more objects Each object contains a set of attributes and values, which represents a full record on an index.
        Parameters:
        data - The data to send
        Throws:
        AlgoliaRetryException - When the retry has failed on all hosts
        AlgoliaApiException - When the API sends an http error code
        AlgoliaRuntimeException - When the class doesn't have an objectID field or a Jacksonannotation @JsonProperty(\"objectID\"")
      • saveObjects

        public BatchIndexingResponse saveObjects​(@Nonnull
                                                 Iterable<T> data,
                                                 boolean autoGenerateObjectID)
        This method allows you to create records on your index by sending one or more objects Each object contains a set of attributes and values, which represents a full record on an index.
        Parameters:
        data - The data to send
        autoGenerateObjectID - If set to true, the method will perform "ADD_OBJECT", otherwise will perform an "UpdateObject"
        Throws:
        AlgoliaRetryException - When the retry has failed on all hosts
        AlgoliaApiException - When the API sends an http error code
        AlgoliaRuntimeException - When the class doesn't have an objectID field or a Jacksonannotation @JsonProperty(\"objectID\"") and autoGenerateObjectID = false
      • saveObjects

        public BatchIndexingResponse saveObjects​(@Nonnull
                                                 Iterable<T> data,
                                                 RequestOptions requestOptions)
        This method allows you to create records on your index by sending one or more objects Each object contains a set of attributes and values, which represents a full record on an index.
        Parameters:
        data - The data to send
        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 the class doesn't have an objectID field or a Jacksonannotation @JsonProperty(\"objectID\"")
      • saveObjects

        public BatchIndexingResponse saveObjects​(@Nonnull
                                                 Iterable<T> data,
                                                 boolean autoGenerateObjectID,
                                                 RequestOptions requestOptions)
        This method allows you to create records on your index by sending one or more objects Each object contains a set of attributes and values, which represents a full record on an index.
        Parameters:
        data - The data to send
        autoGenerateObjectID - If set to true, the method will perform "ADD_OBJECT", otherwise will perform an "UpdateObject"
        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 the class doesn't have an objectID field or a Jacksonannotation @JsonProperty(\"objectID\"") and autoGenerateObjectID = false
      • saveObjectsAsync

        public CompletableFuture<BatchIndexingResponse> saveObjectsAsync​(@Nonnull
                                                                         Iterable<T> data)
        This method allows you to create records on your index by sending one or more objects Each object contains a set of attributes and values, which represents a full record on an index.
        Parameters:
        data - The data to send
        Throws:
        AlgoliaRetryException - When the retry has failed on all hosts
        AlgoliaApiException - When the API sends an http error code
        AlgoliaRuntimeException - When the class doesn't have an objectID field or a Jacksonannotation @JsonProperty(\"objectID\"")
      • saveObjectsAsync

        public CompletableFuture<BatchIndexingResponse> saveObjectsAsync​(@Nonnull
                                                                         Iterable<T> data,
                                                                         boolean autoGenerateObjectID)
        This method allows you to create records on your index by sending one or more objects Each object contains a set of attributes and values, which represents a full record on an index.
        Parameters:
        data - The data to send
        autoGenerateObjectID - If set to true, the method will perform "ADD_OBJECT", otherwise will perform an "UpdateObject"
        Throws:
        AlgoliaRetryException - When the retry has failed on all hosts
        AlgoliaApiException - When the API sends an http error code
        AlgoliaRuntimeException - When the class doesn't have an objectID field or a Jacksonannotation @JsonProperty(\"objectID\"") and autoGenerateObjectID = false
      • saveObjectsAsync

        public CompletableFuture<BatchIndexingResponse> saveObjectsAsync​(@Nonnull
                                                                         Iterable<T> data,
                                                                         RequestOptions requestOptions)
        This method allows you to create records on your index by sending one or more objects Each object contains a set of attributes and values, which represents a full record on an index.
        Parameters:
        data - The data to send
        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 the class doesn't have an objectID field or a Jacksonannotation @JsonProperty(\"objectID\"")
      • saveObjectsAsync

        public CompletableFuture<BatchIndexingResponse> saveObjectsAsync​(@Nonnull
                                                                         Iterable<T> data,
                                                                         boolean autoGenerateObjectID,
                                                                         RequestOptions requestOptions)
        This method allows you to create records on your index by sending one or more objects Each object contains a set of attributes and values, which represents a full record on an index.
        Parameters:
        data - The data to send
        autoGenerateObjectID - If set to true, the method will perform "ADD_OBJECT", otherwise will perform an "UpdateObject"
        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 the class doesn't have an objectID field or a Jacksonannotation @JsonProperty(\"objectID\"") and autoGenerateObjectID = false
      • clearObjects

        public DeleteResponse clearObjects()
        Clear the records of an index without affecting its settings. This method enables you to delete an index’s contents (records) without removing any settings, rules and synonyms.
        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
      • clearObjects

        public DeleteResponse clearObjects​(RequestOptions requestOptions)
        Clear the records of an index without affecting its settings. This method enables you to delete an index’s contents (records) without removing any settings, rules and synonyms.
        Parameters:
        requestOptions - Options to pass to this request
      • clearObjectsAsync

        public CompletableFuture<DeleteResponse> clearObjectsAsync​(RequestOptions requestOptions)
        Clear the records of an index without affecting its settings. This method enables you to delete an index’s contents (records) without removing any settings, rules and synonyms.
        Parameters:
        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
      • replaceAllObjects

        public MultiResponse replaceAllObjects​(Iterable<T> data)
        Push a new set of objects and remove all previous ones. Settings, synonyms and query rules are untouched. Replace all records in an index without any downtime.
        Parameters:
        data - The data to send
        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
      • replaceAllObjects

        public MultiResponse replaceAllObjects​(Iterable<T> data,
                                               boolean safe)
        Push a new set of objects and remove all previous ones. Settings, synonyms and query rules are untouched. Replace all records in an index without any downtime.
        Parameters:
        data - The data to send
        safe - Run all API calls synchronously
        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
      • replaceAllObjects

        public MultiResponse replaceAllObjects​(Iterable<T> data,
                                               RequestOptions requestOptions,
                                               boolean safe)
        Push a new set of objects and remove all previous ones. Settings, synonyms and query rules are untouched. Replace all records in an index without any downtime.
        Parameters:
        data - The data to send
        requestOptions - Options to pass to this request
        safe - Run all API calls synchronously
        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
      • replaceAllObjectsAsync

        public CompletableFuture<MultiResponse> replaceAllObjectsAsync​(Iterable<T> data)
        Push a new set of objects and remove all previous ones. Settings, synonyms and query rules are untouched. Replace all records in an index without any downtime.
        Parameters:
        data - The data to send
        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
      • replaceAllObjectsAsync

        public CompletableFuture<MultiResponse> replaceAllObjectsAsync​(Iterable<T> data,
                                                                       boolean safe)
        Push a new set of objects and remove all previous ones. Settings, synonyms and query rules are untouched. Replace all records in an index without any downtime.
        Parameters:
        data - The data to send
        safe - Run all API calls synchronously
        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
      • replaceAllObjectsAsync

        public CompletableFuture<MultiResponse> replaceAllObjectsAsync​(Iterable<T> data,
                                                                       RequestOptions requestOptions,
                                                                       boolean safe)
        Push a new set of objects and remove all previous ones. Settings, synonyms and query rules are untouched. Replace all records in an index without any downtime.
        Parameters:
        data - The data to send
        requestOptions - Options to pass to this request
        safe - Run all API calls synchronously
        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
      • browseObjects

        public IndexIterable<T> browseObjects​(@Nonnull
                                              BrowseIndexQuery query)
        This method allows you to retrieve all index content It can retrieve up to 1,000 records per call and supports full text search and filters. You can use the same query parameters as for a search query
        Parameters:
        query - The browseObjects query
        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
      • browseFrom

        public BrowseIndexResponse<T> browseFrom​(@Nonnull
                                                 BrowseIndexQuery query)
        This method allows you to retrieve all index content It can retrieve up to 1,000 records per call and supports full text search and filters. You can use the same query parameters as for a search query
        Parameters:
        query - The browseObjects query
        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
      • browseFrom

        public BrowseIndexResponse<T> browseFrom​(@Nonnull
                                                 BrowseIndexQuery query,
                                                 RequestOptions requestOptions)
        This method allows you to retrieve all index content It can retrieve up to 1,000 records per call and supports full text search and filters. You can use the same query parameters as for a search query
        Parameters:
        query - The browseObjects query
        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
      • deleteBy

        public DeleteResponse deleteBy​(@Nonnull
                                       Query query)
        Remove all objects matching a filter (including geo filters). This method enables you to delete one or more objects based on filters (numeric, facet, tag or geo queries). It does not accept empty filters or a query.
        Parameters:
        query - The query used to select objects to delete
        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
      • deleteBy

        public DeleteResponse deleteBy​(@Nonnull
                                       Query query,
                                       RequestOptions requestOptions)
        Remove all objects matching a filter (including geo filters). This method enables you to delete one or more objects based on filters (numeric, facet, tag or geo queries). It does not accept empty filters or a query.
        Parameters:
        query - The query used to select objects to delete
        requestOptions - 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
      • deleteByAsync

        public CompletableFuture<DeleteResponse> deleteByAsync​(@Nonnull
                                                               Query query)
        Remove all objects matching a filter (including geo filters). This method enables you to delete one or more objects based on filters (numeric, facet, tag or geo queries). It does not accept empty filters or a query.
        Parameters:
        query - The query used to select objects to delete
        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
      • deleteByAsync

        public CompletableFuture<DeleteResponse> deleteByAsync​(@Nonnull
                                                               Query query,
                                                               RequestOptions requestOptions)
        Remove all objects matching a filter (including geo filters). This method enables you to delete one or more objects based on filters (numeric, facet, tag or geo queries). It does not accept empty filters or a query.
        Parameters:
        query - The query used to select objects to delete
        requestOptions - 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​(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 SearchIndexBase<T>
        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
      • waitTask

        public void waitTask​(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 SearchIndexBase<T>
        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