Skip to main content

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.

InputNotesExample
API Key

Your Algolia API Key

YourAlgoliaAPIKey
Application ID

Your Algolia Application ID

YourAlgoliaApplicationId

Actions

Browse Index

Retrieve all objects from an index. | key: browseIndex

InputNotesExample
Connection
Cursor

Provide a string value for the cursor. This is optional.

cursor:AhNmaWx0ZXJzPWxhbmd1YWdlOmVuAgEoMjAyMjJlNjNjNjliZGQ1NWRkYzcyOGU3Y2M4M2M2ZDRiODI3ZmQ1Mw==
Index Name

Provide a string value for the index name.

acme_query_suggestions
Search Parameters

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

InputNotesExample
Connection
Index From

The index to copy from.

acme_query_suggestions
Index To

The index to copy to.

acme_query_suggestions

{
"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

InputNotesExample
Connection
Index From

The index to copy the settings from.

acme_query_suggestions
Index To

The index to copy the settings to.

acme_query_suggestions

{
"data": {
"updatedAt": "2013-08-21T13:20:18.960Z",
"taskID": 10210332
}
}

Delete Index

Delete an index. | key: deleteIndex

InputNotesExample
Connection
Index Name

The index name to delete.

acme_query_suggestions

{
"data": {
"deletedAt": "2013-01-18T15:33:13.556Z",
"taskID": 721
}
}

Get Index

Get index information | key: getIndex

InputNotesExample
Connection
Index Name

Provide a string value for the index name.

acme_query_suggestions
Query String

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

InputNotesExample
Connection
Index Name

Provide a string value for the index name.

acme_query_suggestions

{
"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

InputNotesExample
Connection
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.

{
"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

InputNotesExample
Connection
Index From

The index to move from.

acme_query_suggestions
Index To

The index to move to.

acme_query_suggestions

{
"data": {
"updatedAt": "2013-08-21T13:20:18.960Z",
"taskID": 10210332
}
}

Raw Request

Send raw HTTP request to Algolia | key: rawRequest

InputNotesExample
Connection
Data

The HTTP body payload to send to the URL.

{"exampleKey": "Example Data"}
Debug Request

Enabling this flag will log out the current request.

false
File Data

File Data to be sent as a multipart form upload.

[{key: "example.txt", value: "My File Contents"}]
File Data File Names

File names to apply to the file data inputs. Keys must match the file data keys above.

Form Data

The Form Data to be sent as a multipart form upload.

[{"key": "Example Key", "value": new Buffer("Hello World")}]
Header

A list of headers to send with the request.

User-Agent: curl/7.64.1
Max Retry Count

The maximum number of retries to attempt. Specify 0 for no retries.

0
Method

The HTTP method to use.

Query Parameter

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

The type of data you expect in the response. You can request json, text, or binary data.

json
Retry On All Errors

If true, retries on all erroneous responses regardless of type. This is helpful when retrying after HTTP 429 or other 3xx or 4xx errors. Otherwise, only retries on HTTP 5xx and network errors.

false
Retry Delay (ms)

The delay in milliseconds between retries. This is used when 'Use Exponential Backoff' is disabled.

0
Timeout

The maximum time that a client will await a response to its request

2000
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

Specifies whether to use a pre-defined exponential backoff strategy for retries. When enabled, 'Retry Delay (ms)' is ignored.

false

Search Facet Values

Search for values of a given facet. | key: searchFacetValues

InputNotesExample
Connection
Facet Name

Provide a string value for the facet name.

example_facet
Facet Query

Provide a string value for the facet query. This is optional.

example_query
Index Name

Provide a string value for the index name.

acme_query_suggestions
Max Facet Hits

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

InputNotesExample
Connection
Requests

Provide a JSON object where each key-value pair represents an index-query pair for the search.

Strategy

Provide a strategy. The possible values are 'none' and 'stopIfEnoughMatches'. This is optional.

none

Set Settings

Change an index's settings. | key: setSettings

InputNotesExample
Connection
Forward to Replicas

The change is also propagated to replicas of this index.

false
Index Name

Provide a string value for the index name.

acme_query_suggestions
Settings

A mapping of settings parameters you can use on an index.

{
"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

InputNotesExample
Connection
Requests

An array of operations to batch.

{
"data": {
"taskID": {
"contacts": 792,
"public_contacts": 793
},
"objectIDs": [
"6891",
"6892"
]
}
}