Algolia Component
Algolia is an advanced AI search platform.
Component key: algolia
Description
Algolia is a powerful and flexible search and discovery API, trusted by thousands of developers for delivering relevant search results in real-time.
Use the Algolia component to interact with your Algolia indexes, manage records, and perform search operations in your Algolia account.
API Documentation
This component was built using the Algolia API Reference.
A Note on Algolia Search Results Pagination
Algolia's Search API supports pagination.
This means that the API will return a certain number of hits for any search query. If additional results are available, the API response includes a nbPages
field that indicates the total number of pages.
{
"hits": [],
"nbHits": 100,
"page": 0,
"nbPages": 20
}
The page
parameter can be used in a subsequent query to fetch additional results.
See Algolia's Docs for information about Algolia's paginated search API, and this quickstart for information on looping over a paginated API in Prismatic.
Connections
Algolia API Key
API Keys are necessary for interacting with the Algolia API. API keys are unique to each application you create in Algolia.
To generate an API Key, you should log into Algolia and navigate to your application page. Within the application settings, you can find your API keys.
Algolia provides three types of API keys:
Admin API Key: This key has read and write rights on all indexing and configuration operations.
Search-Only API Key: This key has read-only rights on indexing operations and is recommended for use on the frontend.
Secured API Key: This key is generated from a search key and has additional rights defined at the time of generation.
For your integration, you will need both the Admin API Key and the Search-Only API Key.
For more information about API keys, refer to the Algolia Docs.
Input | Notes | Example |
---|---|---|
API Key string / Required apiKey | Your Algolia API Key | YourAlgoliaAPIKey |
Application ID string / Required applicationId | Your Algolia Application ID | YourAlgoliaApplicationId |
Actions
Browse Index
Retrieve all objects from an index. | key: browseIndex
Input | Notes | Example |
---|---|---|
Connection connection / Required algoliaConnection | ||
Cursor string cursor | Provide a string value for the cursor. This is optional. | cursor:AhNmaWx0ZXJzPWxhbmd1YWdlOmVuAgEoMjAyMjJlNjNjNjliZGQ1NWRkYzcyOGU3Y2M4M2M2ZDRiODI3ZmQ1Mw== |
Index Name string / Required indexName | Provide a string value for the index name. | prismatic_query_suggestions |
Search Parameters string params | Provide a URL-encoded string for search parameters. This is optional. | filters=language:en |
Copy Index
Copy an index, including its records, Synonyms, Rules, and settings (except for enableReRanking). | key: copyIndex
Input | Notes | Example |
---|---|---|
Connection connection / Required algoliaConnection | ||
Index From string / Required indexFrom | The index to copy from. | prismatic_query_suggestions |
Index To string / Required indexTo | The index to copy to. | prismatic_query_suggestions |
Example Payload for Copy Index
{
"data": {
"updatedAt": "2013-08-21T13:20:18.960Z",
"taskID": 10210332
}
}
Copy Settings
Copy the settings of an index to another index on the same app. | key: copySettings
Input | Notes | Example |
---|---|---|
Connection connection / Required algoliaConnection | ||
Index From string / Required indexFrom | The index to copy the settings from. | prismatic_query_suggestions |
Index To string / Required indexTo | The index to copy the settings to. | prismatic_query_suggestions |
Example Payload for Copy Settings
{
"data": {
"updatedAt": "2013-08-21T13:20:18.960Z",
"taskID": 10210332
}
}
Delete Index
Delete an index. | key: deleteIndex
Input | Notes | Example |
---|---|---|
Connection connection / Required algoliaConnection | ||
Index Name string / Required indexName | The index name to delete. | prismatic_query_suggestions |
Example Payload for Delete Index
{
"data": {
"deletedAt": "2013-01-18T15:33:13.556Z",
"taskID": 721
}
}
Get Index
Get index information | key: getIndex
Input | Notes | Example |
---|---|---|
Connection connection / Required algoliaConnection | ||
Index Name string / Required indexName | Provide a string value for the index name. | prismatic_query_suggestions |
Query String string queryString | Provide a string value for the query string. This is optional. | query=george%20clo&hitsPerPage=2&getRankingInfo=1 |
Get Settings
Get the settings of an index. | key: getSettings
Input | Notes | Example |
---|---|---|
Connection connection / Required algoliaConnection | ||
Index Name string / Required indexName | Provide a string value for the index name. | prismatic_query_suggestions |
Example Payload for Get Settings
{
"data": {
"minWordSizefor1Typo": 4,
"minWordSizefor2Typos": 8,
"hitsPerPage": 20,
"searchableAttributes": null,
"attributesToRetrieve": null,
"attributesToSnippet": null,
"attributesToHighlight": null,
"ranking": [
"typo",
"geo",
"words",
"proximity",
"attribute",
"exact",
"custom"
],
"customRanking": null,
"separatorsToIndex": "",
"queryType": "prefixAll"
}
}
List Indices
Get a list of indices with their associated metadata. | key: listIndexes
Input | Notes |
---|---|
Connection connection / Required algoliaConnection | |
Page string page | Retrieve a specific page. Pages are zero-based. The page size is set to 100. This parameter isn’t set by default, and all indices are retrieved at once. |
Example Payload for List Indices
{
"data": {
"items": [
{
"name": "contacts",
"createdAt": "2013-08-15T19:49:47.714Z",
"updatedAt": "2013-08-17T07:59:28.313Z",
"entries": 2436442,
"dataSize": 224152664,
"fileSize": 269450853,
"lastBuildTimeS": 0,
"numberOfPendingTask": 0,
"pendingTask": false
}
],
"nbPages": 1
}
}
Move Index
Move or rename an index. | key: moveIndex
Input | Notes | Example |
---|---|---|
Connection connection / Required algoliaConnection | ||
Index From string / Required indexFrom | The index to move from. | prismatic_query_suggestions |
Index To string / Required indexTo | The index to move to. | prismatic_query_suggestions |
Example Payload for Move Index
{
"data": {
"updatedAt": "2013-08-21T13:20:18.960Z",
"taskID": 10210332
}
}
Raw Request
Send raw HTTP request to Algolia | key: rawRequest
Input | Default | Notes | Example |
---|---|---|---|
Connection connection / Required algoliaConnection | |||
Data string data | The HTTP body payload to send to the URL. | {"exampleKey": "Example Data"} | |
Debug Request boolean debugRequest | false | Enabling this flag will log out the current request. | |
File Data string Key Value List fileData | File Data to be sent as a multipart form upload. | [{key: "example.txt", value: "My File Contents"}] | |
File Data File Names string Key Value List fileDataFileNames | File names to apply to the file data inputs. Keys must match the file data keys above. | ||
Form Data string Key Value List formData | The Form Data to be sent as a multipart form upload. | [{"key": "Example Key", "value": new Buffer("Hello World")}] | |
Header string Key Value List headers | A list of headers to send with the request. | User-Agent: curl/7.64.1 | |
Max Retry Count string maxRetries | 0 | The maximum number of retries to attempt. | |
Method string / Required method | The HTTP method to use. | ||
Query Parameter string Key Value List queryParams | A list of query parameters to send with the request. This is the portion at the end of the URL similar to ?key1=value1&key2=value2. | ||
Response Type string / Required responseType | json | The type of data you expect in the response. You can request json, text, or binary data. | |
Retry On All Errors boolean retryAllErrors | false | If true, retries on all erroneous responses regardless of type. | |
Retry Delay (ms) string retryDelayMS | 0 | The delay in milliseconds between retries. | |
Timeout string timeout | The maximum time that a client will await a response to its request | 2000 | |
URL string / Required url | Input the path only (/1/indexes/{indexName}), The base URL is already included (https://<CONNECTION_INPUT_APPLICATION_ID>.algolia.net). For example, to connect to https://<CONNECTION_INPUT_APPLICATION_ID>.algolia.net/1/indexes/{indexName}, only /1/indexes/{indexName} is entered in this field. | /1/indexes/{indexName} | |
Use Exponential Backoff boolean useExponentialBackoff | false | Specifies whether to use a pre-defined exponential backoff strategy for retries. |
Search Facet Values
Search for values of a given facet. | key: searchFacetValues
Input | Notes | Example |
---|---|---|
Connection connection / Required algoliaConnection | ||
Facet Name string / Required facetName | Provide a string value for the facet name. | example_facet |
Facet Query string facetQuery | Provide a string value for the facet query. This is optional. | example_query |
Index Name string / Required indexName | Provide a string value for the index name. | prismatic_query_suggestions |
Max Facet Hits string maxFacetHits | Provide a number for the maximum number of facet hits to return. This is optional. | 10 |
Search Multiple Indices
Send multiple search queries, potentially targeting multiple indices, in a single API call. | key: searchMultipleIndices
Input | Default | Notes | Example |
---|---|---|---|
Connection connection / Required algoliaConnection | |||
Requests code / Required requests | Provide a JSON object where each key-value pair represents an index-query pair for the search. | ||
Strategy string / Required strategy | Provide a strategy. The possible values are 'none' and 'stopIfEnoughMatches'. This is optional. | none |
Set Settings
Change an index's settings. | key: setSettings
Input | Default | Notes | Example |
---|---|---|---|
Connection connection / Required algoliaConnection | |||
Forward to Replicas boolean forwardToReplicas | The change is also propagated to replicas of this index. | ||
Index Name string / Required indexName | Provide a string value for the index name. | prismatic_query_suggestions | |
Settings code / Required settings | A mapping of settings parameters you can use on an index. |
Example Payload for Set Settings
{
"data": {
"updatedAt": "2013-08-21T13:20:18.960Z",
"taskID": 10210332
}
}
Update Batch Indices
This method enables you to batch multiple different indexing operations in one API call, like add or delete objects, potentially targeting multiple indices. | key: updateBatchIndices
Input | Notes | Example |
---|---|---|
Connection connection / Required algoliaConnection | ||
Requests code / Required requests | An array of operations to batch. |
Example Payload for Update Batch Indices
{
"data": {
"taskID": {
"contacts": 792,
"public_contacts": 793
},
"objectIDs": [
"6891",
"6892"
]
}
}