SearchClientExtensions

algoliasearch.extension.`package`.SearchClientExtensions
implicit class SearchClientExtensions(val client: SearchClient)

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def chunkedBatch(indexName: String, objects: Seq[Any], action: Action, waitForTasks: Boolean, batchSize: Int, requestOptions: Option[RequestOptions])(implicit ec: ExecutionContext): Future[Seq[BatchResponse]]

Helper: Chunks the given objects list in subset of 1000 elements max to make it fit in batch requests.

Helper: Chunks the given objects list in subset of 1000 elements max to make it fit in batch requests.

Value parameters

action

The action to perform on the objects.

batchSize

The size of the batch. Default is 1000.

indexName

The index in which to perform the request.

objects

The list of objects to save.

requestOptions

Additional request configuration.

waitForTasks

Whether to wait for the tasks to complete.

Attributes

Returns

A future containing the response of the batch operations.

def deleteObjects(indexName: String, objectIDs: Seq[String], requestOptions: Option[RequestOptions])(implicit ec: ExecutionContext): Future[Seq[BatchResponse]]

Helper: Deletes every objects for the given objectIDs. The chunkedBatch helper is used under the hood, which creates a batch requests with at most 1000 objectIDs in it.

Helper: Deletes every objects for the given objectIDs. The chunkedBatch helper is used under the hood, which creates a batch requests with at most 1000 objectIDs in it.

Value parameters

indexName

The index in which to perform the request.

objectIDs

The list of objectIDs to delete.

requestOptions

Additional request configuration.

Attributes

Returns

A future containing the response of the batch operations.

def partialUpdateObjects(indexName: String, objects: Seq[Any], createIfNotExists: Boolean, requestOptions: Option[RequestOptions])(implicit ec: ExecutionContext): Future[Seq[BatchResponse]]

Helper: Replaces object content of all the given objects according to their respective objectID field. The chunkedBatch helper is used under the hood, which creates a batch requests with at most 1000 objects in it.

Helper: Replaces object content of all the given objects according to their respective objectID field. The chunkedBatch helper is used under the hood, which creates a batch requests with at most 1000 objects in it.

Value parameters

createIfNotExists

To be provided if non-existing objects are passed, otherwise, the call will fail.

indexName

The index in which to perform the request.

objects

The list of objects to save.

requestOptions

Additional request configuration.

Attributes

Returns

A future containing the response of the batch operations.

def replaceAllObjects(indexName: String, objects: Seq[Any], batchSize: Int, requestOptions: Option[RequestOptions])(implicit ec: ExecutionContext): Future[ReplaceAllObjectsResponse]

Push a new set of objects and remove all previous ones. Settings, synonyms and query rules are untouched. Replace all objects in an index without any downtime. Internally, this method copies the existing index settings, synonyms and query rules and indexes all passed objects. Finally, the temporary one replaces the existing index.

Push a new set of objects and remove all previous ones. Settings, synonyms and query rules are untouched. Replace all objects in an index without any downtime. Internally, this method copies the existing index settings, synonyms and query rules and indexes all passed objects. Finally, the temporary one replaces the existing index.

See https://api-clients-automation.netlify.app/docs/contributing/add-new-api-client#5-helpers for implementation details.

Value parameters

batchSize

The size of the batch. Default is 1000.

indexName

The index in which to perform the request.

objects

The list of objects to replace.

requestOptions

Additional request configuration.

Attributes

Returns

A future containing the response of the three-step operations: copy, batch and move.

def saveObjects(indexName: String, objects: Seq[Any], requestOptions: Option[RequestOptions])(implicit ec: ExecutionContext): Future[Seq[BatchResponse]]

Helper: Saves the given array of objects in the given index. The chunkedBatch helper is used under the hood, which creates a batch requests with at most 1000 objects in it.

Helper: Saves the given array of objects in the given index. The chunkedBatch helper is used under the hood, which creates a batch requests with at most 1000 objects in it.

Value parameters

indexName

The index in which to perform the request.

objects

The list of objects to save.

requestOptions

Additional request configuration.

Attributes

Returns

A future containing the response of the batch operations.

def waitAppTask(taskID: Long, delay: Long => Long, maxRetries: Int, requestOptions: Option[RequestOptions])(implicit ec: ExecutionContext): Future[TaskStatus]

Wait for an application-level taskID to complete before executing the next line of code.

Wait for an application-level taskID to complete before executing the next line of code.

Value parameters

maxRetries

maximum number of retry attempts.

requestOptions

additional request configuration.

taskID

The ID of the task to wait for.

Attributes

def waitForApiKey(operation: ApiKeyOperation, key: String, apiKey: Option[ApiKey], maxRetries: Int, delay: Long => Long, requestOptions: Option[RequestOptions])(implicit ec: ExecutionContext): Future[Any]

Wait for an API key to be added, updated or deleted based on a given operation.

Wait for an API key to be added, updated or deleted based on a given operation.

Value parameters

apiKey

Required for update operation, to compare the response with the given key.

key

The key that has been added, deleted or updated.

maxRetries

The maximum number of retries. 50 by default. (optional)

operation

The operation that was done on a key.

requestOptions

Additional request configuration.

Attributes

def waitKeyCreation(key: String, maxRetries: Int, delay: Long => Long, requestOptions: Option[RequestOptions])(implicit ec: ExecutionContext): Future[GetApiKeyResponse]

Wait on an API key creation operation.

Wait on an API key creation operation.

Value parameters

key

The key that has been created.

maxRetries

Maximum number of retry attempts.

requestOptions

Additional request configuration.

Attributes

def waitKeyDelete(key: String, maxRetries: Int, delay: Long => Long, requestOptions: Option[RequestOptions])(implicit ec: ExecutionContext): Future[Boolean]

Wait on a delete API ket operation

Wait on a delete API ket operation

Value parameters

key

The key that has been deleted.

maxRetries

Maximum number of retry attempts.

requestOptions

Additional request configuration.

Attributes

def waitKeyUpdate(key: String, apiKey: ApiKey, maxRetries: Int, delay: Long => Long, requestOptions: Option[RequestOptions])(implicit ec: ExecutionContext): Future[GetApiKeyResponse]

Wait on an API key update operation.

Wait on an API key update operation.

Value parameters

apiKey

Necessary to know if an update operation has been processed, compare fields of the response with it.

key

The key that has been updated.

maxRetries

Maximum number of retry attempts.

requestOptions

Additional request configuration.

Attributes

def waitTask(indexName: String, taskID: Long, delay: Long => Long, maxRetries: Int, requestOptions: Option[RequestOptions])(implicit ec: ExecutionContext): Future[TaskStatus]

Wait for a taskID to complete before executing the next line of code, to synchronize index updates. All write operations in Algolia are asynchronous by design. It means that when you add or update an object to your index, our servers will reply to your request with a taskID as soon as they understood the write operation. The actual insert and indexing will be done after replying to your code. You can wait for a task to complete by using the [taskID] and this method.

Wait for a taskID to complete before executing the next line of code, to synchronize index updates. All write operations in Algolia are asynchronous by design. It means that when you add or update an object to your index, our servers will reply to your request with a taskID as soon as they understood the write operation. The actual insert and indexing will be done after replying to your code. You can wait for a task to complete by using the [taskID] and this method.

Value parameters

indexName

The index in which to perform the request.

maxRetries

maximum number of retry attempts.

requestOptions

additional request configuration.

taskID

The ID of the task to wait for.

Attributes

Concrete fields