Search API (1.0.0)
Download OpenAPI specification:Download
The Algolia Search API lets you search, configure, and mange your indices and records.
Use Algolia's API clients and libraries to reliably integrate Algolia's APIs with your apps. The official API clients are covered by Algolia's Service Level Agreement.
See: Algolia's ecosystem
The base URLs for requests to the Search API are:
https://{APPLICATION_ID}.algolia.net
https://{APPLICATION_ID}-dsn.algolia.net
. If your subscription includes a Distributed Search Network, this ensures that requests are sent to servers closest to users.
Both URLs provide high availability by distributing requests with load balancing.
All requests must use HTTPS.
To guarantee a high availability, implement a retry strategy for all API requests using the URLs of your servers as fallbacks:
https://{APPLICATION_ID}-1.algolianet.com
https://{APPLICATION_ID}-2.algolianet.com
https://{APPLICATION_ID}-3.algolianet.com
These URLs use a different DNS provider than the primary URLs. You should randomize this list to ensure an even load across the three servers.
All Algolia API clients implement this retry strategy.
To authenticate your API requests, add these headers:
x-algolia-application-id
. Your Algolia application ID.x-algolia-api-key
. An API key with the necessary permissions to make the request. The required access control list (ACL) to make a request is listed in each endpoint's reference.
You can find your application ID and API key in the Algolia dashboard.
Depending on the endpoint, request bodies are either JSON objects or arrays of JSON objects,
Parameters are passed as query parameters for GET and DELETE requests, and in the request body for POST and PUT requests.
Query parameters must be URL-encoded.
Non-ASCII characters must be UTF-8 encoded.
Plus characters (+
) are interpreted as spaces.
Arrays as query parameters must be one of:
- A comma-separated string:
attributesToRetrieve=title,description
- A URL-encoded JSON array:
attributesToRetrieve=%5B%22title%22,%22description%22%D
The Search API returns JSON responses. Since JSON doesn't guarantee any specific ordering, don't rely on the order of attributes in the API response.
Successful responses return a 2xx
status. Client errors return a 4xx
status. Server errors are indicated by a 5xx
status.
Error responses have a message
property with more information.
The current version of the Search API is version 1, as indicated by the /1/
in each endpoint's URL.
Manage your indices and index settings.
Indices are copies of your data that are stored on Algolia's servers. They're optimal data structures for fast search and are made up of records and settings.
Delete an index
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.
path Parameters
indexName required | string Example: YourIndexName Name of the index on which to perform the operation. |
Responses
Request samples
- C#
- Dart
- Go
- Java
- JavaScript
- Kotlin
- PHP
- Python
- Ruby
- Scala
- Swift
// Initialize the client var client = new SearchClient(new SearchConfig("YOUR_APP_ID", "YOUR_API_KEY")); // Call the API var response = await client.DeleteIndexAsync("theIndexName");
Response samples
- 200
- 400
- 402
- 403
- 404
{- "taskID": 1514562690001,
- "deletedAt": "2023-06-27T14:42:38.831Z"
}
Retrieve index settings
Retrieves an object with non-null index settings.
path Parameters
indexName required | string Example: YourIndexName Name of the index on which to perform the operation. |
Responses
Request samples
- C#
- Dart
- Go
- Java
- JavaScript
- Kotlin
- PHP
- Python
- Ruby
- Scala
- Swift
// Initialize the client var client = new SearchClient(new SearchConfig("YOUR_APP_ID", "YOUR_API_KEY")); // Call the API var response = await client.GetSettingsAsync("cts_e2e_settings");
Response samples
- 200
- 400
- 402
- 403
- 404
{- "attributesForFaceting": [
- "author",
- "filterOnly(isbn)",
- "searchable(edition)",
- "afterDistinct(category)",
- "afterDistinct(searchable(publisher))"
], - "replicas": [
- "virtual(prod_products_price_asc)",
- "dev_products_replica"
], - "paginationLimitedTo": 100,
- "unretrievableAttributes": [
- "total_sales"
], - "disableTypoToleranceOnWords": [
- "wheel",
- "1X2BCD"
], - "attributesToTransliterate": [
- "name",
- "description"
], - "camelCaseAttributes": [
- "description"
], - "decompoundedAttributes": {
- "de": [
- "name"
]
}, - "indexLanguages": [
- "ja"
], - "disablePrefixOnAttributes": [
- "sku"
], - "allowCompressionOfIntegerArray": false,
- "numericAttributesForFiltering": [
- "equalOnly(quantity)",
- "popularity"
], - "separatorsToIndex": "+#",
- "searchableAttributes": [
- "title,alternative_title",
- "author",
- "unordered(text)",
- "emails.personal"
], - "userData": {
- "settingID": "f2a7b51e3503acc6a39b3784ffb84300",
- "pluginVersion": "1.6.0"
}, - "customNormalization": {
- "default": {
- "ä": "ae",
- "ü": "ue"
}
}, - "attributeForDistinct": "url",
- "attributesToRetrieve": [
- "author",
- "title",
- "content"
], - "ranking": [
- "typo",
- "geo",
- "words",
- "filters",
- "proximity",
- "attribute",
- "exact",
- "custom"
], - "customRanking": [
- "desc(popularity)",
- "asc(price)"
], - "relevancyStrictness": 90,
- "attributesToHighlight": [
- "author",
- "title",
- "conten",
- "content"
], - "attributesToSnippet": [
- "content:80",
- "description"
], - "highlightPreTag": "<em>",
- "highlightPostTag": "</em>",
- "snippetEllipsisText": "…",
- "restrictHighlightAndSnippetArrays": false,
- "hitsPerPage": 20,
- "minWordSizefor1Typo": 4,
- "minWordSizefor2Typos": 8,
- "typoTolerance": true,
- "allowTyposOnNumericTokens": true,
- "disableTypoToleranceOnAttributes": [
- "sku"
], - "ignorePlurals": [
- "ca",
- "es"
], - "removeStopWords": [
- "ca",
- "es"
], - "keepDiacriticsOnCharacters": "øé",
- "queryLanguages": [
- "es"
], - "decompoundQuery": true,
- "enableRules": true,
- "enablePersonalization": false,
- "queryType": "prefixAll",
- "removeWordsIfNoResults": "firstWords",
- "mode": "keywordSearch",
- "semanticSearch": {
- "eventSources": [
- "string"
]
}, - "advancedSyntax": false,
- "optionalWords": [
- "blue",
- "iphone case"
], - "disableExactOnAttributes": [
- "description"
], - "exactOnSingleWordQuery": "attribute",
- "alternativesAsExact": [
- "ignorePlurals",
- "singleWordSynonym"
], - "advancedSyntaxFeatures": [
- "exactPhrase",
- "excludeWords"
], - "distinct": 1,
- "replaceSynonymsInHighlight": false,
- "minProximity": 1,
- "responseFields": [
- "*"
], - "maxFacetHits": 10,
- "maxValuesPerFacet": 100,
- "sortFacetValuesBy": "count",
- "attributeCriteriaComputedByMinProximity": false,
- "renderingContent": {
- "facetOrdering": {
- "facets": {
- "order": [
- "string"
]
}, - "values": {
- "facet1": {
- "order": [
- "string"
], - "sortRemainingBy": "alpha",
- "hide": [
- "string"
]
}, - "facet2": {
- "order": [
- "string"
], - "sortRemainingBy": "alpha",
- "hide": [
- "string"
]
}
}
}, - "redirect": {
- "url": "string"
}
}, - "enableReRanking": true,
- "reRankingApplyFilter": [
- null
]
}
Update index settings
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.
path Parameters
indexName required | string Example: YourIndexName Name of the index on which to perform the operation. |
query Parameters
forwardToReplicas | boolean Whether changes are applied to replica indices. |
Request Body schema: application/jsonrequired
advancedSyntax | boolean Default: false Whether to support phrase matching and excluding words from search queries. Use the |
advancedSyntaxFeatures | Array of strings Default: ["exactPhrase","excludeWords"] Items Enum: "exactPhrase" "excludeWords" Advanced search syntax features you want to support.
This setting only has an effect if |
allowCompressionOfIntegerArray | boolean Default: false Whether arrays with exclusively non-negative integers should be compressed for better performance. If true, the compressed arrays may be reordered. |
allowTyposOnNumericTokens | boolean Default: true Whether to allow typos on numbers in the search query. Turn off this setting to reduce the number of irrelevant matches when searching in large sets of similar numbers. |
alternativesAsExact | Array of strings Default: ["ignorePlurals","singleWordSynonym"] Items Enum: "ignorePlurals" "multiWordsSynonym" "singleWordSynonym" Alternatives of query words that should be considered as exact matches by the Exact ranking criterion.
|
attributeCriteriaComputedByMinProximity | boolean Default: false Whether the best matching attribute should be determined by minimum proximity. This setting only affects ranking if the Attribute ranking criterion comes before Proximity in the |
attributeForDistinct | string Attribute that should be used to establish groups of results. Attribute names are case-sensitive. All records with the same value for this attribute are considered a group.
You can combine If you want to use the same attribute also for faceting, use the |
attributesForFaceting | Array of strings Default: [] Attributes used for faceting. Facets are attributes that let you categorize search results. They can be used for filtering search results. By default, no attribute is used for faceting. Attribute names are case-sensitive. Modifiers
|
attributesToHighlight | Array of strings Attributes to highlight. By default, all searchable attributes are highlighted.
Use With highlighting, strings that match the search query are surrounded by HTML tags defined by For more information, see Highlighting and snippeting. |
attributesToRetrieve | Array of strings Default: ["*"] Attributes to include in the API response. To reduce the size of your response, you can retrieve only some of the attributes. Attribute names are case-sensitive.
|
attributesToSnippet | Array of strings Default: [] Attributes for which to enable snippets. Attribute names are case-sensitive. Snippets provide additional context to matched words.
If you enable snippets, they include 10 words, including the matched word.
The matched word will also be wrapped by HTML tags for highlighting.
You can adjust the number of words with the following notation: |
attributesToTransliterate | Array of strings Attributes, for which you want to support Japanese transliteration. Transliteration supports searching in any of the Japanese writing systems. To support transliteration, you must set the indexing language to Japanese. Attribute names are case-sensitive. |
camelCaseAttributes | Array of strings Default: [] Attributes for which to split camel case words. Attribute names are case-sensitive. |
object Characters and their normalized replacements. This overrides Algolia's default normalization. | |
customRanking | Array of strings Default: [] Attributes to use as custom ranking. Attribute names are case-sensitive. The custom ranking attributes decide which items are shown first if the other ranking criteria are equal. Records with missing values for your selected custom ranking attributes are always sorted last. Boolean attributes are sorted based on their alphabetical order. Modifiers
If you use two or more custom ranking attributes, reduce the precision of your first attributes, or the other attributes will never be applied. |
decompoundedAttributes | object Default: {} Searchable attributes to which Algolia should apply word segmentation (decompounding). Attribute names are case-sensitive. Compound words are formed by combining two or more individual words, and are particularly prevalent in Germanic languages—for example, "firefighter". With decompounding, the individual components are indexed separately. You can specify different lists for different languages.
Decompounding is supported for these languages:
Dutch ( |
decompoundQuery | boolean Default: true Whether to split compound words into their building blocks. For more information, see Word segmentation. Word segmentation is supported for these languages: German, Dutch, Finnish, Swedish, and Norwegian. |
disableExactOnAttributes | Array of strings Default: [] Searchable attributes for which you want to turn off the Exact ranking criterion. Attribute names are case-sensitive. This can be useful for attributes with long values, where the likelyhood of an exact match is high, such as product descriptions. Turning off the Exact ranking criterion for these attributes favors exact matching on other attributes. This reduces the impact of individual attributes with a lot of content on ranking. |
disablePrefixOnAttributes | Array of strings Default: [] Searchable attributes for which you want to turn off prefix matching. Attribute names are case-sensitive. |
disableTypoToleranceOnAttributes | Array of strings Default: [] Attributes for which you want to turn off typo tolerance. Attribute names are case-sensitive. Returning only exact matches can help when:
Consider alternatives such as |
disableTypoToleranceOnWords | Array of strings Default: [] Words for which you want to turn off typo tolerance. This also turns off word splitting and concatenation for the specified words. |
boolean or integer Determines how many records of a group are included in the search results. Records with the same value for the The | |
enablePersonalization | boolean Default: false Whether to enable Personalization. |
enableReRanking | boolean Default: true Whether this search will use Dynamic Re-Ranking. This setting only has an effect if you activated Dynamic Re-Ranking for this index in the Algolia dashboard. |
enableRules | boolean Default: true Whether to enable rules. |
exactOnSingleWordQuery | string Default: "attribute" Enum: "attribute" "none" "word" Determines how the Exact ranking criterion is computed when the search query has only one word.
|
highlightPostTag | string Default: "</em>" HTML tag to insert after the highlighted parts in all highlighted results and snippets. |
highlightPreTag | string Default: "<em>" HTML tag to insert before the highlighted parts in all highlighted results and snippets. |
hitsPerPage | integer [ 1 .. 1000 ] Default: 20 Number of hits per page. |
Array of supportedLanguage (strings) or boolean Treat singular, plurals, and other forms of declensions as equivalent. You should only use this feature for the languages used in your index. | |
indexLanguages | Array of strings Default: [] Items Enum: "af" "ar" "az" "bg" "bn" "ca" "cs" "cy" "da" "de" "el" "en" "eo" "es" "et" "eu" "fa" "fi" "fo" "fr" "ga" "gl" "he" "hi" "hu" "hy" "id" "is" "it" "ja" "ka" "kk" "ko" "ku" "ky" "lt" "lv" "mi" "mn" "mr" "ms" "mt" "nb" "nl" "no" "ns" "pl" "ps" "pt" "pt-br" "qu" "ro" "ru" "sk" "sq" "sv" "sw" "ta" "te" "th" "tl" "tn" "tr" "tt" "uk" "ur" "uz" "zh" Languages for language-specific processing steps, such as word detection and dictionary settings. You should always specify an indexing language.
If you don't specify an indexing language, the search engine uses all supported languages,
or the languages you specified with the |
keepDiacriticsOnCharacters | string Default: "" Characters for which diacritics should be preserved. By default, Algolia removes diacritics from letters.
For example, |
maxFacetHits | integer <= 100 Default: 10 Maximum number of facet values to return when searching for facet values. |
maxValuesPerFacet | integer <= 1000 Default: 100 Maximum number of facet values to return for each facet. |
minProximity | integer [ 1 .. 7 ] Default: 1 Minimum proximity score for two matching words. This adjusts the Proximity ranking criterion by equally scoring matches that are farther apart. For example, if |
minWordSizefor1Typo | integer Default: 4 Minimum number of characters a word in the search query must contain to accept matches with one typo. |
minWordSizefor2Typos | integer Default: 8 Minimum number of characters a word in the search query must contain to accept matches with two typos. |
mode | string Default: "keywordSearch" Enum: "keywordSearch" "neuralSearch" Search mode the index will use to query for results. This setting only applies to indices, for which Algolia enabled NeuralSearch for you. |
numericAttributesForFiltering | Array of strings Default: [] Numeric attributes that can be used as numerical filters. Attribute names are case-sensitive. By default, all numeric attributes are available as numerical filters. For faster indexing, reduce the number of numeric attributes. If you want to turn off filtering for all numeric attributes, specifiy an attribute that doesn't exist in your index, such as Modifier
|
optionalWords | Array of strings Default: [] Words that should be considered optional when found in the query. By default, records must match all words in the search query to be included in the search results. Adding optional words can help to increase the number of search results by running an additional search query that doesn't include the optional words. For example, if the search query is "action video" and "video" is an optional word, the search engine runs two queries. One for "action video" and one for "action". Records that match all words are ranked higher. For a search query with 4 or more words and all its words are optional, the number of matched words required for a record to be included in the search results increases for every 1,000 records:
For more information, see Optional words. |
paginationLimitedTo | integer <= 20000 Default: 1000 Maximum number of search results that can be obtained through pagination. Higher pagination limits might slow down your search. For pagination limits above 1,000, the sorting of results beyond the 1,000th hit can't be guaranteed. |
queryLanguages | Array of strings Default: [] Items Enum: "af" "ar" "az" "bg" "bn" "ca" "cs" "cy" "da" "de" "el" "en" "eo" "es" "et" "eu" "fa" "fi" "fo" "fr" "ga" "gl" "he" "hi" "hu" "hy" "id" "is" "it" "ja" "ka" "kk" "ko" "ku" "ky" "lt" "lv" "mi" "mn" "mr" "ms" "mt" "nb" "nl" "no" "ns" "pl" "ps" "pt" "pt-br" "qu" "ro" "ru" "sk" "sq" "sv" "sw" "ta" "te" "th" "tl" "tn" "tr" "tt" "uk" "ur" "uz" "zh" Languages for language-specific query processing steps such as plurals, stop-word removal, and word-detection dictionaries. This setting sets a default list of languages used by the You should always specify a query language.
If you don't specify an indexing language, the search engine uses all supported languages,
or the languages you specified with the |
queryType | string Default: "prefixLast" Enum: "prefixAll" "prefixLast" "prefixNone" Determines if and how query words are interpreted as prefixes. By default, only the last query word is treated as prefix ( For more information, see Prefix searching. |
ranking | Array of strings Default: ["typo","geo","words","filters","proximity","attribute","exact","custom"] Determines the order in which Algolia returns your results. By default, each entry corresponds to a ranking criteria. The tie-breaking algorithm sequentially applies each criterion in the order they're specified. If you configure a replica index for sorting by an attribute, you put the sorting attribute at the top of the list. Modifiers
Before you modify the default setting, you should test your changes in the dashboard, and by A/B testing. |
relevancyStrictness | integer Default: 100 Relevancy threshold below which less relevant results aren't included in the results. You can only set |
Array of supportedLanguage (strings) or boolean Removes stop words from the search query. Stop words are common words like articles, conjunctions, prepositions, or pronouns that have little or no meaning on their own. In English, "the", "a", or "and" are stop words. You should only use this feature for the languages used in your index. | |
removeWordsIfNoResults | string Default: "none" Enum: "allOptional" "firstWords" "lastWords" "none" Strategy for removing words from the query when it doesn't return any results. This helps to avoid returning empty search results.
For more information, see Remove words to improve results. |
object Extra data that can be used in the search UI. You can use this to control aspects of your search UI, such as, the order of facet names and values without changing your frontend code. | |
replaceSynonymsInHighlight | boolean Default: false Whether to replace a highlighted word with the matched synonym. By default, the original words are highlighted even if a synonym matches.
For example, with With |
replicas | Array of strings Default: [] Creates replica indices. Replicas are copies of a primary index with the same records but different settings, synonyms, or rules. If you want to offer a different ranking or sorting of your search results, you'll use replica indices. All index operations on a primary index are automatically forwarded to its replicas. To add a replica index, you must provide the complete set of replicas to this parameter. If you omit a replica from this list, the replica turns into a regular, standalone index that will no longer by synced with the primary index. Modifier
|
(reRankingApplyFilter (Array of reRankingApplyFilter (any) or reRankingApplyFilter (string))) or null | |
responseFields | Array of strings Default: ["*"] Properties to include in the API response of By default, all response properties are included. To reduce the response size, you can select, which attributes should be included. You can't exclude these properties:
Don't exclude properties that you might need in your search UI. |
restrictHighlightAndSnippetArrays | boolean Default: false Whether to restrict highlighting and snippeting to items that at least partially matched the search query. By default, all items are highlighted and snippeted. |
searchableAttributes | Array of strings Default: [] Attributes used for searching. Attribute names are case-sensitive. By default, all attributes are searchable and the Attribute ranking criterion is turned off.
With a non-empty list, Algolia only returns results with matches in the selected attributes.
In addition, the Attribute ranking criterion is turned on: matches in attributes that are higher in the list of For more information, see Searchable attributes. Modifier
Without modifier, matches at the beginning of an attribute rank higer than matches at the end. |
object Settings for the semantic search part of NeuralSearch.
Only used when | |
separatorsToIndex | string Default: "" Controls which separators are indexed. Separators are all non-letter characters except spaces and currency characters, such as $€£¥.
By default, separator characters aren't indexed.
With |
snippetEllipsisText | string Default: "…" String used as an ellipsis indicator when a snippet is truncated. |
sortFacetValuesBy | string Default: "count" Order in which to retrieve facet values.
This setting doesn't influence how facet values are displayed in your UI (see |
boolean or typo tolerance (string) Whether typo tolerance is enabled and how it is applied. If typo tolerance is true, | |
unretrievableAttributes | Array of strings Default: [] Attributes that can't be retrieved at query time. This can be useful if you want to use an attribute for ranking or to restrict access, but don't want to include it in the search results. Attribute names are case-sensitive. |
userData | object Default: {} An object with custom data. You can store up to 32kB as custom data. |
Responses
Request samples
- C#
- Dart
- Go
- Java
- JavaScript
- Kotlin
- PHP
- Python
- Ruby
- Scala
- Swift
// Initialize the client var client = new SearchClient(new SearchConfig("YOUR_APP_ID", "YOUR_API_KEY")); // Call the API var response = await client.SetSettingsAsync( "<YOUR_INDEX_NAME>", new IndexSettings { AttributesForFaceting = new List<string> { "actor", "filterOnly(category)", "searchable(publisher)" }, } );
Response samples
- 200
- 400
- 402
- 403
- 404
{- "taskID": 1514562690001,
- "updatedAt": "2023-07-04T12:49:15Z"
}
Check task 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.
path Parameters
indexName required | string Example: YourIndexName Name of the index on which to perform the operation. |
taskID required | integer <int64> Example: 1506303845001 Unique task identifier. |
Responses
Request samples
- C#
- Dart
- Go
- Java
- JavaScript
- Kotlin
- PHP
- Python
- Ruby
- Scala
- Swift
// Initialize the client var client = new SearchClient(new SearchConfig("YOUR_APP_ID", "YOUR_API_KEY")); // Call the API var response = await client.GetTaskAsync("theIndexName", 123L);
Response samples
- 200
- 400
- 402
- 403
- 404
{- "status": "notPublished"
}
Copy or move an index
Copies or moves (renames) an index within the same Algolia application.
- Existing destination indices are overwritten, except for their 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
, andreplicas
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.
path Parameters
indexName required | string Example: YourIndexName Name of the index on which to perform the operation. |
Request Body schema: application/jsonrequired
destination required | string Index name (case-sensitive). |
operation required | string Enum: "copy" "move" Operation to perform on the index. |
scope | Array of strings Items Enum: "rules" "settings" "synonyms" Only for copying. If you specify a scope, only the selected scopes are copied. Records and the other scopes are left unchanged.
If you omit the |
Responses
Request samples
- C#
- Dart
- Go
- Java
- JavaScript
- Kotlin
- PHP
- Python
- Ruby
- Scala
- Swift
// Initialize the client var client = new SearchClient(new SearchConfig("YOUR_APP_ID", "YOUR_API_KEY")); // Call the API var response = await client.OperationIndexAsync( "<SOURCE_INDEX_NAME>", new OperationIndexParams { Operation = Enum.Parse<OperationType>("Move"), Destination = "<DESTINATION_INDEX_NAME>", Scope = new List<ScopeType> { Enum.Parse<ScopeType>("Rules"), Enum.Parse<ScopeType>("Settings") }, } );
Response samples
- 200
- 400
- 402
- 403
- 404
{- "taskID": 1514562690001,
- "updatedAt": "2023-07-04T12:49:15Z"
}
List indices
Lists all indices in the current Algolia application.
The request follows any index restrictions of the API key you use to make the request.
query Parameters
hitsPerPage | integer Default: 100 Number of hits per page. |
integer or null Default: null Requested page of the API response.
If |
Responses
Request samples
- C#
- Dart
- Go
- Java
- JavaScript
- Kotlin
- PHP
- Python
- Ruby
- Scala
- Swift
// Initialize the client var client = new SearchClient(new SearchConfig("YOUR_APP_ID", "YOUR_API_KEY")); // Call the API var response = await client.ListIndicesAsync();
Response samples
- 200
- 400
- 402
- 403
- 404
{- "items": [
- {
- "name": "movies",
- "createdAt": "2022-09-19T16:36:44.471Z",
- "updatedAt": "2023-07-04T12:49:15Z",
- "entries": 100,
- "dataSize": 48450,
- "fileSize": 112927,
- "lastBuildTimeS": 3,
- "numberOfPendingTasks": 0,
- "pendingTask": false,
- "primary": "T02",
- "replicas": [
- "T02_push",
- "T2replica"
], - "virtual": true
}
], - "nbPages": 100
}
Add, update, and delete records from your indices.
Records are individual items in your index. When they match a search query, they're returned as search results, in the order determined by your ranking. Records are schemaless JSON objects.
Add or replace a record
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.
path Parameters
indexName required | string Example: YourIndexName Name of the index on which to perform the operation. |
Request Body schema: application/jsonrequired
The record, a schemaless object with attributes that are useful in the context of search and discovery.
Responses
Request samples
- C#
- Dart
- Go
- Java
- JavaScript
- Kotlin
- PHP
- Python
- Ruby
- Scala
- Swift
// Initialize the client var client = new SearchClient(new SearchConfig("YOUR_APP_ID", "YOUR_API_KEY")); // Call the API var response = await client.SaveObjectAsync( "<YOUR_INDEX_NAME>", new Dictionary<string, string> { { "objectID", "id" }, { "test", "val" } } );
Response samples
- 201
- 400
- 402
- 403
- 404
{- "createdAt": "2023-07-04T12:49:15Z",
- "taskID": 1514562690001,
- "objectID": "test-record-123"
}
Retrieve a record
Retrieves one record by its object ID.
To retrieve more than one record, use the objects
operation.
path Parameters
indexName required | string Example: YourIndexName Name of the index on which to perform the operation. |
objectID required | string Example: test-record-123 Unique record identifier. |
query Parameters
attributesToRetrieve | Array of strings 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.
Attributes included in |
Responses
Request samples
- C#
- Dart
- Go
- Java
- JavaScript
- Kotlin
- PHP
- Python
- Ruby
- Scala
- Swift
// Initialize the client var client = new SearchClient(new SearchConfig("YOUR_APP_ID", "YOUR_API_KEY")); // Call the API var response = await client.GetObjectAsync( "theIndexName", "uniqueID", new List<string> { "attr1", "attr2" } );
Response samples
- 200
- 400
- 402
- 403
- 404
{- "property1": "string",
- "property2": "string"
}
Add or replace a record
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.
path Parameters
indexName required | string Example: YourIndexName Name of the index on which to perform the operation. |
objectID required | string Example: test-record-123 Unique record identifier. |
Request Body schema: application/jsonrequired
The record, a schemaless object with attributes that are useful in the context of search and discovery.
Responses
Request samples
- C#
- Dart
- Go
- Java
- JavaScript
- Kotlin
- PHP
- Python
- Ruby
- Scala
- Swift
// Initialize the client var client = new SearchClient(new SearchConfig("YOUR_APP_ID", "YOUR_API_KEY")); // Call the API var response = await client.AddOrUpdateObjectAsync( "indexName", "uniqueID", new Dictionary<string, string> { { "key", "value" } } );
Response samples
- 200
- 400
- 402
- 403
- 404
{- "taskID": 1514562690001,
- "updatedAt": "2023-07-04T12:49:15Z",
- "objectID": "test-record-123"
}
Delete a record
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.
path Parameters
indexName required | string Example: YourIndexName Name of the index on which to perform the operation. |
objectID required | string Example: test-record-123 Unique record identifier. |
Responses
Request samples
- C#
- Dart
- Go
- Java
- JavaScript
- Kotlin
- PHP
- Python
- Ruby
- Scala
- Swift
// Initialize the client var client = new SearchClient(new SearchConfig("YOUR_APP_ID", "YOUR_API_KEY")); // Call the API var response = await client.DeleteObjectAsync("<YOUR_INDEX_NAME>", "uniqueID");
Response samples
- 200
- 400
- 402
- 403
- 404
{- "taskID": 1514562690001,
- "deletedAt": "2023-06-27T14:42:38.831Z"
}
Delete records matching a query
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.
path Parameters
indexName required | string Example: YourIndexName Name of the index on which to perform the operation. |
Request Body schema: application/jsonrequired
aroundLatLng | string Default: "" Coordinates for the center of a circle, expressed as a comma-separated string of latitude and longitude. Only records included within circle around this central location are included in the results.
The radius of the circle is determined by the |
integer or all (string) Maximum radius for a search around a central location. This parameter works in combination with the | |
Array of facetFilters (any) or string Filter the search by facet values, so that only records with the same facet values are retrieved. Prefer using the
While it's best to avoid attributes that start with a | |
filters | string Filter expression to only include items that match the filter criteria in the response. You can use these filter expressions:
You can combine filters with
Use quotes around your filters, if the facet attribute name or facet value has spaces, keywords ( For more information, see Filters. |
insideBoundingBox | Array of numbers[ items <double > = 4 items [ items <double > ] ] Coordinates for a rectangular area in which to search. Each bounding box is defined by the two opposite points of its diagonal, and expressed as latitude and longitude pair:
|
insidePolygon | Array of numbers[ items <double > [ 6 .. 20000 ] items [ items <double > ] ] Coordinates of a polygon in which to search. Polygons are defined by 3 to 10,000 points. Each point is represented by its latitude and longitude.
Provide multiple polygons as nested arrays.
For more information, see filtering inside polygons.
This parameter is ignored if you also specify |
Array of numericFilters (any) or string Filter by numeric facets. Prefer using the You can use numeric comparison operators: | |
Array of tagFilters (any) or string Filter the search by values of the special Prefer using the Different from regular facets, |
Responses
Request samples
- C#
- Dart
- Go
- Java
- JavaScript
- Kotlin
- PHP
- Python
- Ruby
- Scala
- Swift
// Initialize the client var client = new SearchClient(new SearchConfig("YOUR_APP_ID", "YOUR_API_KEY")); // Call the API var response = await client.DeleteByAsync( "theIndexName", new DeleteByParams { Filters = "brand:brandName", } );
Response samples
- 200
- 400
- 402
- 403
- 404
{- "taskID": 1514562690001,
- "deletedAt": "2023-06-27T14:42:38.831Z"
}
Delete all records from an index
Deletes only the records from an index while keeping settings, synonyms, and rules.
path Parameters
indexName required | string Example: YourIndexName Name of the index on which to perform the operation. |
Responses
Request samples
- C#
- Dart
- Go
- Java
- JavaScript
- Kotlin
- PHP
- Python
- Ruby
- Scala
- Swift
// Initialize the client var client = new SearchClient(new SearchConfig("YOUR_APP_ID", "YOUR_API_KEY")); // Call the API var response = await client.ClearObjectsAsync("theIndexName");
Response samples
- 200
- 400
- 402
- 403
- 404
{- "taskID": 1514562690001,
- "updatedAt": "2023-07-04T12:49:15Z"
}
Add or update attributes
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.
path Parameters
indexName required | string Example: YourIndexName Name of the index on which to perform the operation. |
objectID required | string Example: test-record-123 Unique record identifier. |
query Parameters
createIfNotExists | boolean Default: true Whether to create a new record if it doesn't exist. |
Request Body schema: application/jsonrequired
Attributes with their values.
additional property | attribute (string) or builtInOperation (object) |
One of string Value of the attribute to update. |
Responses
Request samples
- C#
- Dart
- Go
- Java
- JavaScript
- Kotlin
- PHP
- Python
- Ruby
- Scala
- Swift
// Initialize the client var client = new SearchClient(new SearchConfig("YOUR_APP_ID", "YOUR_API_KEY")); // Call the API var response = await client.PartialUpdateObjectAsync( "theIndexName", "uniqueID", new Dictionary<string, AttributeToUpdate> { { "id1", new AttributeToUpdate("test") }, { "id2", new AttributeToUpdate( new BuiltInOperation { Operation = Enum.Parse<BuiltInOperationType>("AddUnique"), Value = "test2", } ) } }, true );
Response samples
- 200
- 400
- 402
- 403
- 404
{- "taskID": 1514562690001,
- "updatedAt": "2023-07-04T12:49:15Z",
- "objectID": "test-record-123"
}
Batch indexing operations on one index
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.
path Parameters
indexName required | string Example: YourIndexName Name of the index on which to perform the operation. |
Request Body schema: application/jsonrequired
required | Array of objects | ||||
Array
|
Responses
Request samples
- C#
- Dart
- Go
- Java
- JavaScript
- Kotlin
- PHP
- Python
- Ruby
- Scala
- Swift
// Initialize the client var client = new SearchClient(new SearchConfig("YOUR_APP_ID", "YOUR_API_KEY")); // Call the API var response = await client.BatchAsync( "<YOUR_INDEX_NAME>", new BatchWriteParams { Requests = new List<BatchRequest> { new BatchRequest { Action = Enum.Parse<Action>("AddObject"), Body = new Dictionary<string, string> { { "key", "bar" }, { "foo", "1" } }, }, new BatchRequest { Action = Enum.Parse<Action>("AddObject"), Body = new Dictionary<string, string> { { "key", "baz" }, { "foo", "2" } }, } }, } );
Response samples
- 200
- 400
- 402
- 403
- 404
{- "taskID": 1514562690001,
- "objectIDs": [
- "record-1",
- "record-2"
]
}
Batch indexing operations on multiple indices
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.
Request Body schema: application/jsonrequired
required | Array of objects | ||||||
Array
|
Responses
Request samples
- C#
- Dart
- Go
- Java
- JavaScript
- Kotlin
- PHP
- Python
- Ruby
- Scala
- Swift
// Initialize the client var client = new SearchClient(new SearchConfig("YOUR_APP_ID", "YOUR_API_KEY")); // Call the API var response = await client.MultipleBatchAsync( new BatchParams { Requests = new List<MultipleBatchRequest> { new MultipleBatchRequest { Action = Enum.Parse<Action>("AddObject"), Body = new Dictionary<string, string> { { "key", "value" } }, IndexName = "theIndexName", } }, } );
Response samples
- 200
- 400
- 402
- 403
- 404
{- "taskID": {
- "property1": 1514562690001,
- "property2": 1514562690001
}, - "objectIDs": [
- "record-1",
- "record-2"
]
}
Retrieve records
Retrieves one or more records, potentially from different indices.
Records are returned in the same order as the requests.
Request Body schema: application/jsonrequired
Request object.
required | Array of objects | ||||||
Array
|
Responses
Request samples
- C#
- Dart
- Go
- Java
- JavaScript
- Kotlin
- PHP
- Python
- Ruby
- Scala
- Swift
// Initialize the client var client = new SearchClient(new SearchConfig("YOUR_APP_ID", "YOUR_API_KEY")); // Call the API var response = await client.GetObjectsAsync<Object>( new GetObjectsParams { Requests = new List<GetObjectsRequest> { new GetObjectsRequest { AttributesToRetrieve = new List<string> { "attr1", "attr2" }, ObjectID = "uniqueID", IndexName = "theIndexName", } }, } );
Response samples
- 200
- 400
- 402
- 403
- 404
{- "results": [
- { }
]
}
Search an index
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.
path Parameters
indexName required | string Example: YourIndexName Name of the index on which to perform the operation. |
Request Body schema: application/json
params | string Default: "" Search parameters as a URL-encoded query string. |
Responses
Request samples
- C#
- Dart
- Go
- Java
- JavaScript
- Kotlin
- PHP
- Python
- Ruby
- Scala
- Swift
// Initialize the client var client = new SearchClient(new SearchConfig("YOUR_APP_ID", "YOUR_API_KEY")); // Call the API var response = await client.SearchSingleIndexAsync<Object>("indexName");
Response samples
- 200
- 400
- 402
- 403
- 404
{- "abTestID": 0,
- "abTestVariantID": 1,
- "aroundLatLng": "40.71,-74.01",
- "automaticRadius": "string",
- "exhaustive": {
- "facetsCount": true,
- "facetValues": true,
- "nbHits": true,
- "rulesMatch": true,
- "typo": true
}, - "exhaustiveFacetsCount": true,
- "exhaustiveNbHits": true,
- "exhaustiveTypo": true,
- "facets": {
- "category": {
- "food": 1,
- "tech": 42
}
}, - "facets_stats": {
- "property1": {
- "min": 0.1,
- "max": 0.1,
- "avg": 0.1,
- "sum": 0.1
}, - "property2": {
- "min": 0.1,
- "max": 0.1,
- "avg": 0.1,
- "sum": 0.1
}
}, - "hitsPerPage": 20,
- "index": "indexName",
- "indexUsed": "indexNameAlt",
- "message": "string",
- "nbHits": 20,
- "nbPages": 1,
- "nbSortedHits": 20,
- "page": 0,
- "parsedQuery": "george clo",
- "processingTimeMS": 20,
- "processingTimingsMS": { },
- "queryAfterRemoval": "string",
- "redirect": {
- "index": [
- {
- "source": "string",
- "dest": "string",
- "reason": "string",
- "succeed": true,
- "data": {
- "ruleObjectID": "string"
}
}
]
}, - "renderingContent": {
- "facetOrdering": {
- "facets": {
- "order": [
- "string"
]
}, - "values": {
- "facet1": {
- "order": [
- "string"
], - "sortRemainingBy": "alpha",
- "hide": [
- "string"
]
}, - "facet2": {
- "order": [
- "string"
], - "sortRemainingBy": "alpha",
- "hide": [
- "string"
]
}
}
}, - "redirect": {
- "url": "string"
}
}, - "serverTimeMS": 20,
- "serverUsed": "c2-uk-3.algolia.net",
- "userData": {
- "settingID": "f2a7b51e3503acc6a39b3784ffb84300",
- "pluginVersion": "1.6.0"
}, - "queryID": "a00dbc80a8d13c4565a442e7e2dca80a",
- "hits": [
- {
- "objectID": "test-record-123",
- "_highlightResult": {
- "attribute1": {
- "value": "<em>George</em> <em>Clo</em>oney",
- "matchLevel": "full",
- "matchedWords": [
- "action"
], - "fullyHighlighted": true
}, - "attribute2": {
- "value": "<em>George</em> <em>Clo</em>oney",
- "matchLevel": "full",
- "matchedWords": [
- "action"
], - "fullyHighlighted": true
}
}, - "_snippetResult": {
- "attribute1": {
- "value": "<em>George</em> <em>Clo</em>oney",
- "matchLevel": "full"
}, - "attribute2": {
- "value": "<em>George</em> <em>Clo</em>oney",
- "matchLevel": "full"
}
}, - "_rankingInfo": {
- "filters": 0,
- "firstMatchedWord": 0,
- "geoDistance": 0,
- "geoPrecision": 1,
- "matchedGeoLocation": {
- "lat": 0.1,
- "lng": 0.1,
- "distance": 0
}, - "personalization": {
- "filtersScore": 0,
- "rankingScore": 0,
- "score": 0
}, - "nbExactWords": 0,
- "nbTypos": 0,
- "promoted": true,
- "proximityDistance": 0,
- "userScore": 0,
- "words": 1,
- "promotedByReRanking": true
}, - "_distinctSeqID": 0
}
], - "query": "",
- "params": "query=a&hitsPerPage=20"
}
Search multiple indices
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.
Request Body schema: application/jsonrequired
Muli-search request body. Results are returned in the same order as the requests.
required | Array of (SearchForHits (Search parameters as query string (object) or Search parameters as object (object))) or (SearchForFacets (Search parameters as query string (object) or Search parameters as object (object))) |
strategy | string Enum: "none" "stopIfEnoughMatches" Strategy for multiple search queries:
|
Responses
Request samples
- C#
- Dart
- Go
- Java
- JavaScript
- Kotlin
- PHP
- Python
- Ruby
- Scala
- Swift
// Initialize the client var client = new SearchClient(new SearchConfig("YOUR_APP_ID", "YOUR_API_KEY")); // Call the API var response = await client.SearchAsync<Object>( new SearchMethodParams { Requests = new List<SearchQuery> { new SearchQuery( new SearchForHits { IndexName = "<YOUR_INDEX_NAME>", Query = "<YOUR_QUERY>", HitsPerPage = 50, } ) }, } );
Response samples
- 200
- 400
- 402
- 403
- 404
{- "results": [
- {
- "abTestID": 0,
- "abTestVariantID": 1,
- "aroundLatLng": "40.71,-74.01",
- "automaticRadius": "string",
- "exhaustive": {
- "facetsCount": true,
- "facetValues": true,
- "nbHits": true,
- "rulesMatch": true,
- "typo": true
}, - "exhaustiveFacetsCount": true,
- "exhaustiveNbHits": true,
- "exhaustiveTypo": true,
- "facets": {
- "category": {
- "food": 1,
- "tech": 42
}
}, - "facets_stats": {
- "property1": {
- "min": 0.1,
- "max": 0.1,
- "avg": 0.1,
- "sum": 0.1
}, - "property2": {
- "min": 0.1,
- "max": 0.1,
- "avg": 0.1,
- "sum": 0.1
}
}, - "hitsPerPage": 20,
- "index": "indexName",
- "indexUsed": "indexNameAlt",
- "message": "string",
- "nbHits": 20,
- "nbPages": 1,
- "nbSortedHits": 20,
- "page": 0,
- "parsedQuery": "george clo",
- "processingTimeMS": 20,
- "processingTimingsMS": { },
- "queryAfterRemoval": "string",
- "redirect": {
- "index": [
- {
- "source": "string",
- "dest": "string",
- "reason": "string",
- "succeed": true,
- "data": {
- "ruleObjectID": "string"
}
}
]
}, - "renderingContent": {
- "facetOrdering": {
- "facets": {
- "order": [
- "string"
]
}, - "values": {
- "facet1": {
- "order": [
- "string"
], - "sortRemainingBy": "alpha",
- "hide": [
- "string"
]
}, - "facet2": {
- "order": [
- "string"
], - "sortRemainingBy": "alpha",
- "hide": [
- "string"
]
}
}
}, - "redirect": {
- "url": "string"
}
}, - "serverTimeMS": 20,
- "serverUsed": "c2-uk-3.algolia.net",
- "userData": {
- "settingID": "f2a7b51e3503acc6a39b3784ffb84300",
- "pluginVersion": "1.6.0"
}, - "queryID": "a00dbc80a8d13c4565a442e7e2dca80a",
- "hits": [
- {
- "objectID": "test-record-123",
- "_highlightResult": {
- "attribute1": {
- "value": "<em>George</em> <em>Clo</em>oney",
- "matchLevel": "full",
- "matchedWords": [
- "action"
], - "fullyHighlighted": true
}, - "attribute2": {
- "value": "<em>George</em> <em>Clo</em>oney",
- "matchLevel": "full",
- "matchedWords": [
- "action"
], - "fullyHighlighted": true
}
}, - "_snippetResult": {
- "attribute1": {
- "value": "<em>George</em> <em>Clo</em>oney",
- "matchLevel": "full"
}, - "attribute2": {
- "value": "<em>George</em> <em>Clo</em>oney",
- "matchLevel": "full"
}
}, - "_rankingInfo": {
- "filters": 0,
- "firstMatchedWord": 0,
- "geoDistance": 0,
- "geoPrecision": 1,
- "matchedGeoLocation": {
- "lat": 0.1,
- "lng": 0.1,
- "distance": 0
}, - "personalization": {
- "filtersScore": 0,
- "rankingScore": 0,
- "score": 0
}, - "nbExactWords": 0,
- "nbTypos": 0,
- "promoted": true,
- "proximityDistance": 0,
- "userScore": 0,
- "words": 1,
- "promotedByReRanking": true
}, - "_distinctSeqID": 0
}
], - "query": "",
- "params": "query=a&hitsPerPage=20"
}
]
}
Search for facet values
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.
path Parameters
facetName required | string Facet attribute in which to search for values. This attribute must be included in the |
indexName required | string Example: YourIndexName Name of the index on which to perform the operation. |
Request Body schema: application/json
facetQuery | string Default: "" Text to search inside the facet's values. |
maxFacetHits | integer <= 100 Default: 10 Maximum number of facet values to return when searching for facet values. |
params | string Default: "" Search parameters as a URL-encoded query string. |
Responses
Request samples
- C#
- Dart
- Go
- Java
- JavaScript
- Kotlin
- PHP
- Python
- Ruby
- Scala
- Swift
// Initialize the client var client = new SearchClient(new SearchConfig("YOUR_APP_ID", "YOUR_API_KEY")); // Call the API var response = await client.SearchForFacetValuesAsync("indexName", "facetName");
Response samples
- 200
- 400
- 402
- 403
- 404
{- "facetHits": [
- {
- "value": "Mobile phone",
- "highlighted": "<em>George</em> <em>Clo</em>oney",
- "count": 0
}
], - "exhaustiveFacetsCount": true,
- "processingTimeMS": 20
}
Browse for records
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.
path Parameters
indexName required | string Example: YourIndexName Name of the index on which to perform the operation. |
Request Body schema: application/json
params | string Default: "" Search parameters as a URL-encoded query string. |
Responses
Request samples
- C#
- Dart
- Go
- Java
- JavaScript
- Kotlin
- PHP
- Python
- Ruby
- Scala
- Swift
// Initialize the client var client = new SearchClient(new SearchConfig("YOUR_APP_ID", "YOUR_API_KEY")); // Call the API var response = await client.BrowseAsync<Object>("cts_e2e_browse");
Response samples
- 200
- 400
- 402
- 403
- 404
{- "abTestID": 0,
- "abTestVariantID": 1,
- "aroundLatLng": "40.71,-74.01",
- "automaticRadius": "string",
- "exhaustive": {
- "facetsCount": true,
- "facetValues": true,
- "nbHits": true,
- "rulesMatch": true,
- "typo": true
}, - "exhaustiveFacetsCount": true,
- "exhaustiveNbHits": true,
- "exhaustiveTypo": true,
- "facets": {
- "category": {
- "food": 1,
- "tech": 42
}
}, - "facets_stats": {
- "property1": {
- "min": 0.1,
- "max": 0.1,
- "avg": 0.1,
- "sum": 0.1
}, - "property2": {
- "min": 0.1,
- "max": 0.1,
- "avg": 0.1,
- "sum": 0.1
}
}, - "hitsPerPage": 20,
- "index": "indexName",
- "indexUsed": "indexNameAlt",
- "message": "string",
- "nbHits": 20,
- "nbPages": 1,
- "nbSortedHits": 20,
- "page": 0,
- "parsedQuery": "george clo",
- "processingTimeMS": 20,
- "processingTimingsMS": { },
- "queryAfterRemoval": "string",
- "redirect": {
- "index": [
- {
- "source": "string",
- "dest": "string",
- "reason": "string",
- "succeed": true,
- "data": {
- "ruleObjectID": "string"
}
}
]
}, - "renderingContent": {
- "facetOrdering": {
- "facets": {
- "order": [
- "string"
]
}, - "values": {
- "facet1": {
- "order": [
- "string"
], - "sortRemainingBy": "alpha",
- "hide": [
- "string"
]
}, - "facet2": {
- "order": [
- "string"
], - "sortRemainingBy": "alpha",
- "hide": [
- "string"
]
}
}
}, - "redirect": {
- "url": "string"
}
}, - "serverTimeMS": 20,
- "serverUsed": "c2-uk-3.algolia.net",
- "userData": {
- "settingID": "f2a7b51e3503acc6a39b3784ffb84300",
- "pluginVersion": "1.6.0"
}, - "queryID": "a00dbc80a8d13c4565a442e7e2dca80a",
- "hits": [
- {
- "objectID": "test-record-123",
- "_highlightResult": {
- "attribute1": {
- "value": "<em>George</em> <em>Clo</em>oney",
- "matchLevel": "full",
- "matchedWords": [
- "action"
], - "fullyHighlighted": true
}, - "attribute2": {
- "value": "<em>George</em> <em>Clo</em>oney",
- "matchLevel": "full",
- "matchedWords": [
- "action"
], - "fullyHighlighted": true
}
}, - "_snippetResult": {
- "attribute1": {
- "value": "<em>George</em> <em>Clo</em>oney",
- "matchLevel": "full"
}, - "attribute2": {
- "value": "<em>George</em> <em>Clo</em>oney",
- "matchLevel": "full"
}
}, - "_rankingInfo": {
- "filters": 0,
- "firstMatchedWord": 0,
- "geoDistance": 0,
- "geoPrecision": 1,
- "matchedGeoLocation": {
- "lat": 0.1,
- "lng": 0.1,
- "distance": 0
}, - "personalization": {
- "filtersScore": 0,
- "rankingScore": 0,
- "score": 0
}, - "nbExactWords": 0,
- "nbTypos": 0,
- "promoted": true,
- "proximityDistance": 0,
- "userScore": 0,
- "words": 1,
- "promotedByReRanking": true
}, - "_distinctSeqID": 0
}
], - "query": "",
- "params": "query=a&hitsPerPage=20",
- "cursor": "jMDY3M2MwM2QwMWUxMmQwYWI0ZTN"
}
Create, update, delete, and search for rules.
Rules are if-then statements that you can use to curate search results. Rules have conditions which can trigger consequences. Consequences are changes to the search results, such as changing the order of search results, or boosting a facet. This can be useful for tuning specific queries or for merchandising.
Retrieve a rule
Retrieves a rule by its ID.
To find the object ID of rules, use the search
operation.
path Parameters
indexName required | string Example: YourIndexName Name of the index on which to perform the operation. |
objectID required | string Unique identifier of a rule object. |
Responses
Request samples
- C#
- Dart
- Go
- Java
- JavaScript
- Kotlin
- PHP
- Python
- Ruby
- Scala
- Swift
// Initialize the client var client = new SearchClient(new SearchConfig("YOUR_APP_ID", "YOUR_API_KEY")); // Call the API var response = await client.GetRuleAsync("indexName", "id1");
Response samples
- 200
- 400
- 402
- 403
- 404
{- "objectID": "string",
- "conditions": [
- {
- "pattern": "{facet:genre}",
- "anchoring": "contains",
- "alternatives": false,
- "context": "mobile",
- "filters": "genre:comedy"
}
], - "consequence": {
- "params": {
- "similarQuery": "comedy drama crime Macy Buscemi",
- "filters": "(category:Book OR category:Ebook) AND _tags:published",
- "facetFilters": [
- [
- "category:Book",
- "category:-Movie"
], - "author:John Doe"
], - "optionalFilters": [
- "category:Book",
- "author:John Doe"
], - "numericFilters": [
- [
- "inStock = 1",
- "deliveryDate < 1441755506"
], - "price < 1000"
], - "tagFilters": [
- [
- "Book",
- "Movie"
], - "SciFi"
], - "sumOrFiltersScores": false,
- "restrictSearchableAttributes": [
- "title",
- "author"
], - "facets": [
- "*"
], - "facetingAfterDistinct": false,
- "page": 0,
- "offset": 0,
- "length": 1,
- "aroundLatLng": "40.71,-74.01",
- "aroundLatLngViaIP": false,
- "aroundRadius": 1,
- "aroundPrecision": 10,
- "minimumAroundRadius": 1,
- "insideBoundingBox": [
- [
- 47.3165,
- 4.9665,
- 47.3424,
- 5.0201
], - [
- 40.9234,
- 2.1185,
- 38.643,
- 1.9916
]
], - "insidePolygon": [
- [
- 47.3165,
- 4.9665,
- 47.3424,
- 5.0201,
- 47.32,
- 4.9
], - [
- 40.9234,
- 2.1185,
- 38.643,
- 1.9916,
- 39.2587,
- 2.0104
]
], - "naturalLanguages": [ ],
- "ruleContexts": [
- "mobile"
], - "personalizationImpact": 100,
- "userToken": "test-user-123",
- "getRankingInfo": false,
- "synonyms": true,
- "clickAnalytics": false,
- "analytics": true,
- "analyticsTags": [ ],
- "percentileComputation": true,
- "enableABTest": true,
- "attributesToRetrieve": [
- "author",
- "title",
- "content"
], - "ranking": [
- "typo",
- "geo",
- "words",
- "filters",
- "proximity",
- "attribute",
- "exact",
- "custom"
], - "customRanking": [
- "desc(popularity)",
- "asc(price)"
], - "relevancyStrictness": 90,
- "attributesToHighlight": [
- "author",
- "title",
- "conten",
- "content"
], - "attributesToSnippet": [
- "content:80",
- "description"
], - "highlightPreTag": "<em>",
- "highlightPostTag": "</em>",
- "snippetEllipsisText": "…",
- "restrictHighlightAndSnippetArrays": false,
- "hitsPerPage": 20,
- "minWordSizefor1Typo": 4,
- "minWordSizefor2Typos": 8,
- "typoTolerance": true,
- "allowTyposOnNumericTokens": true,
- "disableTypoToleranceOnAttributes": [
- "sku"
], - "ignorePlurals": [
- "ca",
- "es"
], - "removeStopWords": [
- "ca",
- "es"
], - "keepDiacriticsOnCharacters": "øé",
- "queryLanguages": [
- "es"
], - "decompoundQuery": true,
- "enableRules": true,
- "enablePersonalization": false,
- "queryType": "prefixAll",
- "removeWordsIfNoResults": "firstWords",
- "mode": "keywordSearch",
- "semanticSearch": {
- "eventSources": [
- "string"
]
}, - "advancedSyntax": false,
- "optionalWords": [
- "blue",
- "iphone case"
], - "disableExactOnAttributes": [
- "description"
], - "exactOnSingleWordQuery": "attribute",
- "alternativesAsExact": [
- "ignorePlurals",
- "singleWordSynonym"
], - "advancedSyntaxFeatures": [
- "exactPhrase",
- "excludeWords"
], - "distinct": 1,
- "replaceSynonymsInHighlight": false,
- "minProximity": 1,
- "responseFields": [
- "*"
], - "maxFacetHits": 10,
- "maxValuesPerFacet": 100,
- "sortFacetValuesBy": "count",
- "attributeCriteriaComputedByMinProximity": false,
- "renderingContent": {
- "facetOrdering": {
- "facets": {
- "order": [
- "string"
]
}, - "values": {
- "facet1": {
- "order": [
- "string"
], - "sortRemainingBy": "alpha",
- "hide": [
- "string"
]
}, - "facet2": {
- "order": [
- "string"
], - "sortRemainingBy": "alpha",
- "hide": [
- "string"
]
}
}
}, - "redirect": {
- "url": "string"
}
}, - "enableReRanking": true,
- "reRankingApplyFilter": [
- null
], - "query": {
- "remove": [
- "string"
], - "edits": [
- {
- "type": "remove",
- "delete": "string",
- "insert": "string"
}
]
}, - "automaticFacetFilters": [
- {
- "facet": "string",
- "score": 1,
- "disjunctive": false
}
], - "automaticOptionalFacetFilters": [
- {
- "facet": "string",
- "score": 1,
- "disjunctive": false
}
]
}, - "promote": [
- {
- "objectIDs": [
- "test-record-123"
], - "position": 0
}
], - "filterPromotes": false,
- "hide": [
- {
- "objectID": "test-record-123"
}
], - "userData": {
- "settingID": "f2a7b51e3503acc6a39b3784ffb84300",
- "pluginVersion": "1.6.0"
}
}, - "description": "Display a promotional banner",
- "enabled": true,
- "validity": [
- {
- "from": 0,
- "until": 0
}
]
}
Create or replace a rule
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.
path Parameters
indexName required | string Example: YourIndexName Name of the index on which to perform the operation. |
objectID required | string Unique identifier of a rule object. |
query Parameters
forwardToReplicas | boolean Whether changes are applied to replica indices. |
Request Body schema: application/jsonrequired
objectID required | string Unique identifier of a rule object. |
Array of objects [ 0 .. 25 ] items Conditions that trigger a rule. Some consequences require specific conditions or don't require any condition. For more information, see Conditions. | |
object Effect of the rule. For more information, see Consequences. | |
description | string Description of the rule's purpose to help you distinguish between different rules. |
enabled | boolean Default: true Whether the rule is active. |
Array of objects Time periods when the rule is active. |
Responses
Request samples
- C#
- Dart
- Go
- Java
- JavaScript
- Kotlin
- PHP
- Python
- Ruby
- Scala
- Swift
// Initialize the client var client = new SearchClient(new SearchConfig("YOUR_APP_ID", "YOUR_API_KEY")); // Call the API var response = await client.SaveRuleAsync( "indexName", "id1", new Rule { ObjectID = "id1", Conditions = new List<Condition> { new Condition { Pattern = "apple", Anchoring = Enum.Parse<Anchoring>("Contains"), } }, } );
Response samples
- 200
- 400
- 402
- 403
- 404
{- "objectID": "string",
- "updatedAt": "2023-07-04T12:49:15Z",
- "taskID": 1514562690001
}
Delete a rule
Deletes a rule by its ID.
To find the object ID for rules,
use the search
operation.
path Parameters
indexName required | string Example: YourIndexName Name of the index on which to perform the operation. |
objectID required | string Unique identifier of a rule object. |
query Parameters
forwardToReplicas | boolean Whether changes are applied to replica indices. |
Responses
Request samples
- C#
- Dart
- Go
- Java
- JavaScript
- Kotlin
- PHP
- Python
- Ruby
- Scala
- Swift
// Initialize the client var client = new SearchClient(new SearchConfig("YOUR_APP_ID", "YOUR_API_KEY")); // Call the API var response = await client.DeleteRuleAsync("indexName", "id1");
Response samples
- 200
- 400
- 402
- 403
- 404
{- "taskID": 1514562690001,
- "updatedAt": "2023-07-04T12:49:15Z"
}
Create or update rules
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.
path Parameters
indexName required | string Example: YourIndexName Name of the index on which to perform the operation. |
query Parameters
clearExistingRules | boolean Whether existing rules should be deleted before adding this batch. |
forwardToReplicas | boolean Whether changes are applied to replica indices. |
Request Body schema: application/jsonrequired
objectID required | string Unique identifier of a rule object. |
Array of objects [ 0 .. 25 ] items Conditions that trigger a rule. Some consequences require specific conditions or don't require any condition. For more information, see Conditions. | |
object Effect of the rule. For more information, see Consequences. | |
description | string Description of the rule's purpose to help you distinguish between different rules. |
enabled | boolean Default: true Whether the rule is active. |
Array of objects Time periods when the rule is active. |
Responses
Request samples
- C#
- Dart
- Go
- Java
- JavaScript
- Kotlin
- PHP
- Python
- Ruby
- Scala
- Swift
// Initialize the client var client = new SearchClient(new SearchConfig("YOUR_APP_ID", "YOUR_API_KEY")); // Call the API var response = await client.SaveRulesAsync( "<YOUR_INDEX_NAME>", new List<Rule> { new Rule { ObjectID = "a-rule-id", Conditions = new List<Condition> { new Condition { Pattern = "smartphone", Anchoring = Enum.Parse<Anchoring>("Contains"), } }, }, new Rule { ObjectID = "a-second-rule-id", Conditions = new List<Condition> { new Condition { Pattern = "apple", Anchoring = Enum.Parse<Anchoring>("Contains"), } }, } }, false, true );
Response samples
- 200
- 400
- 402
- 403
- 404
{- "taskID": 1514562690001,
- "updatedAt": "2023-07-04T12:49:15Z"
}
Delete all rules
Deletes all rules from the index.
path Parameters
indexName required | string Example: YourIndexName Name of the index on which to perform the operation. |
query Parameters
forwardToReplicas | boolean Whether changes are applied to replica indices. |
Responses
Request samples
- C#
- Dart
- Go
- Java
- JavaScript
- Kotlin
- PHP
- Python
- Ruby
- Scala
- Swift
// Initialize the client var client = new SearchClient(new SearchConfig("YOUR_APP_ID", "YOUR_API_KEY")); // Call the API var response = await client.ClearRulesAsync("indexName");
Response samples
- 200
- 400
- 402
- 403
- 404
{- "taskID": 1514562690001,
- "updatedAt": "2023-07-04T12:49:15Z"
}
Search for rules
Searches for rules in your index.
path Parameters
indexName required | string Example: YourIndexName Name of the index on which to perform the operation. |
Request Body schema: application/json
anchoring | string Enum: "contains" "endsWith" "is" "startsWith" Which part of the search query the pattern should match:
Empty queries are only allowed as pattern with |
context | string Only return rules that match the context (exact match). |
boolean or null Default: null | |
hitsPerPage | integer [ 1 .. 1000 ] Default: 20 Maximum number of hits per page. |
page | integer >= 0 Requested page of the API response. |
query | string Default: "" Search query for rules. |
Responses
Request samples
- C#
- Dart
- Go
- Java
- JavaScript
- Kotlin
- PHP
- Python
- Ruby
- Scala
- Swift
// Initialize the client var client = new SearchClient(new SearchConfig("YOUR_APP_ID", "YOUR_API_KEY")); // Call the API var response = await client.SearchRulesAsync( "indexName", new SearchRulesParams { Query = "something", } );
Response samples
- 200
- 400
- 402
- 403
- 404
{- "hits": [
- {
- "objectID": "string",
- "conditions": [
- {
- "pattern": "{facet:genre}",
- "anchoring": "contains",
- "alternatives": false,
- "context": "mobile",
- "filters": "genre:comedy"
}
], - "consequence": {
- "params": {
- "similarQuery": "comedy drama crime Macy Buscemi",
- "filters": "(category:Book OR category:Ebook) AND _tags:published",
- "facetFilters": [
- [
- "category:Book",
- "category:-Movie"
], - "author:John Doe"
], - "optionalFilters": [
- "category:Book",
- "author:John Doe"
], - "numericFilters": [
- [
- "inStock = 1",
- "deliveryDate < 1441755506"
], - "price < 1000"
], - "tagFilters": [
- [
- "Book",
- "Movie"
], - "SciFi"
], - "sumOrFiltersScores": false,
- "restrictSearchableAttributes": [
- "title",
- "author"
], - "facets": [
- "*"
], - "facetingAfterDistinct": false,
- "page": 0,
- "offset": 0,
- "length": 1,
- "aroundLatLng": "40.71,-74.01",
- "aroundLatLngViaIP": false,
- "aroundRadius": 1,
- "aroundPrecision": 10,
- "minimumAroundRadius": 1,
- "insideBoundingBox": [
- [
- 47.3165,
- 4.9665,
- 47.3424,
- 5.0201
], - [
- 40.9234,
- 2.1185,
- 38.643,
- 1.9916
]
], - "insidePolygon": [
- [
- 47.3165,
- 4.9665,
- 47.3424,
- 5.0201,
- 47.32,
- 4.9
], - [
- 40.9234,
- 2.1185,
- 38.643,
- 1.9916,
- 39.2587,
- 2.0104
]
], - "naturalLanguages": [ ],
- "ruleContexts": [
- "mobile"
], - "personalizationImpact": 100,
- "userToken": "test-user-123",
- "getRankingInfo": false,
- "synonyms": true,
- "clickAnalytics": false,
- "analytics": true,
- "analyticsTags": [ ],
- "percentileComputation": true,
- "enableABTest": true,
- "attributesToRetrieve": [
- "author",
- "title",
- "content"
], - "ranking": [
- "typo",
- "geo",
- "words",
- "filters",
- "proximity",
- "attribute",
- "exact",
- "custom"
], - "customRanking": [
- "desc(popularity)",
- "asc(price)"
], - "relevancyStrictness": 90,
- "attributesToHighlight": [
- "author",
- "title",
- "conten",
- "content"
], - "attributesToSnippet": [
- "content:80",
- "description"
], - "highlightPreTag": "<em>",
- "highlightPostTag": "</em>",
- "snippetEllipsisText": "…",
- "restrictHighlightAndSnippetArrays": false,
- "hitsPerPage": 20,
- "minWordSizefor1Typo": 4,
- "minWordSizefor2Typos": 8,
- "typoTolerance": true,
- "allowTyposOnNumericTokens": true,
- "disableTypoToleranceOnAttributes": [
- "sku"
], - "ignorePlurals": [
- "ca",
- "es"
], - "removeStopWords": [
- "ca",
- "es"
], - "keepDiacriticsOnCharacters": "øé",
- "queryLanguages": [
- "es"
], - "decompoundQuery": true,
- "enableRules": true,
- "enablePersonalization": false,
- "queryType": "prefixAll",
- "removeWordsIfNoResults": "firstWords",
- "mode": "keywordSearch",
- "semanticSearch": {
- "eventSources": [
- "string"
]
}, - "advancedSyntax": false,
- "optionalWords": [
- "blue",
- "iphone case"
], - "disableExactOnAttributes": [
- "description"
], - "exactOnSingleWordQuery": "attribute",
- "alternativesAsExact": [
- "ignorePlurals",
- "singleWordSynonym"
], - "advancedSyntaxFeatures": [
- "exactPhrase",
- "excludeWords"
], - "distinct": 1,
- "replaceSynonymsInHighlight": false,
- "minProximity": 1,
- "responseFields": [
- "*"
], - "maxFacetHits": 10,
- "maxValuesPerFacet": 100,
- "sortFacetValuesBy": "count",
- "attributeCriteriaComputedByMinProximity": false,
- "renderingContent": {
- "facetOrdering": {
- "facets": {
- "order": [
- "string"
]
}, - "values": {
- "facet1": {
- "order": [
- null
], - "sortRemainingBy": "alpha",
- "hide": [
- null
]
}, - "facet2": {
- "order": [
- null
], - "sortRemainingBy": "alpha",
- "hide": [
- null
]
}
}
}, - "redirect": {
- "url": "string"
}
}, - "enableReRanking": true,
- "reRankingApplyFilter": [
- null
], - "query": {
- "remove": [
- "string"
], - "edits": [
- {
- "type": "remove",
- "delete": "string",
- "insert": "string"
}
]
}, - "automaticFacetFilters": [
- {
- "facet": "string",
- "score": 1,
- "disjunctive": false
}
], - "automaticOptionalFacetFilters": [
- {
- "facet": "string",
- "score": 1,
- "disjunctive": false
}
]
}, - "promote": [
- {
- "objectIDs": [
- "test-record-123"
], - "position": 0
}
], - "filterPromotes": false,
- "hide": [
- {
- "objectID": "test-record-123"
}
], - "userData": {
- "settingID": "f2a7b51e3503acc6a39b3784ffb84300",
- "pluginVersion": "1.6.0"
}
}, - "description": "Display a promotional banner",
- "enabled": true,
- "validity": [
- {
- "from": 0,
- "until": 0
}
]
}
], - "nbHits": 0,
- "page": 0,
- "nbPages": 0
}
Create, update, delete, and search for synonyms.
Synonyms are terms that the search engine should consider equal.
Retrieve a synonym
Retrieves a syonym by its ID.
To find the object IDs for your synonyms,
use the search
operation.
path Parameters
indexName required | string Example: YourIndexName Name of the index on which to perform the operation. |
objectID required | string Example: synonymID Unique identifier of a synonym object. |
Responses
Request samples
- C#
- Dart
- Go
- Java
- JavaScript
- Kotlin
- PHP
- Python
- Ruby
- Scala
- Swift
// Initialize the client var client = new SearchClient(new SearchConfig("YOUR_APP_ID", "YOUR_API_KEY")); // Call the API var response = await client.GetSynonymAsync("indexName", "id1");
Response samples
- 200
- 400
- 402
- 403
- 404
{- "objectID": "synonymID",
- "type": "onewaysynonym",
- "synonyms": [
- "vehicle",
- "auto"
], - "input": "car",
- "word": "car",
- "corrections": [
- "vehicle",
- "auto"
], - "placeholder": "<Street>",
- "replacements": [
- "street",
- "st"
]
}
Create or replace a synonym
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.
path Parameters
indexName required | string Example: YourIndexName Name of the index on which to perform the operation. |
objectID required | string Example: synonymID Unique identifier of a synonym object. |
query Parameters
forwardToReplicas | boolean Whether changes are applied to replica indices. |
Request Body schema: application/jsonrequired
objectID required | string Unique identifier of a synonym object. |
type required | string Enum: "altcorrection1" "altcorrection2" "onewaysynonym" "placeholder" "synonym" Synonym type. |
corrections | Array of strings Words to be matched in records. |
input | string Word or phrase to appear in query strings (for |
placeholder | string Placeholder token to be put inside records. |
replacements | Array of strings Query words that will match the placeholder token. |
synonyms | Array of strings Words or phrases considered equivalent. |
word | string Word or phrase to appear in query strings (for |
Responses
Request samples
- C#
- Dart
- Go
- Java
- JavaScript
- Kotlin
- PHP
- Python
- Ruby
- Scala
- Swift
// Initialize the client var client = new SearchClient(new SearchConfig("YOUR_APP_ID", "YOUR_API_KEY")); // Call the API var response = await client.SaveSynonymAsync( "indexName", "id1", new SynonymHit { ObjectID = "id1", Type = Enum.Parse<SynonymType>("Synonym"), Synonyms = new List<string> { "car", "vehicule", "auto" }, }, true );
Response samples
- 200
- 400
- 402
- 403
- 404
{- "taskID": 1514562690001,
- "updatedAt": "2023-07-04T12:49:15Z",
- "id": "12"
}
Delete a synonym
Deletes a synonym by its ID.
To find the object IDs of your synonyms, use the search
operation.
path Parameters
indexName required | string Example: YourIndexName Name of the index on which to perform the operation. |
objectID required | string Example: synonymID Unique identifier of a synonym object. |
query Parameters
forwardToReplicas | boolean Whether changes are applied to replica indices. |
Responses
Request samples
- C#
- Dart
- Go
- Java
- JavaScript
- Kotlin
- PHP
- Python
- Ruby
- Scala
- Swift
// Initialize the client var client = new SearchClient(new SearchConfig("YOUR_APP_ID", "YOUR_API_KEY")); // Call the API var response = await client.DeleteSynonymAsync("indexName", "id1");
Response samples
- 200
- 400
- 402
- 403
- 404
{- "taskID": 1514562690001,
- "deletedAt": "2023-06-27T14:42:38.831Z"
}
Create or replace synonyms
If a synonym with the objectID
doesn't exist, Algolia adds a new one.
Otherwise, existing synonyms are replaced.
path Parameters
indexName required | string Example: YourIndexName Name of the index on which to perform the operation. |
query Parameters
forwardToReplicas | boolean Whether changes are applied to replica indices. |
replaceExistingSynonyms | boolean Whether to replace all synonyms in the index with the ones sent with this request. |
Request Body schema: application/jsonrequired
objectID required | string Unique identifier of a synonym object. |
type required | string Enum: "altcorrection1" "altcorrection2" "onewaysynonym" "placeholder" "synonym" Synonym type. |
corrections | Array of strings Words to be matched in records. |
input | string Word or phrase to appear in query strings (for |
placeholder | string Placeholder token to be put inside records. |
replacements | Array of strings Query words that will match the placeholder token. |
synonyms | Array of strings Words or phrases considered equivalent. |
word | string Word or phrase to appear in query strings (for |
Responses
Request samples
- C#
- Dart
- Go
- Java
- JavaScript
- Kotlin
- PHP
- Python
- Ruby
- Scala
- Swift
// Initialize the client var client = new SearchClient(new SearchConfig("YOUR_APP_ID", "YOUR_API_KEY")); // Call the API var response = await client.SaveSynonymsAsync( "<YOUR_INDEX_NAME>", new List<SynonymHit> { new SynonymHit { ObjectID = "id1", Type = Enum.Parse<SynonymType>("Synonym"), Synonyms = new List<string> { "car", "vehicule", "auto" }, }, new SynonymHit { ObjectID = "id2", Type = Enum.Parse<SynonymType>("Onewaysynonym"), Input = "iphone", Synonyms = new List<string> { "ephone", "aphone", "yphone" }, } }, true, true );
Response samples
- 200
- 400
- 402
- 403
- 404
{- "taskID": 1514562690001,
- "updatedAt": "2023-07-04T12:49:15Z"
}
Delete all synonyms
Deletes all synonyms from the index.
path Parameters
indexName required | string Example: YourIndexName Name of the index on which to perform the operation. |
query Parameters
forwardToReplicas | boolean Whether changes are applied to replica indices. |
Responses
Request samples
- C#
- Dart
- Go
- Java
- JavaScript
- Kotlin
- PHP
- Python
- Ruby
- Scala
- Swift
// Initialize the client var client = new SearchClient(new SearchConfig("YOUR_APP_ID", "YOUR_API_KEY")); // Call the API var response = await client.ClearSynonymsAsync("indexName");
Response samples
- 200
- 400
- 402
- 403
- 404
{- "taskID": 1514562690001,
- "updatedAt": "2023-07-04T12:49:15Z"
}
Search for synonyms
Searches for synonyms in your index.
path Parameters
indexName required | string Example: YourIndexName Name of the index on which to perform the operation. |
Request Body schema: application/json
Body of the searchSynonyms
operation.
hitsPerPage | integer [ 1 .. 1000 ] Default: 20 Number of hits per page. |
page | integer >= 0 Default: 0 Page of search results to retrieve. |
query | string Default: "" Search query. |
type | string Enum: "altcorrection1" "altcorrection2" "onewaysynonym" "placeholder" "synonym" Synonym type. |
Responses
Request samples
- C#
- Dart
- Go
- Java
- JavaScript
- Kotlin
- PHP
- Python
- Ruby
- Scala
- Swift
// Initialize the client var client = new SearchClient(new SearchConfig("YOUR_APP_ID", "YOUR_API_KEY")); // Call the API var response = await client.SearchSynonymsAsync("indexName");
Response samples
- 200
- 400
- 402
- 403
- 404
{- "hits": [
- {
- "objectID": "synonymID",
- "type": "onewaysynonym",
- "synonyms": [
- "vehicle",
- "auto"
], - "input": "car",
- "word": "car",
- "corrections": [
- "vehicle",
- "auto"
], - "placeholder": "<Street>",
- "replacements": [
- "street",
- "st"
]
}
], - "nbHits": 20
}
Manage your dictionaries.
Customize language-specific settings, such as stop words, plurals, or word segmentation.
Dictionaries are application-wide.
Add or delete dictionary entries
Adds or deletes multiple entries from your plurals, segmentation, or stop word dictionaries.
path Parameters
dictionaryName required | string Enum: "compounds" "plurals" "stopwords" Dictionary type in which to search. |
Request Body schema: application/jsonrequired
required | Array of objects List of additions and deletions to your dictionaries. |
clearExistingDictionaryEntries | boolean Default: false Whether to replace all custom entries in the dictionary with the ones sent with this request. |
Responses
Request samples
- C#
- Dart
- Go
- Java
- JavaScript
- Kotlin
- PHP
- Python
- Ruby
- Scala
- Swift
// Initialize the client var client = new SearchClient(new SearchConfig("YOUR_APP_ID", "YOUR_API_KEY")); // Call the API var response = await client.BatchDictionaryEntriesAsync( Enum.Parse<DictionaryType>("Plurals"), new BatchDictionaryEntriesParams { ClearExistingDictionaryEntries = true, Requests = new List<BatchDictionaryEntriesRequest> { new BatchDictionaryEntriesRequest { Action = Enum.Parse<DictionaryAction>("AddEntry"), Body = new DictionaryEntry { ObjectID = "1", Language = Enum.Parse<SupportedLanguage>("En"), Word = "fancy", Words = new List<string> { "believe", "algolia" }, Decomposition = new List<string> { "trust", "algolia" }, State = Enum.Parse<DictionaryEntryState>("Enabled"), }, } }, } );
Response samples
- 200
- 400
- 402
- 403
- 404
{- "taskID": 1514562690001,
- "updatedAt": "2023-07-04T12:49:15Z"
}
Search dictionary entries
Searches for standard and custom dictionary entries.
path Parameters
dictionaryName required | string Enum: "compounds" "plurals" "stopwords" Dictionary type in which to search. |
Request Body schema: application/jsonrequired
query required | string Default: "" Search query. |
hitsPerPage | integer [ 1 .. 1000 ] Default: 20 Number of hits per page. |
language | string Enum: "af" "ar" "az" "bg" "bn" "ca" "cs" "cy" "da" "de" "el" "en" "eo" "es" "et" "eu" "fa" "fi" "fo" "fr" "ga" "gl" "he" "hi" "hu" "hy" "id" "is" "it" "ja" "ka" "kk" "ko" "ku" "ky" "lt" "lv" "mi" "mn" "mr" "ms" "mt" "nb" "nl" "no" "ns" "pl" "ps" "pt" "pt-br" "qu" "ro" "ru" "sk" "sq" "sv" "sw" "ta" "te" "th" "tl" "tn" "tr" "tt" "uk" "ur" "uz" "zh" ISO code for a supported language. |
page | integer >= 0 Default: 0 Page of search results to retrieve. |
Responses
Request samples
- C#
- Dart
- Go
- Java
- JavaScript
- Kotlin
- PHP
- Python
- Ruby
- Scala
- Swift
// Initialize the client var client = new SearchClient(new SearchConfig("YOUR_APP_ID", "YOUR_API_KEY")); // Call the API var response = await client.SearchDictionaryEntriesAsync( Enum.Parse<DictionaryType>("Stopwords"), new SearchDictionaryEntriesParams { Query = "about", } );
Response samples
- 200
- 400
- 402
- 403
- 404
{- "hits": [
- {
- "objectID": "828afd405e1f4fe950b6b98c2c43c032",
- "language": "af",
- "word": "the",
- "words": [
- "cheval",
- "cheveaux"
], - "decomposition": [
- "kopf",
- "schmerz",
- "tablette"
], - "state": "disabled"
}
], - "page": 0,
- "nbHits": 20,
- "nbPages": 1
}
Retrieve dictionary settings
Retrieves the languages for which standard dictionary entries are turned off.
Responses
Request samples
- C#
- Dart
- Go
- Java
- JavaScript
- Kotlin
- PHP
- Python
- Ruby
- Scala
- Swift
// Initialize the client var client = new SearchClient(new SearchConfig("YOUR_APP_ID", "YOUR_API_KEY")); // Call the API var response = await client.GetDictionarySettingsAsync();
Response samples
- 200
- 400
- 402
- 403
- 404
{- "disableStandardEntries": {
- "plurals": {
- "fr": false
}, - "stopwords": {
- "fr": false
}, - "compounds": {
- "fr": false
}
}
}
Update dictionary settings
Turns standard stop word dictionary entries on or off for a given language.
Request Body schema: application/jsonrequired
required | object Key-value pairs of supported language ISO codes and boolean values. | ||||||
|
Responses
Request samples
- C#
- Dart
- Go
- Java
- JavaScript
- Kotlin
- PHP
- Python
- Ruby
- Scala
- Swift
// Initialize the client var client = new SearchClient(new SearchConfig("YOUR_APP_ID", "YOUR_API_KEY")); // Call the API var response = await client.SetDictionarySettingsAsync( new DictionarySettingsParams { DisableStandardEntries = new StandardEntries { Plurals = new Dictionary<string, Boolean> { { "fr", false }, { "en", false }, { "ru", true } }, }, } );
Response samples
- 200
- 400
- 402
- 403
- 404
{- "taskID": 1514562690001,
- "updatedAt": "2023-07-04T12:49:15Z"
}
List available languages
Lists supported languages with their supported dictionary types and number of custom entries.
Responses
Request samples
- C#
- Dart
- Go
- Java
- JavaScript
- Kotlin
- PHP
- Python
- Ruby
- Scala
- Swift
// Initialize the client var client = new SearchClient(new SearchConfig("YOUR_APP_ID", "YOUR_API_KEY")); // Call the API var response = await client.GetDictionaryLanguagesAsync();
Response samples
- 200
- 400
- 402
- 403
- 404
{- "language1": {
- "plurals": {
- "nbCustomEntries": 0
}, - "stopwords": {
- "nbCustomEntries": 0
}, - "compounds": {
- "nbCustomEntries": 0
}
}, - "language2": {
- "plurals": {
- "nbCustomEntries": 0
}, - "stopwords": {
- "nbCustomEntries": 0
}, - "compounds": {
- "nbCustomEntries": 0
}
}
}
Manage your API keys.
API requests must be authenticated with an API key. API keys can have permissions (access control lists, ACL) and restrictions.
List API keys
Lists all API keys associated with your Algolia application, including their permissions and restrictions.
Responses
Request samples
- C#
- Dart
- Go
- Java
- JavaScript
- Kotlin
- PHP
- Python
- Ruby
- Scala
- Swift
// Initialize the client var client = new SearchClient(new SearchConfig("YOUR_APP_ID", "YOUR_API_KEY")); // Call the API var response = await client.ListApiKeysAsync();
Response samples
- 200
- 400
- 402
- 403
- 404
{- "keys": [
- {
- "value": "13ad45b4d0a2f6ea65ecbddf6aa260f2",
- "createdAt": 1656345570000,
- "acl": [
- "search",
- "addObject"
], - "description": "Used for indexing by the CLI",
- "indexes": [
- "dev_*",
- "prod_en_products"
], - "maxHitsPerQuery": 0,
- "maxQueriesPerIPPerHour": 0,
- "queryParameters": "typoTolerance=strict&restrictSources=192.168.1.0/24",
- "referers": [
- "*algolia.com*"
], - "validity": 86400
}
]
}
Create an API key
Creates a new API key with specific permissions and restrictions.
Request Body schema: application/jsonrequired
acl required | Array of strings Default: [] Items Enum: "addObject" "analytics" "browse" "deleteIndex" "deleteObject" "editSettings" "inference" "listIndexes" "logs" "personalization" "recommendation" "search" "seeUnretrievableAttributes" "settings" "usage" Permissions that determine the type of API requests this key can make. The required ACL is listed in each endpoint's reference. For more information, see access control list. |
description | string Default: "" Description of an API key to help you identify this API key. |
indexes | Array of strings Default: [] Index names or patterns that this API key can access. By default, an API key can access all indices in the same application. You can use leading and trailing wildcard characters (
|
maxHitsPerQuery | integer Default: 0 Maximum number of results this API key can retrieve in one query. By default, there's no limit. |
maxQueriesPerIPPerHour | integer Default: 0 Maximum number of API requests allowed per IP address or user token per hour. If this limit is reached, the API returns an error with status code |
queryParameters | string Default: "" Query parameters to add when making API requests with this API key. To restrict this API key to specific IP addresses, add the Creating an API key fails if the request is made from an IP address that's outside the restricted range. |
referers | Array of strings Default: [] Allowed HTTP referrers for this API key. By default, all referrers are allowed.
You can use leading and trailing wildcard characters (
Like all HTTP headers, referrers can be spoofed. Don't rely on them to secure your data. For more information, see HTTP referrer restrictions. |
validity | integer Default: 0 Duration (in seconds) after which the API key expires. By default, API keys don't expire. |
Responses
Request samples
- C#
- Dart
- Go
- Java
- JavaScript
- Kotlin
- PHP
- Python
- Ruby
- Scala
- Swift
// Initialize the client var client = new SearchClient(new SearchConfig("YOUR_APP_ID", "YOUR_API_KEY")); // Call the API var response = await client.AddApiKeyAsync( new ApiKey { Acl = new List<Acl> { Enum.Parse<Acl>("Search"), Enum.Parse<Acl>("AddObject") }, Description = "my new api key", Validity = 300, MaxQueriesPerIPPerHour = 100, MaxHitsPerQuery = 20, } );
Response samples
- 200
- 400
- 402
- 403
- 404
{- "key": "13ad45b4d0a2f6ea65ecbddf6aa260f2",
- "createdAt": "2023-07-04T12:49:15Z"
}
Retrieve API key permissions
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.
path Parameters
key required | string Example: YourAPIKey API key. |
Responses
Request samples
- C#
- Dart
- Go
- Java
- JavaScript
- Kotlin
- PHP
- Python
- Ruby
- Scala
- Swift
// Initialize the client var client = new SearchClient(new SearchConfig("YOUR_APP_ID", "YOUR_API_KEY")); // Call the API var response = await client.GetApiKeyAsync("myTestApiKey");
Response samples
- 200
- 400
- 402
- 403
- 404
{- "value": "13ad45b4d0a2f6ea65ecbddf6aa260f2",
- "createdAt": 1656345570000,
- "acl": [
- "search",
- "addObject"
], - "description": "Used for indexing by the CLI",
- "indexes": [
- "dev_*",
- "prod_en_products"
], - "maxHitsPerQuery": 0,
- "maxQueriesPerIPPerHour": 0,
- "queryParameters": "typoTolerance=strict&restrictSources=192.168.1.0/24",
- "referers": [
- "*algolia.com*"
], - "validity": 86400
}
Update an API key
Replaces the permissions of an existing API key.
Any unspecified attribute resets that attribute to its default value.
path Parameters
key required | string Example: YourAPIKey API key. |
Request Body schema: application/jsonrequired
acl required | Array of strings Default: [] Items Enum: "addObject" "analytics" "browse" "deleteIndex" "deleteObject" "editSettings" "inference" "listIndexes" "logs" "personalization" "recommendation" "search" "seeUnretrievableAttributes" "settings" "usage" Permissions that determine the type of API requests this key can make. The required ACL is listed in each endpoint's reference. For more information, see access control list. |
description | string Default: "" Description of an API key to help you identify this API key. |
indexes | Array of strings Default: [] Index names or patterns that this API key can access. By default, an API key can access all indices in the same application. You can use leading and trailing wildcard characters (
|
maxHitsPerQuery | integer Default: 0 Maximum number of results this API key can retrieve in one query. By default, there's no limit. |
maxQueriesPerIPPerHour | integer Default: 0 Maximum number of API requests allowed per IP address or user token per hour. If this limit is reached, the API returns an error with status code |
queryParameters | string Default: "" Query parameters to add when making API requests with this API key. To restrict this API key to specific IP addresses, add the Creating an API key fails if the request is made from an IP address that's outside the restricted range. |
referers | Array of strings Default: [] Allowed HTTP referrers for this API key. By default, all referrers are allowed.
You can use leading and trailing wildcard characters (
Like all HTTP headers, referrers can be spoofed. Don't rely on them to secure your data. For more information, see HTTP referrer restrictions. |
validity | integer Default: 0 Duration (in seconds) after which the API key expires. By default, API keys don't expire. |
Responses
Request samples
- C#
- Dart
- Go
- Java
- JavaScript
- Kotlin
- PHP
- Python
- Ruby
- Scala
- Swift
// Initialize the client var client = new SearchClient(new SearchConfig("YOUR_APP_ID", "YOUR_API_KEY")); // Call the API var response = await client.UpdateApiKeyAsync( "myApiKey", new ApiKey { Acl = new List<Acl> { Enum.Parse<Acl>("Search"), Enum.Parse<Acl>("AddObject") }, Validity = 300, MaxQueriesPerIPPerHour = 100, MaxHitsPerQuery = 20, } );
Response samples
- 200
- 400
- 402
- 403
- 404
{- "key": "13ad45b4d0a2f6ea65ecbddf6aa260f2",
- "updatedAt": "2023-07-04T12:49:15Z"
}
Delete an API key
Deletes the API key.
path Parameters
key required | string Example: YourAPIKey API key. |
Responses
Request samples
- C#
- Dart
- Go
- Java
- JavaScript
- Kotlin
- PHP
- Python
- Ruby
- Scala
- Swift
// Initialize the client var client = new SearchClient(new SearchConfig("YOUR_APP_ID", "YOUR_API_KEY")); // Call the API var response = await client.DeleteApiKeyAsync("myTestApiKey");
Response samples
- 200
- 400
- 402
- 403
- 404
{- "deletedAt": "2023-06-27T14:42:38.831Z"
}
Restore an API key
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.
path Parameters
key required | string Example: YourAPIKey API key. |
Responses
Request samples
- C#
- Dart
- Go
- Java
- JavaScript
- Kotlin
- PHP
- Python
- Ruby
- Scala
- Swift
// Initialize the client var client = new SearchClient(new SearchConfig("YOUR_APP_ID", "YOUR_API_KEY")); // Call the API var response = await client.RestoreApiKeyAsync("myApiKey");
Response samples
- 200
- 400
- 402
- 403
- 404
{- "key": "13ad45b4d0a2f6ea65ecbddf6aa260f2",
- "createdAt": "2023-07-04T12:49:15Z"
}
Multi-cluster operations.
Algolia no longer offers multi-cluster management.
Assign or move a 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.
header Parameters
X-Algolia-User-ID required | string^[a-zA-Z0-9 \-*.]+$ Example: user1 Unique identifier of the user who makes the search request. |
Request Body schema: application/jsonrequired
cluster required | string Cluster name. |
Responses
Request samples
- C#
- Dart
- Go
- Java
- JavaScript
- Kotlin
- PHP
- Python
- Ruby
- Scala
- Swift
// Initialize the client var client = new SearchClient(new SearchConfig("YOUR_APP_ID", "YOUR_API_KEY")); // Call the API var response = await client.AssignUserIdAsync( "userID", new AssignUserIdParams { Cluster = "theCluster", } );
Response samples
- 200
- 400
- 402
- 403
- 404
{- "createdAt": "2023-07-04T12:49:15Z"
}
List user IDs
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.
query Parameters
hitsPerPage | integer Default: 100 Number of hits per page. |
integer or null Default: null Requested page of the API response.
If |
Responses
Request samples
- C#
- Dart
- Go
- Java
- JavaScript
- Kotlin
- PHP
- Python
- Ruby
- Scala
- Swift
// Initialize the client var client = new SearchClient(new SearchConfig("YOUR_APP_ID", "YOUR_API_KEY")); // Call the API var response = await client.ListUserIdsAsync();
Response samples
- 200
- 400
- 402
- 403
- 404
{- "userIDs": [
- {
- "userID": "user1",
- "clusterName": "c1-test",
- "nbRecords": 42,
- "dataSize": 0
}
]
}
Assign multiple userIDs
Assigns multiple user IDs to a cluster.
You can't move users with this operation.
header Parameters
X-Algolia-User-ID required | string^[a-zA-Z0-9 \-*.]+$ Example: user1 Unique identifier of the user who makes the search request. |
Request Body schema: application/jsonrequired
cluster required | string Cluster name. |
users required | Array of strings User IDs to assign. |
Responses
Request samples
- C#
- Dart
- Go
- Java
- JavaScript
- Kotlin
- PHP
- Python
- Ruby
- Scala
- Swift
// Initialize the client var client = new SearchClient(new SearchConfig("YOUR_APP_ID", "YOUR_API_KEY")); // Call the API var response = await client.BatchAssignUserIdsAsync( "userID", new BatchAssignUserIdsParams { Cluster = "theCluster", Users = new List<string> { "user1", "user2" }, } );
Response samples
- 200
- 400
- 402
- 403
- 404
{- "createdAt": "2023-07-04T12:49:15Z"
}
Get top user IDs
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.
Responses
Request samples
- C#
- Dart
- Go
- Java
- JavaScript
- Kotlin
- PHP
- Python
- Ruby
- Scala
- Swift
// Initialize the client var client = new SearchClient(new SearchConfig("YOUR_APP_ID", "YOUR_API_KEY")); // Call the API var response = await client.GetTopUserIdsAsync();
Response samples
- 200
- 400
- 402
- 403
- 404
{- "topUsers": [
- {
- "cluster1": [
- {
- "userID": "user1",
- "clusterName": "c1-test",
- "nbRecords": 42,
- "dataSize": 0
}
], - "cluster2": [
- {
- "userID": "user1",
- "clusterName": "c1-test",
- "nbRecords": 42,
- "dataSize": 0
}
]
}
]
}
Retrieve user ID
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.
path Parameters
userID required | string^[a-zA-Z0-9 \-*.]+$ Example: user1 Unique identifier of the user who makes the search request. |
Responses
Request samples
- C#
- Dart
- Go
- Java
- JavaScript
- Kotlin
- PHP
- Python
- Ruby
- Scala
- Swift
// Initialize the client var client = new SearchClient(new SearchConfig("YOUR_APP_ID", "YOUR_API_KEY")); // Call the API var response = await client.GetUserIdAsync("uniqueID");
Response samples
- 200
- 400
- 402
- 403
- 404
{- "userID": "user1",
- "clusterName": "c1-test",
- "nbRecords": 42,
- "dataSize": 0
}
Delete user ID
Deletes a user ID and its associated data from the clusters.
path Parameters
userID required | string^[a-zA-Z0-9 \-*.]+$ Example: user1 Unique identifier of the user who makes the search request. |
Responses
Request samples
- C#
- Dart
- Go
- Java
- JavaScript
- Kotlin
- PHP
- Python
- Ruby
- Scala
- Swift
// Initialize the client var client = new SearchClient(new SearchConfig("YOUR_APP_ID", "YOUR_API_KEY")); // Call the API var response = await client.RemoveUserIdAsync("uniqueID");
Response samples
- 200
- 400
- 402
- 403
- 404
{- "deletedAt": "2023-06-27T14:42:38.831Z"
}
Request samples
- C#
- Dart
- Go
- Java
- JavaScript
- Kotlin
- PHP
- Python
- Ruby
- Scala
- Swift
// Initialize the client var client = new SearchClient(new SearchConfig("YOUR_APP_ID", "YOUR_API_KEY")); // Call the API var response = await client.ListClustersAsync();
Response samples
- 200
- 400
- 402
- 403
- 404
{- "topUsers": [
- "c11-test"
]
}
Search for user IDs
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).
Request Body schema: application/jsonrequired
query required | string Query to search. The search is a prefix search with typo tolerance enabled. An empty query will retrieve all users. |
clusterName | string Cluster name. |
hitsPerPage | integer [ 1 .. 1000 ] Default: 20 Number of hits per page. |
page | integer >= 0 Default: 0 Page of search results to retrieve. |
Responses
Request samples
- C#
- Dart
- Go
- Java
- JavaScript
- Kotlin
- PHP
- Python
- Ruby
- Scala
- Swift
// Initialize the client var client = new SearchClient(new SearchConfig("YOUR_APP_ID", "YOUR_API_KEY")); // Call the API var response = await client.SearchUserIdsAsync( new SearchUserIdsParams { Query = "test", ClusterName = "theClusterName", Page = 5, HitsPerPage = 10, } );
Response samples
- 200
- 400
- 402
- 403
- 404
{- "hits": [
- {
- "userID": "user1",
- "clusterName": "c11-test",
- "nbRecords": 3,
- "dataSize": 481,
- "objectID": "string",
- "_highlightResult": {
- "userID": {
- "value": "<em>George</em> <em>Clo</em>oney",
- "matchLevel": "full",
- "matchedWords": [
- "action"
], - "fullyHighlighted": true
}, - "clusterName": {
- "value": "<em>George</em> <em>Clo</em>oney",
- "matchLevel": "full",
- "matchedWords": [
- "action"
], - "fullyHighlighted": true
}
}
}
], - "nbHits": 20,
- "page": 0,
- "hitsPerPage": 20,
- "updatedAt": "2023-07-04T12:49:15Z"
}
Get migration and user mapping status
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.
query Parameters
getClusters | boolean Whether to include the cluster's pending mapping state in the response. |
Responses
Request samples
- C#
- Dart
- Go
- Java
- JavaScript
- Kotlin
- PHP
- Python
- Ruby
- Scala
- Swift
// Initialize the client var client = new SearchClient(new SearchConfig("YOUR_APP_ID", "YOUR_API_KEY")); // Call the API var response = await client.HasPendingMappingsAsync();
Response samples
- 200
- 400
- 402
- 403
- 404
{- "pending": true,
- "clusters": {
- "property1": [
- "string"
], - "property2": [
- "string"
]
}
}
Algolia Vault lets you restrict access to your clusters to specific IP addresses and provides disk-level encryption at rest.
List allowed sources
Retrieves all allowed IP addresses with access to your application.
Responses
Request samples
- C#
- Dart
- Go
- Java
- JavaScript
- Kotlin
- PHP
- Python
- Ruby
- Scala
- Swift
// Initialize the client var client = new SearchClient(new SearchConfig("YOUR_APP_ID", "YOUR_API_KEY")); // Call the API var response = await client.GetSourcesAsync();
Response samples
- 200
- 400
- 402
- 403
- 404
[- {
- "source": "10.0.0.1/32",
- "description": "Server subnet"
}
]
Replace allowed sources
Replaces the list of allowed sources.
Request Body schema: application/jsonrequired
Allowed sources.
source required | string IP address range of the source. |
description | string Source description. |
Responses
Request samples
- C#
- Dart
- Go
- Java
- JavaScript
- Kotlin
- PHP
- Python
- Ruby
- Scala
- Swift
// Initialize the client var client = new SearchClient(new SearchConfig("YOUR_APP_ID", "YOUR_API_KEY")); // Call the API var response = await client.ReplaceSourcesAsync( new List<Source> { new Source { VarSource = "theSource", Description = "theDescription", } } );
Response samples
- 200
- 400
- 402
- 403
- 404
{- "updatedAt": "2023-07-04T12:49:15Z"
}
Add a source
Adds a source to the list of allowed sources.
Request Body schema: application/jsonrequired
Source to add.
source required | string IP address range of the source. |
description | string Source description. |
Responses
Request samples
- C#
- Dart
- Go
- Java
- JavaScript
- Kotlin
- PHP
- Python
- Ruby
- Scala
- Swift
// Initialize the client var client = new SearchClient(new SearchConfig("YOUR_APP_ID", "YOUR_API_KEY")); // Call the API var response = await client.AppendSourceAsync( new Source { VarSource = "theSource", Description = "theDescription", } );
Response samples
- 200
- 400
- 402
- 403
- 404
{- "createdAt": "2023-07-04T12:49:15Z"
}
Delete a source
Deletes a source from the list of allowed sources.
path Parameters
source required | string Example: 10.0.0.1/32 IP address range of the source. |
Responses
Request samples
- C#
- Dart
- Go
- Java
- JavaScript
- Kotlin
- PHP
- Python
- Ruby
- Scala
- Swift
// Initialize the client var client = new SearchClient(new SearchConfig("YOUR_APP_ID", "YOUR_API_KEY")); // Call the API var response = await client.DeleteSourceAsync("theSource");
Response samples
- 200
- 400
- 402
- 403
- 404
{- "deletedAt": "2023-06-27T14:42:38.831Z"
}
Retrieve log entries
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.
query Parameters
string or null Example: indexName=products Index for which to retrieve log entries. By default, log entries are retrieved for all indices. | |
length | integer <= 1000 Default: 10 Maximum number of entries to retrieve. |
offset | integer Default: 0 First log entry to retrieve. The most recent entries are listed first. |
type | string Default: "all" Enum: "all" "build" "error" "query" Type of log entries to retrieve. By default, all log entries are retrieved. |
Responses
Request samples
- C#
- Dart
- Go
- Java
- JavaScript
- Kotlin
- PHP
- Python
- Ruby
- Scala
- Swift
// Initialize the client var client = new SearchClient(new SearchConfig("YOUR_APP_ID", "YOUR_API_KEY")); // Call the API var response = await client.GetLogsAsync();
Response samples
- 200
- 400
- 402
- 403
- 404
{- "logs": [
- {
- "timestamp": "2023-03-08T12:34:56Z",
- "method": "GET",
- "answer_code": "200",
- "query_body": "{\\n \\\"requests\\\": [\\n {\\n \\\"indexName\\\": \\\"best_buy\\\",\\n \\\"params\\\": \\\"query=&hitsPerPage=10&page=0&attributesToRetrieve=*&highlightPreTag=%3Cais-highlight-0000000000%3E&highlightPostTag=%3C%2Fais-highlight-0000000000%3E&getRankingInfo=1&facets=%5B%22brand%22%2C%22categories%22%2C%22free_shipping%22%2C%22type%22%5D&tagFilters=\\\"\\n }\\n ]\\n}\\n",
- "answer": "'n{\\n \\\"results\\\": [\\n {\\n \\\"hits\\\": [\\n {\\n \\\"name\\\": \\\"Amazon - Fire TV Stick\\\",\\n \\\"description\\\": \\\"Amazon Fire TV Stick connects to your TV's HDMI port. Just grab and go to enjoy Netflix, Prime Instant Video, Hulu Plus, YouTube.com, music, and much more.\\\",\\n \\\"brand\\\": \\\"Amazon\\\",\\n \\\"categories\\\": [\\n \\\"TV & Home Theater\\\",\\n \\\"Streaming Media Players\\\"\\n ],\\n \\\"hierarchicalCategories\\\": {\\n \\\"lvl0\\\": \\\"TV & Home Theater\\\",\\n \\\"lvl1\\\": \\\"TV & Home Theater > Streaming Media Players\\\"\\n },\\n \\\"type\\\": \\\"Streaming media plyr\\\",\\n \\\"price\\\": 39.99,\\n \\\"price_range\\\": \\\"1 - 50\\\",\\n \\\"image\\\": \\\"https:\\/\\/cdn-demo.algolia.com\\/bestbuy\\/9999119_sb.jpg\\\",\\n \\\"url\\\": \\\"http:\\/\\/www.bestbuy.com\\/site\\/amazon-fire-tv-stick\\/9999119.p?id=1219460752591&skuId=9999119&cmp=RMX&ky=1uWSHMdQqBeVJB9cXgEke60s5EjfS6M1W\\\",\\n \\\"free_shipping\\\": false,\\n \\\"popularity\\\": 9843,\\n \\\"rating\\\": 4,\\n \\\"objectID\\\": \\\"9999119\\\"\\n'\n",
- "url": "/1/indexes",
- "ip": "93.184.216.34",
- "query_headers": "User-Agent: curl/7.24.0 (x86_64-apple-darwin12.0) libcurl/7.24.0 OpenSSL/0.9.8x zlib/1.2.5\\nHost: example.com\\nAccept: */*\\nContent-Type: application/json; charset=utf-8\\nX-Algolia-API-Key: 20f***************************\\nX-Algolia-Application-Id: MyApplicationID\\n",
- "sha1": "26c53bd7e38ca71f4741b71994cd94a600b7ac68",
- "nb_api_calls": "1",
- "processing_time_ms": "2",
- "index": "products",
- "query_params": "query=georgia&attributesToRetrieve=name,city,country",
- "query_nb_hits": "1",
- "inner_queries": [
- {
- "index_name": "products",
- "user_token": "93.189.166.128",
- "query_id": "96f59a3145dd9bd8963dc223950507c8"
}
]
}
]
}
Check application task status
Checks the status of a given application task.
path Parameters
taskID required | integer <int64> Example: 1506303845001 Unique task identifier. |
Responses
Request samples
- C#
- Dart
- Go
- Java
- JavaScript
- Kotlin
- PHP
- Python
- Ruby
- Scala
- Swift
// Initialize the client var client = new SearchClient(new SearchConfig("YOUR_APP_ID", "YOUR_API_KEY")); // Call the API var response = await client.GetAppTaskAsync(123L);
Response samples
- 200
- 400
- 402
- 403
{- "status": "notPublished"
}
advancedSyntax | boolean Default: false Whether to support phrase matching and excluding words from search queries. Use the |
advancedSyntaxFeatures | Array of strings Default: ["exactPhrase","excludeWords"] Items Enum: "exactPhrase" "excludeWords" Advanced search syntax features you want to support.
This setting only has an effect if |
allowCompressionOfIntegerArray | boolean Default: false Whether arrays with exclusively non-negative integers should be compressed for better performance. If true, the compressed arrays may be reordered. |
allowTyposOnNumericTokens | boolean Default: true Whether to allow typos on numbers in the search query. Turn off this setting to reduce the number of irrelevant matches when searching in large sets of similar numbers. |
alternativesAsExact | Array of strings Default: ["ignorePlurals","singleWordSynonym"] Items Enum: "ignorePlurals" "multiWordsSynonym" "singleWordSynonym" Alternatives of query words that should be considered as exact matches by the Exact ranking criterion.
|
attributeCriteriaComputedByMinProximity | boolean Default: false Whether the best matching attribute should be determined by minimum proximity. This setting only affects ranking if the Attribute ranking criterion comes before Proximity in the |
attributeForDistinct | string Attribute that should be used to establish groups of results. Attribute names are case-sensitive. All records with the same value for this attribute are considered a group.
You can combine If you want to use the same attribute also for faceting, use the |
attributesForFaceting | Array of strings Default: [] Attributes used for faceting. Facets are attributes that let you categorize search results. They can be used for filtering search results. By default, no attribute is used for faceting. Attribute names are case-sensitive. Modifiers
|
attributesToHighlight | Array of strings Attributes to highlight. By default, all searchable attributes are highlighted.
Use With highlighting, strings that match the search query are surrounded by HTML tags defined by For more information, see Highlighting and snippeting. |
attributesToRetrieve | Array of strings Default: ["*"] Attributes to include in the API response. To reduce the size of your response, you can retrieve only some of the attributes. Attribute names are case-sensitive.
|
attributesToSnippet | Array of strings Default: [] Attributes for which to enable snippets. Attribute names are case-sensitive. Snippets provide additional context to matched words.
If you enable snippets, they include 10 words, including the matched word.
The matched word will also be wrapped by HTML tags for highlighting.
You can adjust the number of words with the following notation: |
attributesToTransliterate | Array of strings Attributes, for which you want to support Japanese transliteration. Transliteration supports searching in any of the Japanese writing systems. To support transliteration, you must set the indexing language to Japanese. Attribute names are case-sensitive. |
camelCaseAttributes | Array of strings Default: [] Attributes for which to split camel case words. Attribute names are case-sensitive. |
object Characters and their normalized replacements. This overrides Algolia's default normalization. | |
customRanking | Array of strings Default: [] Attributes to use as custom ranking. Attribute names are case-sensitive. The custom ranking attributes decide which items are shown first if the other ranking criteria are equal. Records with missing values for your selected custom ranking attributes are always sorted last. Boolean attributes are sorted based on their alphabetical order. Modifiers
If you use two or more custom ranking attributes, reduce the precision of your first attributes, or the other attributes will never be applied. |
decompoundedAttributes | object Default: {} Searchable attributes to which Algolia should apply word segmentation (decompounding). Attribute names are case-sensitive. Compound words are formed by combining two or more individual words, and are particularly prevalent in Germanic languages—for example, "firefighter". With decompounding, the individual components are indexed separately. You can specify different lists for different languages.
Decompounding is supported for these languages:
Dutch ( |
decompoundQuery | boolean Default: true Whether to split compound words into their building blocks. For more information, see Word segmentation. Word segmentation is supported for these languages: German, Dutch, Finnish, Swedish, and Norwegian. |
disableExactOnAttributes | Array of strings Default: [] Searchable attributes for which you want to turn off the Exact ranking criterion. Attribute names are case-sensitive. This can be useful for attributes with long values, where the likelyhood of an exact match is high, such as product descriptions. Turning off the Exact ranking criterion for these attributes favors exact matching on other attributes. This reduces the impact of individual attributes with a lot of content on ranking. |
disablePrefixOnAttributes | Array of strings Default: [] Searchable attributes for which you want to turn off prefix matching. Attribute names are case-sensitive. |
disableTypoToleranceOnAttributes | Array of strings Default: [] Attributes for which you want to turn off typo tolerance. Attribute names are case-sensitive. Returning only exact matches can help when:
Consider alternatives such as |
disableTypoToleranceOnWords | Array of strings Default: [] Words for which you want to turn off typo tolerance. This also turns off word splitting and concatenation for the specified words. |
boolean or integer Determines how many records of a group are included in the search results. Records with the same value for the The | |
enablePersonalization | boolean Default: false Whether to enable Personalization. |
enableReRanking | boolean Default: true Whether this search will use Dynamic Re-Ranking. This setting only has an effect if you activated Dynamic Re-Ranking for this index in the Algolia dashboard. |
enableRules | boolean Default: true Whether to enable rules. |
exactOnSingleWordQuery | string Default: "attribute" Enum: "attribute" "none" "word" Determines how the Exact ranking criterion is computed when the search query has only one word.
|
highlightPostTag | string Default: "</em>" HTML tag to insert after the highlighted parts in all highlighted results and snippets. |
highlightPreTag | string Default: "<em>" HTML tag to insert before the highlighted parts in all highlighted results and snippets. |
hitsPerPage | integer [ 1 .. 1000 ] Default: 20 Number of hits per page. |
Array of supportedLanguage (strings) or boolean Treat singular, plurals, and other forms of declensions as equivalent. You should only use this feature for the languages used in your index. | |
indexLanguages | Array of strings Default: [] Items Enum: "af" "ar" "az" "bg" "bn" "ca" "cs" "cy" "da" "de" "el" "en" "eo" "es" "et" "eu" "fa" "fi" "fo" "fr" "ga" "gl" "he" "hi" "hu" "hy" "id" "is" "it" "ja" "ka" "kk" "ko" "ku" "ky" "lt" "lv" "mi" "mn" "mr" "ms" "mt" "nb" "nl" "no" "ns" "pl" "ps" "pt" "pt-br" "qu" "ro" "ru" "sk" "sq" "sv" "sw" "ta" "te" "th" "tl" "tn" "tr" "tt" "uk" "ur" "uz" "zh" Languages for language-specific processing steps, such as word detection and dictionary settings. You should always specify an indexing language.
If you don't specify an indexing language, the search engine uses all supported languages,
or the languages you specified with the |
keepDiacriticsOnCharacters | string Default: "" Characters for which diacritics should be preserved. By default, Algolia removes diacritics from letters.
For example, |
maxFacetHits | integer <= 100 Default: 10 Maximum number of facet values to return when searching for facet values. |
maxValuesPerFacet | integer <= 1000 Default: 100 Maximum number of facet values to return for each facet. |
minProximity | integer [ 1 .. 7 ] Default: 1 Minimum proximity score for two matching words. This adjusts the Proximity ranking criterion by equally scoring matches that are farther apart. For example, if |
minWordSizefor1Typo | integer Default: 4 Minimum number of characters a word in the search query must contain to accept matches with one typo. |
minWordSizefor2Typos | integer Default: 8 Minimum number of characters a word in the search query must contain to accept matches with two typos. |
mode | string Default: "keywordSearch" Enum: "keywordSearch" "neuralSearch" Search mode the index will use to query for results. This setting only applies to indices, for which Algolia enabled NeuralSearch for you. |
numericAttributesForFiltering | Array of strings Default: [] Numeric attributes that can be used as numerical filters. Attribute names are case-sensitive. By default, all numeric attributes are available as numerical filters. For faster indexing, reduce the number of numeric attributes. If you want to turn off filtering for all numeric attributes, specifiy an attribute that doesn't exist in your index, such as Modifier
|
optionalWords | Array of strings Default: [] Words that should be considered optional when found in the query. By default, records must match all words in the search query to be included in the search results. Adding optional words can help to increase the number of search results by running an additional search query that doesn't include the optional words. For example, if the search query is "action video" and "video" is an optional word, the search engine runs two queries. One for "action video" and one for "action". Records that match all words are ranked higher. For a search query with 4 or more words and all its words are optional, the number of matched words required for a record to be included in the search results increases for every 1,000 records:
For more information, see Optional words. |
paginationLimitedTo | integer <= 20000 Default: 1000 Maximum number of search results that can be obtained through pagination. Higher pagination limits might slow down your search. For pagination limits above 1,000, the sorting of results beyond the 1,000th hit can't be guaranteed. |
queryLanguages | Array of strings Default: [] Items Enum: "af" "ar" "az" "bg" "bn" "ca" "cs" "cy" "da" "de" "el" "en" "eo" "es" "et" "eu" "fa" "fi" "fo" "fr" "ga" "gl" "he" "hi" "hu" "hy" "id" "is" "it" "ja" "ka" "kk" "ko" "ku" "ky" "lt" "lv" "mi" "mn" "mr" "ms" "mt" "nb" "nl" "no" "ns" "pl" "ps" "pt" "pt-br" "qu" "ro" "ru" "sk" "sq" "sv" "sw" "ta" "te" "th" "tl" "tn" "tr" "tt" "uk" "ur" "uz" "zh" Languages for language-specific query processing steps such as plurals, stop-word removal, and word-detection dictionaries. This setting sets a default list of languages used by the You should always specify a query language.
If you don't specify an indexing language, the search engine uses all supported languages,
or the languages you specified with the |
queryType | string Default: "prefixLast" Enum: "prefixAll" "prefixLast" "prefixNone" Determines if and how query words are interpreted as prefixes. By default, only the last query word is treated as prefix ( For more information, see Prefix searching. |
ranking | Array of strings Default: ["typo","geo","words","filters","proximity","attribute","exact","custom"] Determines the order in which Algolia returns your results. By default, each entry corresponds to a ranking criteria. The tie-breaking algorithm sequentially applies each criterion in the order they're specified. If you configure a replica index for sorting by an attribute, you put the sorting attribute at the top of the list. Modifiers
Before you modify the default setting, you should test your changes in the dashboard, and by A/B testing. |
relevancyStrictness | integer Default: 100 Relevancy threshold below which less relevant results aren't included in the results. You can only set |
Array of supportedLanguage (strings) or boolean Removes stop words from the search query. Stop words are common words like articles, conjunctions, prepositions, or pronouns that have little or no meaning on their own. In English, "the", "a", or "and" are stop words. You should only use this feature for the languages used in your index. | |
removeWordsIfNoResults | string Default: "none" Enum: "allOptional" "firstWords" "lastWords" "none" Strategy for removing words from the query when it doesn't return any results. This helps to avoid returning empty search results.
For more information, see Remove words to improve results. |
object Extra data that can be used in the search UI. You can use this to control aspects of your search UI, such as, the order of facet names and values without changing your frontend code. | |
replaceSynonymsInHighlight | boolean Default: false Whether to replace a highlighted word with the matched synonym. By default, the original words are highlighted even if a synonym matches.
For example, with With |
replicas | Array of strings Default: [] Creates replica indices. Replicas are copies of a primary index with the same records but different settings, synonyms, or rules. If you want to offer a different ranking or sorting of your search results, you'll use replica indices. All index operations on a primary index are automatically forwarded to its replicas. To add a replica index, you must provide the complete set of replicas to this parameter. If you omit a replica from this list, the replica turns into a regular, standalone index that will no longer by synced with the primary index. Modifier
|
(reRankingApplyFilter (Array of reRankingApplyFilter (any) or reRankingApplyFilter (string))) or null | |
responseFields | Array of strings Default: ["*"] Properties to include in the API response of By default, all response properties are included. To reduce the response size, you can select, which attributes should be included. You can't exclude these properties:
Don't exclude properties that you might need in your search UI. |
restrictHighlightAndSnippetArrays | boolean Default: false Whether to restrict highlighting and snippeting to items that at least partially matched the search query. By default, all items are highlighted and snippeted. |
searchableAttributes | Array of strings Default: [] Attributes used for searching. Attribute names are case-sensitive. By default, all attributes are searchable and the Attribute ranking criterion is turned off.
With a non-empty list, Algolia only returns results with matches in the selected attributes.
In addition, the Attribute ranking criterion is turned on: matches in attributes that are higher in the list of For more information, see Searchable attributes. Modifier
Without modifier, matches at the beginning of an attribute rank higer than matches at the end. |
object Settings for the semantic search part of NeuralSearch.
Only used when | |
separatorsToIndex | string Default: "" Controls which separators are indexed. Separators are all non-letter characters except spaces and currency characters, such as $€£¥.
By default, separator characters aren't indexed.
With |
snippetEllipsisText | string Default: "…" String used as an ellipsis indicator when a snippet is truncated. |
sortFacetValuesBy | string Default: "count" Order in which to retrieve facet values.
This setting doesn't influence how facet values are displayed in your UI (see |
boolean or typo tolerance (string) Whether typo tolerance is enabled and how it is applied. If typo tolerance is true, | |
unretrievableAttributes | Array of strings Default: [] Attributes that can't be retrieved at query time. This can be useful if you want to use an attribute for ranking or to restrict access, but don't want to include it in the search results. Attribute names are case-sensitive. |
userData | object Default: {} An object with custom data. You can store up to 32kB as custom data. |
{- "attributesForFaceting": [
- "author",
- "filterOnly(isbn)",
- "searchable(edition)",
- "afterDistinct(category)",
- "afterDistinct(searchable(publisher))"
], - "replicas": [
- "virtual(prod_products_price_asc)",
- "dev_products_replica"
], - "paginationLimitedTo": 100,
- "unretrievableAttributes": [
- "total_sales"
], - "disableTypoToleranceOnWords": [
- "wheel",
- "1X2BCD"
], - "attributesToTransliterate": [
- "name",
- "description"
], - "camelCaseAttributes": [
- "description"
], - "decompoundedAttributes": {
- "de": [
- "name"
]
}, - "indexLanguages": [
- "ja"
], - "disablePrefixOnAttributes": [
- "sku"
], - "allowCompressionOfIntegerArray": false,
- "numericAttributesForFiltering": [
- "equalOnly(quantity)",
- "popularity"
], - "separatorsToIndex": "+#",
- "searchableAttributes": [
- "title,alternative_title",
- "author",
- "unordered(text)",
- "emails.personal"
], - "userData": {
- "settingID": "f2a7b51e3503acc6a39b3784ffb84300",
- "pluginVersion": "1.6.0"
}, - "customNormalization": {
- "default": {
- "ä": "ae",
- "ü": "ue"
}
}, - "attributeForDistinct": "url",
- "attributesToRetrieve": [
- "author",
- "title",
- "content"
], - "ranking": [
- "typo",
- "geo",
- "words",
- "filters",
- "proximity",
- "attribute",
- "exact",
- "custom"
], - "customRanking": [
- "desc(popularity)",
- "asc(price)"
], - "relevancyStrictness": 90,
- "attributesToHighlight": [
- "author",
- "title",
- "conten",
- "content"
], - "attributesToSnippet": [
- "content:80",
- "description"
], - "highlightPreTag": "<em>",
- "highlightPostTag": "</em>",
- "snippetEllipsisText": "…",
- "restrictHighlightAndSnippetArrays": false,
- "hitsPerPage": 20,
- "minWordSizefor1Typo": 4,
- "minWordSizefor2Typos": 8,
- "typoTolerance": true,
- "allowTyposOnNumericTokens": true,
- "disableTypoToleranceOnAttributes": [
- "sku"
], - "ignorePlurals": [
- "ca",
- "es"
], - "removeStopWords": [
- "ca",
- "es"
], - "keepDiacriticsOnCharacters": "øé",
- "queryLanguages": [
- "es"
], - "decompoundQuery": true,
- "enableRules": true,
- "enablePersonalization": false,
- "queryType": "prefixAll",
- "removeWordsIfNoResults": "firstWords",
- "mode": "keywordSearch",
- "semanticSearch": {
- "eventSources": [
- "string"
]
}, - "advancedSyntax": false,
- "optionalWords": [
- "blue",
- "iphone case"
], - "disableExactOnAttributes": [
- "description"
], - "exactOnSingleWordQuery": "attribute",
- "alternativesAsExact": [
- "ignorePlurals",
- "singleWordSynonym"
], - "advancedSyntaxFeatures": [
- "exactPhrase",
- "excludeWords"
], - "distinct": 1,
- "replaceSynonymsInHighlight": false,
- "minProximity": 1,
- "responseFields": [
- "*"
], - "maxFacetHits": 10,
- "maxValuesPerFacet": 100,
- "sortFacetValuesBy": "count",
- "attributeCriteriaComputedByMinProximity": false,
- "renderingContent": {
- "facetOrdering": {
- "facets": {
- "order": [
- "string"
]
}, - "values": {
- "facet1": {
- "order": [
- "string"
], - "sortRemainingBy": "alpha",
- "hide": [
- "string"
]
}, - "facet2": {
- "order": [
- "string"
], - "sortRemainingBy": "alpha",
- "hide": [
- "string"
]
}
}
}, - "redirect": {
- "url": "string"
}
}, - "enableReRanking": true,
- "reRankingApplyFilter": [
- null
]
}
.