Package com.algolia.search
Class SearchIndex<T>
- java.lang.Object
-
- com.algolia.search.SearchIndex<T>
-
- All Implemented Interfaces:
SearchIndexBase<T>,SearchIndexRules<T>,SearchIndexSearching<T>,SearchIndexSettings<T>,SearchIndexSynonyms<T>
public final class SearchIndex<T> extends Object implements SearchIndexRules<T>, SearchIndexSynonyms<T>, SearchIndexSettings<T>, SearchIndexSearching<T>
This class holds all endpoints for an Index.- See Also:
- Algolia.com
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <E> BatchResponsebatch(BatchRequest<E> request)Perform several indexing operations in one API call.<E> BatchResponsebatch(BatchRequest<E> request, RequestOptions requestOptions)Perform several indexing operations in one API call.<E> CompletableFuture<BatchResponse>batchAsync(BatchRequest<E> request)Perform several indexing operations in one API call.<E> CompletableFuture<BatchResponse>batchAsync(BatchRequest<E> request, RequestOptions requestOptions)Perform several indexing operations in one API call.BrowseIndexResponse<T>browseFrom(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.BrowseIndexResponse<T>browseFrom(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.CompletableFuture<BrowseIndexResponse<T>>browseFromAsync(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.CompletableFuture<BrowseIndexResponse<T>>browseFromAsync(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.IndexIterable<T>browseObjects(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.DeleteResponseclearObjects()Clear the records of an index without affecting its settings.DeleteResponseclearObjects(RequestOptions requestOptions)Clear the records of an index without affecting its settings.CompletableFuture<DeleteResponse>clearObjectsAsync()Clear the records of an index without affecting its settings.CompletableFuture<DeleteResponse>clearObjectsAsync(RequestOptions requestOptions)Clear the records of an index without affecting its settings.DeleteResponsedelete()Delete the index and all its settings, including links to its replicas.DeleteResponsedelete(RequestOptions requestOptions)Delete the index and all its settings, including links to its replicas.CompletableFuture<DeleteResponse>deleteAsync()Delete the index and all its settings, including links to its replicas.CompletableFuture<DeleteResponse>deleteAsync(RequestOptions requestOptions)Delete the index and all its settings, including links to its replicas.DeleteResponsedeleteBy(Query query)Remove all objects matching a filter (including geo filters).DeleteResponsedeleteBy(Query query, RequestOptions requestOptions)Remove all objects matching a filter (including geo filters).CompletableFuture<DeleteResponse>deleteByAsync(Query query)Remove all objects matching a filter (including geo filters).CompletableFuture<DeleteResponse>deleteByAsync(Query query, RequestOptions requestOptions)Remove all objects matching a filter (including geo filters).DeleteResponsedeleteObject(String objectID)Remove objects from an index using their object ids.DeleteResponsedeleteObject(String objectID, RequestOptions requestOptions)Remove objects from an index using their object ids.CompletableFuture<DeleteResponse>deleteObjectAsync(String objectID)Remove objects from an index using their object ids.CompletableFuture<DeleteResponse>deleteObjectAsync(String objectID, RequestOptions requestOptions)Remove objects from an index using their object ids.BatchIndexingResponsedeleteObjects(List<String> objectIDs)Remove objects from an index using their object ids.BatchIndexingResponsedeleteObjects(List<String> objectIDs, RequestOptions requestOptions)Remove objects from an index using their object ids.CompletableFuture<BatchIndexingResponse>deleteObjectsAsync(List<String> objectIDs)Remove objects from an index using their object ids.CompletableFuture<BatchIndexingResponse>deleteObjectsAsync(List<String> objectIDs, RequestOptions requestOptions)Remove objects from an index using their object ids.booleanexists()Return whether an index exists or notCompletableFuture<Boolean>existsAsync()Return whether an index exists or notClass<T>getClazz()SearchConfiggetConfig()TgetObject(String objectID)Retrieve one or more objects, potentially from the index, in a single API call.TgetObject(String objectID, RequestOptions requestOptions)Retrieve one or more objects, potentially from the index, in a single API call.TgetObject(String objectID, List<String> attributesToRetrieve, RequestOptions requestOptions)Retrieve one or more objects, potentially from the index, in a single API call.CompletableFuture<T>getObjectAsync(String objectID)Retrieve one or more objects, potentially from the index, in a single API call.CompletableFuture<T>getObjectAsync(String objectID, RequestOptions requestOptions)Retrieve one or more objects, potentially from the index, in a single API call.CompletableFuture<T>getObjectAsync(String objectID, List<String> attributesToRetrieve, RequestOptions requestOptions)Retrieve one or more objects, potentially from the index, in a single API call.List<T>getObjects(List<String> objectIDs)Retrieve one or more objects, potentially from the index, in a single API call.List<T>getObjects(List<String> objectIDs, RequestOptions requestOptions)Retrieve one or more objects, potentially from the index, in a single API call.List<T>getObjects(List<String> objectIDs, List<String> attributesToRetrieve)Retrieve one or more objects, potentially from the index, in a single API call.List<T>getObjects(List<String> objectIDs, List<String> attributesToRetrieve, RequestOptions requestOptions)Retrieve one or more objects, potentially from the index, in a single API call.CompletableFuture<List<T>>getObjectsAsync(List<String> objectIDs)Retrieve one or more objects, potentially from the index, in a single API call.CompletableFuture<List<T>>getObjectsAsync(List<String> objectIDs, RequestOptions requestOptions)Retrieve one or more objects, potentially from the index, in a single API call.CompletableFuture<List<T>>getObjectsAsync(List<String> objectIDs, List<String> attributesToRetrieve)Retrieve one or more objects, potentially from the index, in a single API call.CompletableFuture<List<T>>getObjectsAsync(List<String> objectIDs, List<String> attributesToRetrieve, RequestOptions requestOptions)Retrieve one or more objects, potentially from the index, in a single API call.TaskStatusResponsegetTask(long taskID)Get the status of the given taskTaskStatusResponsegetTask(long taskID, RequestOptions requestOptions)Get the status of the given taskCompletableFuture<TaskStatusResponse>getTaskAsync(long taskID)Get the status of the given taskCompletableFuture<TaskStatusResponse>getTaskAsync(long taskID, RequestOptions requestOptions)Get the status of the given taskHttpTransportgetTransport()StringgetUrlEncodedIndexName()MoveIndexResponsemoveFrom(String sourceIndex)Rename an index.MoveIndexResponsemoveFrom(String sourceIndex, RequestOptions requestOptions)Rename an index.CompletableFuture<MoveIndexResponse>moveFromAsync(String sourceIndex)Rename an index.CompletableFuture<MoveIndexResponse>moveFromAsync(String sourceIndex, RequestOptions requestOptions)Rename an index.UpdateObjectResponsepartialUpdateObject(T data)Update one or more attributes of an existing object.UpdateObjectResponsepartialUpdateObject(T data, RequestOptions requestOptions)Update one or more attributes of an existing object.UpdateObjectResponsepartialUpdateObject(T data, Boolean createIfNotExists)Update one or more attributes of an existing object.UpdateObjectResponsepartialUpdateObject(T data, Boolean createIfNotExists, RequestOptions requestOptions)Update one or more attributes of an existing object.CompletableFuture<UpdateObjectResponse>partialUpdateObjectAsync(T data)Update one or more attributes of an existing object.CompletableFuture<UpdateObjectResponse>partialUpdateObjectAsync(T data, RequestOptions requestOptions)Update one or more attributes of an existing object.CompletableFuture<UpdateObjectResponse>partialUpdateObjectAsync(T data, Boolean createIfNotExists)Update one or more attributes of an existing object.CompletableFuture<UpdateObjectResponse>partialUpdateObjectAsync(T data, Boolean createIfNotExists, RequestOptions requestOptions)Update one or more attributes of an existing object.BatchIndexingResponsepartialUpdateObjects(Iterable<T> data)Update one or more attributes of an existing object.BatchIndexingResponsepartialUpdateObjects(Iterable<T> data, boolean createIfNotExists)Update one or more attributes of an existing object.BatchIndexingResponsepartialUpdateObjects(Iterable<T> data, boolean createIfNotExists, RequestOptions requestOptions)Update one or more attributes of an existing object.BatchIndexingResponsepartialUpdateObjects(Iterable<T> data, RequestOptions requestOptions)Update one or more attributes of an existing object.CompletableFuture<BatchIndexingResponse>partialUpdateObjectsAsync(Iterable<T> data)Update one or more attributes of an existing object.CompletableFuture<BatchIndexingResponse>partialUpdateObjectsAsync(Iterable<T> data, boolean createIfNotExists)Update one or more attributes of an existing object.CompletableFuture<BatchIndexingResponse>partialUpdateObjectsAsync(Iterable<T> data, boolean createIfNotExists, RequestOptions requestOptions)Update one or more attributes of an existing object.CompletableFuture<BatchIndexingResponse>partialUpdateObjectsAsync(Iterable<T> data, RequestOptions requestOptions)Update one or more attributes of an existing object.MultiResponsereplaceAllObjects(Iterable<T> data)Push a new set of objects and remove all previous ones.MultiResponsereplaceAllObjects(Iterable<T> data, boolean safe)Push a new set of objects and remove all previous ones.MultiResponsereplaceAllObjects(Iterable<T> data, RequestOptions requestOptions, boolean safe)Push a new set of objects and remove all previous ones.CompletableFuture<MultiResponse>replaceAllObjectsAsync(Iterable<T> data)Push a new set of objects and remove all previous ones.CompletableFuture<MultiResponse>replaceAllObjectsAsync(Iterable<T> data, boolean safe)Push a new set of objects and remove all previous ones.CompletableFuture<MultiResponse>replaceAllObjectsAsync(Iterable<T> data, RequestOptions requestOptions, boolean safe)Push a new set of objects and remove all previous ones.BatchIndexingResponsesaveObject(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.BatchIndexingResponsesaveObject(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.BatchIndexingResponsesaveObject(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.BatchIndexingResponsesaveObject(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.CompletableFuture<BatchIndexingResponse>saveObjectAsync(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.CompletableFuture<BatchIndexingResponse>saveObjectAsync(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.CompletableFuture<BatchIndexingResponse>saveObjectAsync(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.CompletableFuture<BatchIndexingResponse>saveObjectAsync(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.BatchIndexingResponsesaveObjects(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.BatchIndexingResponsesaveObjects(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.BatchIndexingResponsesaveObjects(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.BatchIndexingResponsesaveObjects(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.CompletableFuture<BatchIndexingResponse>saveObjectsAsync(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.CompletableFuture<BatchIndexingResponse>saveObjectsAsync(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.CompletableFuture<BatchIndexingResponse>saveObjectsAsync(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.CompletableFuture<BatchIndexingResponse>saveObjectsAsync(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.voidwaitTask(long taskId)Wait for a task to complete before executing the next line of code, to synchronize index updates.voidwaitTask(long taskId, long timeToWait, RequestOptions requestOptions)Wait for a task to complete before executing the next line of code, to synchronize index updates.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.algolia.search.SearchIndexRules
browseRules, browseRules, browseRules, clearRules, clearRules, clearRules, clearRules, clearRulesAsync, clearRulesAsync, clearRulesAsync, clearRulesAsync, deleteRule, deleteRule, deleteRuleAsync, deleteRuleAsync, getRule, getRule, getRuleAsync, getRuleAsync, replaceAllRules, replaceAllRules, replaceAllRules, replaceAllRulesAsync, replaceAllRulesAsync, replaceAllRulesAsync, saveRule, saveRule, saveRule, saveRule, saveRuleAsync, saveRuleAsync, saveRuleAsync, saveRuleAsync, saveRules, saveRules, saveRules, saveRules, saveRulesAsync, saveRulesAsync, saveRulesAsync, saveRulesAsync, searchRules, searchRules, searchRulesAsync, searchRulesAsync
-
Methods inherited from interface com.algolia.search.SearchIndexSearching
findObject, findObject, findObject, search, search, searchAsync, searchAsync, searchForFacetValues, searchForFacetValues, searchForFacetValuesAsync, searchForFacetValuesAsync
-
Methods inherited from interface com.algolia.search.SearchIndexSettings
getSettings, getSettings, getSettingsAsync, getSettingsAsync, setSettings, setSettings, setSettings, setSettings, setSettingsAsync, setSettingsAsync, setSettingsAsync, setSettingsAsync
-
Methods inherited from interface com.algolia.search.SearchIndexSynonyms
browseSynonyms, browseSynonyms, browseSynonyms, clearSynonyms, clearSynonyms, clearSynonyms, clearSynonymsAsync, clearSynonymsAsync, clearSynonymsAsync, deleteSynonym, deleteSynonym, deleteSynonym, deleteSynonymAsync, deleteSynonymAsync, deleteSynonymAsync, getSynonym, getSynonym, getSynonymAsync, getSynonymAsync, replaceAllSynonyms, replaceAllSynonyms, replaceAllSynonyms, replaceAllSynonymsAsync, replaceAllSynonymsAsync, replaceAllSynonymsAsync, saveSynonym, saveSynonym, saveSynonym, saveSynonym, saveSynonymAsync, saveSynonymAsync, saveSynonymAsync, saveSynonymAsync, saveSynonyms, saveSynonyms, saveSynonyms, saveSynonyms, saveSynonymsAsync, saveSynonymsAsync, saveSynonymsAsync, saveSynonymsAsync, searchSynonyms, searchSynonyms, searchSynonymsAsync, searchSynonymsAsync
-
-
-
-
Method Detail
-
getConfig
public SearchConfig getConfig()
- Specified by:
getConfigin interfaceSearchIndexBase<T>
-
getClazz
public Class<T> getClazz()
- Specified by:
getClazzin interfaceSearchIndexBase<T>
-
getTransport
public HttpTransport getTransport()
- Specified by:
getTransportin interfaceSearchIndexBase<T>
-
getUrlEncodedIndexName
public String getUrlEncodedIndexName()
- Specified by:
getUrlEncodedIndexNamein interfaceSearchIndexBase<T>
-
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 hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- 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 indexattributesToRetrieve- 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 hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- 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 indexrequestOptions- Options to pass to this request- Throws:
AlgoliaRetryException- When the retry has failed on all hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- 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 hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- 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 indexattributesToRetrieve- 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 hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- When an error occurred during the serialization
-
getObjectAsync
public CompletableFuture<T> getObjectAsync(@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 indexrequestOptions- Options to pass to this request- Throws:
AlgoliaRetryException- When the retry has failed on all hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- When an error occurred during the serialization)
-
getObjects
public List<T> getObjects(@Nonnull List<String> objectIDs)
Retrieve one or more objects, potentially from the index, in a single API call.- Parameters:
objectIDs- ID of the object within that index- Throws:
AlgoliaRetryException- When the retry has failed on all hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- 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 indexattributesToRetrieve- List of attributes to retrieve. By default, all retrievable attributes are returned.- Throws:
AlgoliaRetryException- When the retry has failed on all hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- 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 indexrequestOptions- Options to pass to this request- Throws:
AlgoliaRetryException- When the retry has failed on all hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- 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 indexattributesToRetrieve- 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 hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- When an error occurred during the serialization
-
getObjectsAsync
public CompletableFuture<List<T>> getObjectsAsync(@Nonnull List<String> objectIDs)
Retrieve one or more objects, potentially from the index, in a single API call.- Parameters:
objectIDs- ID of the object within that index- Throws:
AlgoliaRetryException- When the retry has failed on all hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- 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 indexattributesToRetrieve- List of attributes to retrieve. By default, all retrievable attributes are returned.- Throws:
AlgoliaRetryException- When the retry has failed on all hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- When an error occurred during the serialization
-
getObjectsAsync
public CompletableFuture<List<T>> getObjectsAsync(@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 indexrequestOptions- Options to pass to this request- Throws:
AlgoliaRetryException- When the retry has failed on all hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- 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 indexattributesToRetrieve- 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 hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- 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 hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- 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 updaterequestOptions- 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 hostsAlgoliaApiException- 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 updatecreateIfNotExists- 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 hostsAlgoliaApiException- 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 updatecreateIfNotExists- 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 hostsAlgoliaApiException- 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 hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- 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 updaterequestOptions- 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 hostsAlgoliaApiException- 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 updatecreateIfNotExists- 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 hostsAlgoliaApiException- 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 updatecreateIfNotExists- 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 hostsAlgoliaApiException- 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 hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- 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 APIrequestOptions- Options to pass to this request- Throws:
AlgoliaRetryException- When the retry has failed on all hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- 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 APIcreateIfNotExists- 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 hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- 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 APIcreateIfNotExists- 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 hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- 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 hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- 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 APIrequestOptions- Options to pass to this request- Throws:
AlgoliaRetryException- When the retry has failed on all hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- 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 APIcreateIfNotExists- 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 hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- 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 APIcreateIfNotExists- 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 hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- 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 hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- 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 sendautoGenerateObjectID- If set to true, the method will perform "ADD_OBJECT", otherwise will perform an "UpdateObject"- Throws:
AlgoliaRetryException- When the retry has failed on all hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- 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 sendrequestOptions- Options to pass to this request- Throws:
AlgoliaRetryException- When the retry has failed on all hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- 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 sendautoGenerateObjectID- 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 hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- 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 hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- 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 sendautoGenerateObjectID- If set to true, the method will perform "ADD_OBJECT", otherwise will perform an "UpdateObject"- Throws:
AlgoliaRetryException- When the retry has failed on all hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- 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 sendrequestOptions- Options to pass to this request- Throws:
AlgoliaRetryException- When the retry has failed on all hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- 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 sendautoGenerateObjectID- 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 hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- 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 hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- 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 sendautoGenerateObjectID- If set to true, the method will perform "ADD_OBJECT", otherwise will perform an "UpdateObject"- Throws:
AlgoliaRetryException- When the retry has failed on all hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- 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 sendrequestOptions- Options to pass to this request- Throws:
AlgoliaRetryException- When the retry has failed on all hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- 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 sendautoGenerateObjectID- 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 hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- 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 hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- 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 sendautoGenerateObjectID- If set to true, the method will perform "ADD_OBJECT", otherwise will perform an "UpdateObject"- Throws:
AlgoliaRetryException- When the retry has failed on all hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- 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 sendrequestOptions- Options to pass to this request- Throws:
AlgoliaRetryException- When the retry has failed on all hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- 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 sendautoGenerateObjectID- 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 hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- When the class doesn't have an objectID field or a Jacksonannotation @JsonProperty(\"objectID\"") and autoGenerateObjectID = false
-
batch
public <E> BatchResponse batch(@Nonnull BatchRequest<E> request)
Perform several indexing operations in one API call.- Parameters:
request- The batch request -- Throws:
AlgoliaRetryException- When the retry has failed on all hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- When an error occurred during the serialization
-
batch
public <E> BatchResponse batch(@Nonnull BatchRequest<E> request, RequestOptions requestOptions)
Perform several indexing operations in one API call.- Parameters:
request- The batch requestrequestOptions- Options to pass to this request- Throws:
AlgoliaRetryException- When the retry has failed on all hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- When an error occurred during the serialization
-
batchAsync
public <E> CompletableFuture<BatchResponse> batchAsync(@Nonnull BatchRequest<E> request)
Perform several indexing operations in one API call.- Parameters:
request- The batch request -- Throws:
AlgoliaRetryException- When the retry has failed on all hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- When an error occurred during the serialization
-
batchAsync
public <E> CompletableFuture<BatchResponse> batchAsync(@Nonnull BatchRequest<E> request, RequestOptions requestOptions)
Perform several indexing operations in one API call.- Parameters:
request- The batch requestrequestOptions- Options to pass to this request- Throws:
AlgoliaRetryException- When the retry has failed on all hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- When an error occurred during the serialization
-
deleteObject
public DeleteResponse deleteObject(@Nonnull String objectID)
Remove objects from an index using their object ids.- Parameters:
objectID- The Algolia objectID- Throws:
AlgoliaRetryException- When the retry has failed on all hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- When an error occurred during the serialization
-
deleteObject
public DeleteResponse deleteObject(@Nonnull String objectID, RequestOptions requestOptions)
Remove objects from an index using their object ids.- Parameters:
objectID- The Algolia objectIDrequestOptions- Options to pass to this request- Throws:
AlgoliaRetryException- When the retry has failed on all hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- When an error occurred during the serialization
-
deleteObjectAsync
public CompletableFuture<DeleteResponse> deleteObjectAsync(@Nonnull String objectID)
Remove objects from an index using their object ids.- Parameters:
objectID- The Algolia objectID- Throws:
AlgoliaRetryException- When the retry has failed on all hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- When an error occurred during the serialization
-
deleteObjectAsync
public CompletableFuture<DeleteResponse> deleteObjectAsync(@Nonnull String objectID, RequestOptions requestOptions)
Remove objects from an index using their object ids.- Parameters:
objectID- The Algolia objectIDrequestOptions- Options to pass to this request- Throws:
AlgoliaRetryException- When the retry has failed on all hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- When an error occurred during the serialization
-
deleteObjects
public BatchIndexingResponse deleteObjects(@Nonnull List<String> objectIDs)
Remove objects from an index using their object ids.- Parameters:
objectIDs- List of objectIDs to delete- Throws:
AlgoliaRetryException- When the retry has failed on all hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- When an error occurred during the serialization
-
deleteObjects
public BatchIndexingResponse deleteObjects(@Nonnull List<String> objectIDs, RequestOptions requestOptions)
Remove objects from an index using their object ids.- Parameters:
objectIDs- List of objectIDs to deleterequestOptions- Options to pass to this request- Throws:
AlgoliaRetryException- When the retry has failed on all hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- When an error occurred during the serialization
-
deleteObjectsAsync
public CompletableFuture<BatchIndexingResponse> deleteObjectsAsync(@Nonnull List<String> objectIDs)
Remove objects from an index using their object ids.- Parameters:
objectIDs- List of objectIDs to delete- Throws:
AlgoliaRetryException- When the retry has failed on all hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- When an error occurred during the serialization
-
deleteObjectsAsync
public CompletableFuture<BatchIndexingResponse> deleteObjectsAsync(@Nonnull List<String> objectIDs, RequestOptions requestOptions)
Remove objects from an index using their object ids.- Parameters:
objectIDs- List of objectIDs to deleterequestOptions- Options to pass to this request- Throws:
AlgoliaRetryException- When the retry has failed on all hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- When an error occurred during the serialization
-
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 hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- 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()
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 hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- When an error occurred during the serialization
-
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 hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- 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 hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- 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 sendsafe- Run all API calls synchronously- Throws:
AlgoliaRetryException- When the retry has failed on all hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- 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 sendrequestOptions- Options to pass to this requestsafe- Run all API calls synchronously- Throws:
AlgoliaRetryException- When the retry has failed on all hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- 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 hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- 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 sendsafe- Run all API calls synchronously- Throws:
AlgoliaRetryException- When the retry has failed on all hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- 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 sendrequestOptions- Options to pass to this requestsafe- Run all API calls synchronously- Throws:
AlgoliaRetryException- When the retry has failed on all hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- When an error occurred during the serialization
-
moveFrom
public MoveIndexResponse moveFrom(@Nonnull String sourceIndex)
Rename an index. Normally used to reindex your data atomically, without any down time.- Parameters:
sourceIndex- The source to move- Throws:
AlgoliaRetryException- When the retry has failed on all hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- When an error occurred during the serialization
-
moveFrom
public MoveIndexResponse moveFrom(@Nonnull String sourceIndex, RequestOptions requestOptions)
Rename an index. Normally used to reindex your data atomically, without any down time.- Parameters:
sourceIndex- The source to moverequestOptions- Options to pass to this request- Throws:
AlgoliaRetryException- When the retry has failed on all hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- When an error occurred during the serialization
-
moveFromAsync
public CompletableFuture<MoveIndexResponse> moveFromAsync(@Nonnull String sourceIndex)
Rename an index. Normally used to reindex your data atomically, without any down time.- Parameters:
sourceIndex- The source to move- Throws:
AlgoliaRetryException- When the retry has failed on all hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- When an error occurred during the serialization
-
moveFromAsync
public CompletableFuture<MoveIndexResponse> moveFromAsync(@Nonnull String sourceIndex, RequestOptions requestOptions)
Rename an index. Normally used to reindex your data atomically, without any down time.- Parameters:
sourceIndex- The source to moverequestOptions- Options to pass to this request- Throws:
AlgoliaRetryException- When the retry has failed on all hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- 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 hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- 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 hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- 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 queryrequestOptions- Options to pass to this request- Throws:
AlgoliaRetryException- When the retry has failed on all hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- When an error occurred during the serialization
-
browseFromAsync
public CompletableFuture<BrowseIndexResponse<T>> browseFromAsync(@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 hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- When an error occurred during the serialization
-
browseFromAsync
public CompletableFuture<BrowseIndexResponse<T>> browseFromAsync(@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 queryrequestOptions- Options to pass to this request- Throws:
AlgoliaRetryException- When the retry has failed on all hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- When an error occurred during the serialization
-
delete
public DeleteResponse delete()
Delete the index and all its settings, including links to its replicas.- Throws:
AlgoliaRetryException- When the retry has failed on all hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- When an error occurred during the serialization
-
delete
public DeleteResponse delete(RequestOptions requestOptions)
Delete the index and all its settings, including links to its replicas.- Parameters:
requestOptions- Options to pass to this request- Throws:
AlgoliaRetryException- When the retry has failed on all hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- When an error occurred during the serialization
-
deleteAsync
public CompletableFuture<DeleteResponse> deleteAsync()
Delete the index and all its settings, including links to its replicas.- Throws:
AlgoliaRetryException- When the retry has failed on all hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- When an error occurred during the serialization
-
deleteAsync
public CompletableFuture<DeleteResponse> deleteAsync(RequestOptions requestOptions)
Delete the index and all its settings, including links to its replicas.- Parameters:
requestOptions- Options to pass to this request- Throws:
AlgoliaRetryException- When the retry has failed on all hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- 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 hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- 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 deleterequestOptions- requestOptions Options to pass to this request- Throws:
AlgoliaRetryException- When the retry has failed on all hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- 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 hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- 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 deleterequestOptions- requestOptions Options to pass to this request- Throws:
AlgoliaRetryException- When the retry has failed on all hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- When an error occurred during the serialization
-
getTask
public TaskStatusResponse getTask(long taskID)
Get the status of the given task- Parameters:
taskID- The Algolia taskID- Throws:
AlgoliaRetryException- When the retry has failed on all hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- When an error occurred during the serialization
-
getTask
public TaskStatusResponse getTask(long taskID, RequestOptions requestOptions)
Get the status of the given task- Parameters:
taskID- The Algolia taskIDrequestOptions- Options to pass to this request- Throws:
AlgoliaRetryException- When the retry has failed on all hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- When an error occurred during the serialization
-
getTaskAsync
public CompletableFuture<TaskStatusResponse> getTaskAsync(long taskID)
Get the status of the given task- Parameters:
taskID- The Algolia taskID- Throws:
AlgoliaRetryException- When the retry has failed on all hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- When an error occurred during the serialization
-
getTaskAsync
public CompletableFuture<TaskStatusResponse> getTaskAsync(long taskID, RequestOptions requestOptions)
Get the status of the given task- Parameters:
taskID- The Algolia taskIDrequestOptions- Options to pass to this request- Throws:
AlgoliaRetryException- When the retry has failed on all hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- When an error occurred during the serialization
-
exists
public boolean exists()
Return whether an index exists or not- Throws:
AlgoliaRetryException- When the retry has failed on all hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- When an error occurred during the serialization
-
existsAsync
public CompletableFuture<Boolean> existsAsync()
Return whether an index exists or not- Throws:
AlgoliaRetryException- When the retry has failed on all hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- 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:
waitTaskin interfaceSearchIndexBase<T>- Parameters:
taskId- The Algolia taskID- Throws:
AlgoliaRetryException- When the retry has failed on all hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- 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:
waitTaskin interfaceSearchIndexBase<T>- Parameters:
taskId- The Algolia taskIDtimeToWait- The time to wait between each callrequestOptions- Options to pass to this request- Throws:
AlgoliaRetryException- When the retry has failed on all hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- When an error occurred during the serialization
-
-