SearchClient

algoliasearch.api.SearchClient
See theSearchClient companion object
class SearchClient(appId: String, apiKey: String, clientOptions: ClientOptions) extends ApiClient

Attributes

Companion
object
Graph
Supertypes
class ApiClient
trait AutoCloseable
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def addApiKey(apiKey: ApiKey, requestOptions: Option[RequestOptions])(implicit ec: ExecutionContext): Future[AddApiKeyResponse]

Creates a new API key with specific permissions and restrictions.

Creates a new API key with specific permissions and restrictions.

Required API Key ACLs:

  • admin

Attributes

def addOrUpdateObject(indexName: String, objectID: String, body: Any, requestOptions: Option[RequestOptions])(implicit ec: ExecutionContext): Future[UpdatedAtWithObjectIdResponse]

If a record with the specified object ID exists, the existing record is replaced. Otherwise, a new record is added to the index. To update some attributes of an existing record, use the partial operation instead. To add, update, or replace multiple records, use the batch operation.

If a record with the specified object ID exists, the existing record is replaced. Otherwise, a new record is added to the index. To update some attributes of an existing record, use the partial operation instead. To add, update, or replace multiple records, use the batch operation.

Required API Key ACLs:

  • addObject

Value parameters

body

The record, a schemaless object with attributes that are useful in the context of search and discovery.

indexName

Name of the index on which to perform the operation.

objectID

Unique record identifier.

Attributes

def appendSource(source: Source, requestOptions: Option[RequestOptions])(implicit ec: ExecutionContext): Future[CreatedAtResponse]

Adds a source to the list of allowed sources.

Adds a source to the list of allowed sources.

Required API Key ACLs:

  • admin

Value parameters

source

Source to add.

Attributes

def assignUserId(xAlgoliaUserID: String, assignUserIdParams: AssignUserIdParams, requestOptions: Option[RequestOptions])(implicit ec: ExecutionContext): Future[CreatedAtResponse]

Assigns or moves a user ID to a cluster. The time it takes to move a user is proportional to the amount of data linked to the user ID.

Assigns or moves a user ID to a cluster. The time it takes to move a user is proportional to the amount of data linked to the user ID.

Required API Key ACLs:

  • admin

Value parameters

xAlgoliaUserID

Unique identifier of the user who makes the search request.

Attributes

def batch(indexName: String, batchWriteParams: BatchWriteParams, requestOptions: Option[RequestOptions])(implicit ec: ExecutionContext): Future[BatchResponse]

Adds, updates, or deletes records in one index with a single API request. Batching index updates reduces latency and increases data integrity. - Actions are applied in the order they're specified. - Actions are equivalent to the individual API requests of the same name.

Adds, updates, or deletes records in one index with a single API request. Batching index updates reduces latency and increases data integrity. - Actions are applied in the order they're specified. - Actions are equivalent to the individual API requests of the same name.

Value parameters

indexName

Name of the index on which to perform the operation.

Attributes

def batchAssignUserIds(xAlgoliaUserID: String, batchAssignUserIdsParams: BatchAssignUserIdsParams, requestOptions: Option[RequestOptions])(implicit ec: ExecutionContext): Future[CreatedAtResponse]

Assigns multiple user IDs to a cluster. You can't move users with this operation.

Assigns multiple user IDs to a cluster. You can't move users with this operation.

Required API Key ACLs:

  • admin

Value parameters

xAlgoliaUserID

Unique identifier of the user who makes the search request.

Attributes

def batchDictionaryEntries(dictionaryName: DictionaryType, batchDictionaryEntriesParams: BatchDictionaryEntriesParams, requestOptions: Option[RequestOptions])(implicit ec: ExecutionContext): Future[UpdatedAtResponse]

Adds or deletes multiple entries from your plurals, segmentation, or stop word dictionaries.

Adds or deletes multiple entries from your plurals, segmentation, or stop word dictionaries.

Required API Key ACLs:

  • editSettings

Value parameters

dictionaryName

Dictionary type in which to search.

Attributes

def browse(indexName: String, browseParams: Option[BrowseParams], requestOptions: Option[RequestOptions])(implicit ec: ExecutionContext): Future[BrowseResponse]

Retrieves records from an index, up to 1,000 per request. While searching retrieves hits (records augmented with attributes for highlighting and ranking details), browsing just returns matching records. This can be useful if you want to export your indices. - The Analytics API doesn't collect data when using browse. - Records are ranked by attributes and custom ranking. - Deduplication (distinct) is turned off. - There's no ranking for: typo-tolerance, number of matched words, proximity, geo distance.

Retrieves records from an index, up to 1,000 per request. While searching retrieves hits (records augmented with attributes for highlighting and ranking details), browsing just returns matching records. This can be useful if you want to export your indices. - The Analytics API doesn't collect data when using browse. - Records are ranked by attributes and custom ranking. - Deduplication (distinct) is turned off. - There's no ranking for: typo-tolerance, number of matched words, proximity, geo distance.

Required API Key ACLs:

  • browse

Value parameters

indexName

Name of the index on which to perform the operation.

Attributes

def clearObjects(indexName: String, requestOptions: Option[RequestOptions])(implicit ec: ExecutionContext): Future[UpdatedAtResponse]

Deletes only the records from an index while keeping settings, synonyms, and rules.

Deletes only the records from an index while keeping settings, synonyms, and rules.

Required API Key ACLs:

  • deleteIndex

Value parameters

indexName

Name of the index on which to perform the operation.

Attributes

def clearRules(indexName: String, forwardToReplicas: Option[Boolean], requestOptions: Option[RequestOptions])(implicit ec: ExecutionContext): Future[UpdatedAtResponse]

Deletes all rules from the index.

Deletes all rules from the index.

Required API Key ACLs:

  • editSettings

Value parameters

forwardToReplicas

Whether changes are applied to replica indices.

indexName

Name of the index on which to perform the operation.

Attributes

def clearSynonyms(indexName: String, forwardToReplicas: Option[Boolean], requestOptions: Option[RequestOptions])(implicit ec: ExecutionContext): Future[UpdatedAtResponse]

Deletes all synonyms from the index.

Deletes all synonyms from the index.

Required API Key ACLs:

  • editSettings

Value parameters

forwardToReplicas

Whether changes are applied to replica indices.

indexName

Name of the index on which to perform the operation.

Attributes

def customDelete[T : Manifest](path: String, parameters: Option[Map[String, Any]], requestOptions: Option[RequestOptions])(implicit evidence$1: Manifest[T], ec: ExecutionContext): Future[T]

This method allow you to send requests to the Algolia REST API.

This method allow you to send requests to the Algolia REST API.

Value parameters

parameters

Query parameters to apply to the current query.

path

Path of the endpoint, anything after "/1" must be specified.

Attributes

def customGet[T : Manifest](path: String, parameters: Option[Map[String, Any]], requestOptions: Option[RequestOptions])(implicit evidence$2: Manifest[T], ec: ExecutionContext): Future[T]

This method allow you to send requests to the Algolia REST API.

This method allow you to send requests to the Algolia REST API.

Value parameters

parameters

Query parameters to apply to the current query.

path

Path of the endpoint, anything after "/1" must be specified.

Attributes

def customPost[T : Manifest](path: String, parameters: Option[Map[String, Any]], body: Option[Any], requestOptions: Option[RequestOptions])(implicit evidence$3: Manifest[T], ec: ExecutionContext): Future[T]

This method allow you to send requests to the Algolia REST API.

This method allow you to send requests to the Algolia REST API.

Value parameters

body

Parameters to send with the custom request.

parameters

Query parameters to apply to the current query.

path

Path of the endpoint, anything after "/1" must be specified.

Attributes

def customPut[T : Manifest](path: String, parameters: Option[Map[String, Any]], body: Option[Any], requestOptions: Option[RequestOptions])(implicit evidence$4: Manifest[T], ec: ExecutionContext): Future[T]

This method allow you to send requests to the Algolia REST API.

This method allow you to send requests to the Algolia REST API.

Value parameters

body

Parameters to send with the custom request.

parameters

Query parameters to apply to the current query.

path

Path of the endpoint, anything after "/1" must be specified.

Attributes

def deleteApiKey(key: String, requestOptions: Option[RequestOptions])(implicit ec: ExecutionContext): Future[DeleteApiKeyResponse]

Deletes the API key.

Deletes the API key.

Required API Key ACLs:

  • admin

Value parameters

key

API key.

Attributes

def deleteBy(indexName: String, deleteByParams: DeleteByParams, requestOptions: Option[RequestOptions])(implicit ec: ExecutionContext): Future[DeletedAtResponse]

This operation doesn't accept empty queries or filters. It's more efficient to get a list of object IDs with the browse operation, and then delete the records using the batch operation.

This operation doesn't accept empty queries or filters. It's more efficient to get a list of object IDs with the browse operation, and then delete the records using the batch operation.

Required API Key ACLs:

  • deleteIndex

Value parameters

indexName

Name of the index on which to perform the operation.

Attributes

def deleteIndex(indexName: String, requestOptions: Option[RequestOptions])(implicit ec: ExecutionContext): Future[DeletedAtResponse]

Deletes an index and all its settings. - Deleting an index doesn't delete its analytics data. - If you try to delete a non-existing index, the operation is ignored without warning. - If the index you want to delete has replica indices, the replicas become independent indices. - If the index you want to delete is a replica index, you must first unlink it from its primary index before you can delete it. For more information, see Delete replica indices.

Deletes an index and all its settings. - Deleting an index doesn't delete its analytics data. - If you try to delete a non-existing index, the operation is ignored without warning. - If the index you want to delete has replica indices, the replicas become independent indices. - If the index you want to delete is a replica index, you must first unlink it from its primary index before you can delete it. For more information, see Delete replica indices.

Required API Key ACLs:

  • deleteIndex

Value parameters

indexName

Name of the index on which to perform the operation.

Attributes

def deleteObject(indexName: String, objectID: String, requestOptions: Option[RequestOptions])(implicit ec: ExecutionContext): Future[DeletedAtResponse]

Deletes a record by its object ID. To delete more than one record, use the batch operation. To delete records matching a query, use the deleteByQuery operation.

Deletes a record by its object ID. To delete more than one record, use the batch operation. To delete records matching a query, use the deleteByQuery operation.

Required API Key ACLs:

  • deleteObject

Value parameters

indexName

Name of the index on which to perform the operation.

objectID

Unique record identifier.

Attributes

def deleteRule(indexName: String, objectID: String, forwardToReplicas: Option[Boolean], requestOptions: Option[RequestOptions])(implicit ec: ExecutionContext): Future[UpdatedAtResponse]

Deletes a rule by its ID. To find the object ID for rules, use the search operation.

Deletes a rule by its ID. To find the object ID for rules, use the search operation.

Required API Key ACLs:

  • editSettings

Value parameters

forwardToReplicas

Whether changes are applied to replica indices.

indexName

Name of the index on which to perform the operation.

objectID

Unique identifier of a rule object.

Attributes

def deleteSource(source: String, requestOptions: Option[RequestOptions])(implicit ec: ExecutionContext): Future[DeleteSourceResponse]

Deletes a source from the list of allowed sources.

Deletes a source from the list of allowed sources.

Required API Key ACLs:

  • admin

Value parameters

source

IP address range of the source.

Attributes

def deleteSynonym(indexName: String, objectID: String, forwardToReplicas: Option[Boolean], requestOptions: Option[RequestOptions])(implicit ec: ExecutionContext): Future[DeletedAtResponse]

Deletes a synonym by its ID. To find the object IDs of your synonyms, use the search operation.

Deletes a synonym by its ID. To find the object IDs of your synonyms, use the search operation.

Required API Key ACLs:

  • editSettings

Value parameters

forwardToReplicas

Whether changes are applied to replica indices.

indexName

Name of the index on which to perform the operation.

objectID

Unique identifier of a synonym object.

Attributes

def getApiKey(key: String, requestOptions: Option[RequestOptions])(implicit ec: ExecutionContext): Future[GetApiKeyResponse]

Gets the permissions and restrictions of an API key. When authenticating with the admin API key, you can request information for any of your application's keys. When authenticating with other API keys, you can only retrieve information for that key.

Gets the permissions and restrictions of an API key. When authenticating with the admin API key, you can request information for any of your application's keys. When authenticating with other API keys, you can only retrieve information for that key.

Value parameters

key

API key.

Attributes

def getDictionaryLanguages(requestOptions: Option[RequestOptions])(implicit ec: ExecutionContext): Future[Map[String, Languages]]

Lists supported languages with their supported dictionary types and number of custom entries.

Lists supported languages with their supported dictionary types and number of custom entries.

Required API Key ACLs:

  • settings

Attributes

def getDictionarySettings(requestOptions: Option[RequestOptions])(implicit ec: ExecutionContext): Future[GetDictionarySettingsResponse]

Retrieves the languages for which standard dictionary entries are turned off.

Retrieves the languages for which standard dictionary entries are turned off.

Required API Key ACLs:

  • settings

Attributes

def getLogs(offset: Option[Int], length: Option[Int], indexName: Option[String], `type`: Option[LogType], requestOptions: Option[RequestOptions])(implicit ec: ExecutionContext): Future[GetLogsResponse]

The request must be authenticated by an API key with the logs ACL. - Logs are held for the last seven days. - Up to 1,000 API requests per server are logged. - This request counts towards your operations quota but doesn't appear in the logs itself.

The request must be authenticated by an API key with the logs ACL. - Logs are held for the last seven days. - Up to 1,000 API requests per server are logged. - This request counts towards your operations quota but doesn't appear in the logs itself.

Required API Key ACLs:

  • logs

Value parameters

`type`

Type of log entries to retrieve. By default, all log entries are retrieved.

indexName

Index for which to retrieve log entries. By default, log entries are retrieved for all indices.

length

Maximum number of entries to retrieve.

offset

First log entry to retrieve. The most recent entries are listed first.

Attributes

def getObject(indexName: String, objectID: String, attributesToRetrieve: Option[Seq[String]], requestOptions: Option[RequestOptions])(implicit ec: ExecutionContext): Future[Map[String, String]]

Retrieves one record by its object ID. To retrieve more than one record, use the objects operation.

Retrieves one record by its object ID. To retrieve more than one record, use the objects operation.

Required API Key ACLs:

  • search

Value parameters

attributesToRetrieve

Attributes to include with the records in the response. This is useful to reduce the size of the API response. By default, all retrievable attributes are returned. objectID is always retrieved. Attributes included in unretrievableAttributes won't be retrieved unless the request is authenticated with the admin API key.

indexName

Name of the index on which to perform the operation.

objectID

Unique record identifier.

Attributes

def getObjects(getObjectsParams: GetObjectsParams, requestOptions: Option[RequestOptions])(implicit ec: ExecutionContext): Future[GetObjectsResponse]

Retrieves one or more records, potentially from different indices. Records are returned in the same order as the requests.

Retrieves one or more records, potentially from different indices. Records are returned in the same order as the requests.

Required API Key ACLs:

  • search

Value parameters

getObjectsParams

Request object.

Attributes

def getRule(indexName: String, objectID: String, requestOptions: Option[RequestOptions])(implicit ec: ExecutionContext): Future[Rule]

Retrieves a rule by its ID. To find the object ID of rules, use the search operation.

Retrieves a rule by its ID. To find the object ID of rules, use the search operation.

Required API Key ACLs:

  • settings

Value parameters

indexName

Name of the index on which to perform the operation.

objectID

Unique identifier of a rule object.

Attributes

def getSettings(indexName: String, requestOptions: Option[RequestOptions])(implicit ec: ExecutionContext): Future[IndexSettings]

Retrieves an object with non-null index settings.

Retrieves an object with non-null index settings.

Required API Key ACLs:

  • search

Value parameters

indexName

Name of the index on which to perform the operation.

Attributes

def getSources(requestOptions: Option[RequestOptions])(implicit ec: ExecutionContext): Future[Seq[Source]]

Retrieves all allowed IP addresses with access to your application.

Retrieves all allowed IP addresses with access to your application.

Required API Key ACLs:

  • admin

Attributes

def getSynonym(indexName: String, objectID: String, requestOptions: Option[RequestOptions])(implicit ec: ExecutionContext): Future[SynonymHit]

Retrieves a syonym by its ID. To find the object IDs for your synonyms, use the search operation.

Retrieves a syonym by its ID. To find the object IDs for your synonyms, use the search operation.

Required API Key ACLs:

  • settings

Value parameters

indexName

Name of the index on which to perform the operation.

objectID

Unique identifier of a synonym object.

Attributes

def getTask(indexName: String, taskID: Long, requestOptions: Option[RequestOptions])(implicit ec: ExecutionContext): Future[GetTaskResponse]

Checks the status of a given task. Indexing tasks are asynchronous. When you add, update, or delete records or indices, a task is created on a queue and completed depending on the load on the server. The indexing tasks' responses include a task ID that you can use to check the status.

Checks the status of a given task. Indexing tasks are asynchronous. When you add, update, or delete records or indices, a task is created on a queue and completed depending on the load on the server. The indexing tasks' responses include a task ID that you can use to check the status.

Required API Key ACLs:

  • addObject

Value parameters

indexName

Name of the index on which to perform the operation.

taskID

Unique task identifier.

Attributes

def getTopUserIds(requestOptions: Option[RequestOptions])(implicit ec: ExecutionContext): Future[GetTopUserIdsResponse]

Get the IDs of the 10 users with the highest number of records per cluster. Since it can take a few seconds to get the data from the different clusters, the response isn't real-time.

Get the IDs of the 10 users with the highest number of records per cluster. Since it can take a few seconds to get the data from the different clusters, the response isn't real-time.

Required API Key ACLs:

  • admin

Attributes

def getUserId(userID: String, requestOptions: Option[RequestOptions])(implicit ec: ExecutionContext): Future[UserId]

Returns the user ID data stored in the mapping. Since it can take a few seconds to get the data from the different clusters, the response isn't real-time.

Returns the user ID data stored in the mapping. Since it can take a few seconds to get the data from the different clusters, the response isn't real-time.

Required API Key ACLs:

  • admin

Value parameters

userID

Unique identifier of the user who makes the search request.

Attributes

def hasPendingMappings(getClusters: Option[Boolean], requestOptions: Option[RequestOptions])(implicit ec: ExecutionContext): Future[HasPendingMappingsResponse]

To determine when the time-consuming process of creating a large batch of users or migrating users from one cluster to another is complete, this operation retrieves the status of the process.

To determine when the time-consuming process of creating a large batch of users or migrating users from one cluster to another is complete, this operation retrieves the status of the process.

Required API Key ACLs:

  • admin

Value parameters

getClusters

Whether to include the cluster's pending mapping state in the response.

Attributes

def listApiKeys(requestOptions: Option[RequestOptions])(implicit ec: ExecutionContext): Future[ListApiKeysResponse]

Lists all API keys associated with your Algolia application, including their permissions and restrictions.

Lists all API keys associated with your Algolia application, including their permissions and restrictions.

Required API Key ACLs:

  • admin

Attributes

def listClusters(requestOptions: Option[RequestOptions])(implicit ec: ExecutionContext): Future[ListClustersResponse]

Lists the available clusters in a multi-cluster setup.

Lists the available clusters in a multi-cluster setup.

Required API Key ACLs:

  • admin

Attributes

def listIndices(page: Option[Int], hitsPerPage: Option[Int], requestOptions: Option[RequestOptions])(implicit ec: ExecutionContext): Future[ListIndicesResponse]

Lists all indices in the current Algolia application. The request follows any index restrictions of the API key you use to make the request.

Lists all indices in the current Algolia application. The request follows any index restrictions of the API key you use to make the request.

Required API Key ACLs:

  • listIndexes

Value parameters

hitsPerPage

Number of hits per page.

page

Requested page of the API response. If null, the API response is not paginated.

Attributes

def listUserIds(page: Option[Int], hitsPerPage: Option[Int], requestOptions: Option[RequestOptions])(implicit ec: ExecutionContext): Future[ListUserIdsResponse]

Lists the userIDs assigned to a multi-cluster application. Since it can take a few seconds to get the data from the different clusters, the response isn't real-time.

Lists the userIDs assigned to a multi-cluster application. Since it can take a few seconds to get the data from the different clusters, the response isn't real-time.

Required API Key ACLs:

  • admin

Value parameters

hitsPerPage

Number of hits per page.

page

Requested page of the API response. If null, the API response is not paginated.

Attributes

def multipleBatch(batchParams: BatchParams, requestOptions: Option[RequestOptions])(implicit ec: ExecutionContext): Future[MultipleBatchResponse]

Adds, updates, or deletes records in multiple indices with a single API request. - Actions are applied in the order they are specified. - Actions are equivalent to the individual API requests of the same name.

Adds, updates, or deletes records in multiple indices with a single API request. - Actions are applied in the order they are specified. - Actions are equivalent to the individual API requests of the same name.

Attributes

def operationIndex(indexName: String, operationIndexParams: OperationIndexParams, requestOptions: Option[RequestOptions])(implicit ec: ExecutionContext): Future[UpdatedAtResponse]

Copies or moves (renames) an index within the same Algolia application. - Existing destination indices are overwritten, except for index-specific API keys and analytics data. - If the destination index doesn't exist yet, it'll be created. Copy - Copying a source index that doesn't exist creates a new index with 0 records and default settings. - The API keys of the source index are merged with the existing keys in the destination index. - You can't copy the enableReRanking, mode, and replicas settings. - You can't copy to a destination index that already has replicas. - Be aware of the size limits. - Related guide: Copy indices Move - Moving a source index that doesn't exist is ignored without returning an error. - When moving an index, the analytics data keep their original name and a new set of analytics data is started for the new name. To access the original analytics in the dashboard, create an index with the original name. - If the destination index has replicas, moving will overwrite the existing index and copy the data to the replica indices. - Related guide: Move indices.

Copies or moves (renames) an index within the same Algolia application. - Existing destination indices are overwritten, except for index-specific API keys and analytics data. - If the destination index doesn't exist yet, it'll be created. Copy - Copying a source index that doesn't exist creates a new index with 0 records and default settings. - The API keys of the source index are merged with the existing keys in the destination index. - You can't copy the enableReRanking, mode, and replicas settings. - You can't copy to a destination index that already has replicas. - Be aware of the size limits. - Related guide: Copy indices Move - Moving a source index that doesn't exist is ignored without returning an error. - When moving an index, the analytics data keep their original name and a new set of analytics data is started for the new name. To access the original analytics in the dashboard, create an index with the original name. - If the destination index has replicas, moving will overwrite the existing index and copy the data to the replica indices. - Related guide: Move indices.

Required API Key ACLs:

  • addObject

Value parameters

indexName

Name of the index on which to perform the operation.

Attributes

def partialUpdateObject(indexName: String, objectID: String, attributesToUpdate: Map[String, AttributeToUpdate], createIfNotExists: Option[Boolean], requestOptions: Option[RequestOptions])(implicit ec: ExecutionContext): Future[UpdatedAtWithObjectIdResponse]

Adds new attributes to a record, or update existing ones. - If a record with the specified object ID doesn't exist, a new record is added to the index if createIfNotExists is true. - If the index doesn't exist yet, this method creates a new index. - You can use any first-level attribute but not nested attributes. If you specify a nested attribute, the engine treats it as a replacement for its first-level ancestor.

Adds new attributes to a record, or update existing ones. - If a record with the specified object ID doesn't exist, a new record is added to the index if createIfNotExists is true. - If the index doesn't exist yet, this method creates a new index. - You can use any first-level attribute but not nested attributes. If you specify a nested attribute, the engine treats it as a replacement for its first-level ancestor.

Required API Key ACLs:

  • addObject

Value parameters

attributesToUpdate

Attributes with their values.

createIfNotExists

Whether to create a new record if it doesn't exist.

indexName

Name of the index on which to perform the operation.

objectID

Unique record identifier.

Attributes

def removeUserId(userID: String, requestOptions: Option[RequestOptions])(implicit ec: ExecutionContext): Future[RemoveUserIdResponse]

Deletes a user ID and its associated data from the clusters.

Deletes a user ID and its associated data from the clusters.

Required API Key ACLs:

  • admin

Value parameters

userID

Unique identifier of the user who makes the search request.

Attributes

def replaceSources(source: Seq[Source], requestOptions: Option[RequestOptions])(implicit ec: ExecutionContext): Future[ReplaceSourceResponse]

Replaces the list of allowed sources.

Replaces the list of allowed sources.

Required API Key ACLs:

  • admin

Value parameters

source

Allowed sources.

Attributes

def restoreApiKey(key: String, requestOptions: Option[RequestOptions])(implicit ec: ExecutionContext): Future[AddApiKeyResponse]

Restores a deleted API key. Restoring resets the validity attribute to 0. Algolia stores up to 1,000 API keys per application. If you create more, the oldest API keys are deleted and can't be restored.

Restores a deleted API key. Restoring resets the validity attribute to 0. Algolia stores up to 1,000 API keys per application. If you create more, the oldest API keys are deleted and can't be restored.

Required API Key ACLs:

  • admin

Value parameters

key

API key.

Attributes

def saveObject(indexName: String, body: Any, requestOptions: Option[RequestOptions])(implicit ec: ExecutionContext): Future[SaveObjectResponse]

Adds a record to an index or replace it. - If the record doesn't have an object ID, a new record with an auto-generated object ID is added to your index. - If a record with the specified object ID exists, the existing record is replaced. - If a record with the specified object ID doesn't exist, a new record is added to your index. - If you add a record to an index that doesn't exist yet, a new index is created. To update some attributes of a record, use the partial operation. To add, update, or replace multiple records, use the batch operation.

Adds a record to an index or replace it. - If the record doesn't have an object ID, a new record with an auto-generated object ID is added to your index. - If a record with the specified object ID exists, the existing record is replaced. - If a record with the specified object ID doesn't exist, a new record is added to your index. - If you add a record to an index that doesn't exist yet, a new index is created. To update some attributes of a record, use the partial operation. To add, update, or replace multiple records, use the batch operation.

Required API Key ACLs:

  • addObject

Value parameters

body

The record, a schemaless object with attributes that are useful in the context of search and discovery.

indexName

Name of the index on which to perform the operation.

Attributes

def saveRule(indexName: String, objectID: String, rule: Rule, forwardToReplicas: Option[Boolean], requestOptions: Option[RequestOptions])(implicit ec: ExecutionContext): Future[UpdatedRuleResponse]

If a rule with the specified object ID doesn't exist, it's created. Otherwise, the existing rule is replaced. To create or update more than one rule, use the batch operation.

If a rule with the specified object ID doesn't exist, it's created. Otherwise, the existing rule is replaced. To create or update more than one rule, use the batch operation.

Required API Key ACLs:

  • editSettings

Value parameters

forwardToReplicas

Whether changes are applied to replica indices.

indexName

Name of the index on which to perform the operation.

objectID

Unique identifier of a rule object.

Attributes

def saveRules(indexName: String, rules: Seq[Rule], forwardToReplicas: Option[Boolean], clearExistingRules: Option[Boolean], requestOptions: Option[RequestOptions])(implicit ec: ExecutionContext): Future[UpdatedAtResponse]

Create or update multiple rules. If a rule with the specified object ID doesn't exist, Algolia creates a new one. Otherwise, existing rules are replaced.

Create or update multiple rules. If a rule with the specified object ID doesn't exist, Algolia creates a new one. Otherwise, existing rules are replaced.

Required API Key ACLs:

  • editSettings

Value parameters

clearExistingRules

Whether existing rules should be deleted before adding this batch.

forwardToReplicas

Whether changes are applied to replica indices.

indexName

Name of the index on which to perform the operation.

Attributes

def saveSynonym(indexName: String, objectID: String, synonymHit: SynonymHit, forwardToReplicas: Option[Boolean], requestOptions: Option[RequestOptions])(implicit ec: ExecutionContext): Future[SaveSynonymResponse]

If a synonym with the specified object ID doesn't exist, Algolia adds a new one. Otherwise, the existing synonym is replaced. To add multiple synonyms in a single API request, use the batch operation.

If a synonym with the specified object ID doesn't exist, Algolia adds a new one. Otherwise, the existing synonym is replaced. To add multiple synonyms in a single API request, use the batch operation.

Required API Key ACLs:

  • editSettings

Value parameters

forwardToReplicas

Whether changes are applied to replica indices.

indexName

Name of the index on which to perform the operation.

objectID

Unique identifier of a synonym object.

Attributes

def saveSynonyms(indexName: String, synonymHit: Seq[SynonymHit], forwardToReplicas: Option[Boolean], replaceExistingSynonyms: Option[Boolean], requestOptions: Option[RequestOptions])(implicit ec: ExecutionContext): Future[UpdatedAtResponse]

If a synonym with the objectID doesn't exist, Algolia adds a new one. Otherwise, existing synonyms are replaced.

If a synonym with the objectID doesn't exist, Algolia adds a new one. Otherwise, existing synonyms are replaced.

Required API Key ACLs:

  • editSettings

Value parameters

forwardToReplicas

Whether changes are applied to replica indices.

indexName

Name of the index on which to perform the operation.

replaceExistingSynonyms

Whether to replace all synonyms in the index with the ones sent with this request.

Attributes

def search(searchMethodParams: SearchMethodParams, requestOptions: Option[RequestOptions])(implicit ec: ExecutionContext): Future[SearchResponses]

Sends multiple search request to one or more indices. This can be useful in these cases: - Different indices for different purposes, such as, one index for products, another one for marketing content. - Multiple searches to the same index—for example, with different filters.

Sends multiple search request to one or more indices. This can be useful in these cases: - Different indices for different purposes, such as, one index for products, another one for marketing content. - Multiple searches to the same index—for example, with different filters.

Required API Key ACLs:

  • search

Value parameters

searchMethodParams

Muli-search request body. Results are returned in the same order as the requests.

Attributes

def searchDictionaryEntries(dictionaryName: DictionaryType, searchDictionaryEntriesParams: SearchDictionaryEntriesParams, requestOptions: Option[RequestOptions])(implicit ec: ExecutionContext): Future[SearchDictionaryEntriesResponse]

Searches for standard and custom dictionary entries.

Searches for standard and custom dictionary entries.

Required API Key ACLs:

  • settings

Value parameters

dictionaryName

Dictionary type in which to search.

Attributes

def searchForFacetValues(indexName: String, facetName: String, searchForFacetValuesRequest: Option[SearchForFacetValuesRequest], requestOptions: Option[RequestOptions])(implicit ec: ExecutionContext): Future[SearchForFacetValuesResponse]

Searches for values of a specified facet attribute. - By default, facet values are sorted by decreasing count. You can adjust this with the sortFacetValueBy parameter. - Searching for facet values doesn't work if you have more than 65 searchable facets and searchable attributes combined.

Searches for values of a specified facet attribute. - By default, facet values are sorted by decreasing count. You can adjust this with the sortFacetValueBy parameter. - Searching for facet values doesn't work if you have more than 65 searchable facets and searchable attributes combined.

Required API Key ACLs:

  • search

Value parameters

facetName

Facet attribute in which to search for values. This attribute must be included in the attributesForFaceting index setting with the searchable() modifier.

indexName

Name of the index on which to perform the operation.

Attributes

def searchRules(indexName: String, searchRulesParams: Option[SearchRulesParams], requestOptions: Option[RequestOptions])(implicit ec: ExecutionContext): Future[SearchRulesResponse]

Searches for rules in your index.

Searches for rules in your index.

Required API Key ACLs:

  • settings

Value parameters

indexName

Name of the index on which to perform the operation.

Attributes

def searchSingleIndex(indexName: String, searchParams: Option[SearchParams], requestOptions: Option[RequestOptions])(implicit ec: ExecutionContext): Future[SearchResponse]

Searches a single index and return matching search results (hits). This method lets you retrieve up to 1,000 hits. If you need more, use the browse operation or increase the paginatedLimitedTo index setting.

Searches a single index and return matching search results (hits). This method lets you retrieve up to 1,000 hits. If you need more, use the browse operation or increase the paginatedLimitedTo index setting.

Required API Key ACLs:

  • search

Value parameters

indexName

Name of the index on which to perform the operation.

Attributes

def searchSynonyms(indexName: String, searchSynonymsParams: Option[SearchSynonymsParams], requestOptions: Option[RequestOptions])(implicit ec: ExecutionContext): Future[SearchSynonymsResponse]

Searches for synonyms in your index.

Searches for synonyms in your index.

Required API Key ACLs:

  • settings

Value parameters

indexName

Name of the index on which to perform the operation.

searchSynonymsParams

Body of the searchSynonyms operation.

Attributes

def searchUserIds(searchUserIdsParams: SearchUserIdsParams, requestOptions: Option[RequestOptions])(implicit ec: ExecutionContext): Future[SearchUserIdsResponse]

Since it can take a few seconds to get the data from the different clusters, the response isn't real-time. To ensure rapid updates, the user IDs index isn't built at the same time as the mapping. Instead, it's built every 12 hours, at the same time as the update of user ID usage. For example, if you add or move a user ID, the search will show an old value until the next time the mapping is rebuilt (every 12 hours).

Since it can take a few seconds to get the data from the different clusters, the response isn't real-time. To ensure rapid updates, the user IDs index isn't built at the same time as the mapping. Instead, it's built every 12 hours, at the same time as the update of user ID usage. For example, if you add or move a user ID, the search will show an old value until the next time the mapping is rebuilt (every 12 hours).

Required API Key ACLs:

  • admin

Attributes

def setDictionarySettings(dictionarySettingsParams: DictionarySettingsParams, requestOptions: Option[RequestOptions])(implicit ec: ExecutionContext): Future[UpdatedAtResponse]

Turns standard stop word dictionary entries on or off for a given language.

Turns standard stop word dictionary entries on or off for a given language.

Required API Key ACLs:

  • editSettings

Attributes

def setSettings(indexName: String, indexSettings: IndexSettings, forwardToReplicas: Option[Boolean], requestOptions: Option[RequestOptions])(implicit ec: ExecutionContext): Future[UpdatedAtResponse]

Update the specified index settings. Index settings that you don't specify are left unchanged. Specify null to reset a setting to its default value. For best performance, update the index settings before you add new records to your index.

Update the specified index settings. Index settings that you don't specify are left unchanged. Specify null to reset a setting to its default value. For best performance, update the index settings before you add new records to your index.

Required API Key ACLs:

  • editSettings

Value parameters

forwardToReplicas

Whether changes are applied to replica indices.

indexName

Name of the index on which to perform the operation.

Attributes

def updateApiKey(key: String, apiKey: ApiKey, requestOptions: Option[RequestOptions])(implicit ec: ExecutionContext): Future[UpdateApiKeyResponse]

Replaces the permissions of an existing API key. Any unspecified attribute resets that attribute to its default value.

Replaces the permissions of an existing API key. Any unspecified attribute resets that attribute to its default value.

Required API Key ACLs:

  • admin

Value parameters

key

API key.

Attributes

Inherited methods

override def close(): Unit

Attributes

Definition Classes
ApiClient -> AutoCloseable
Inherited from:
ApiClient