Skip to main content
Use the Push to Algolia connector when your app controls which records to index and when to send them. Your app sends records to a connector task with an API client. Algolia transforms the records and writes them to the destination index. If Algolia can retrieve your data directly, use another connector. For example, use the JSON connector if your records are available as a hosted JSON file and you want Algolia to fetch them on demand or on a schedule without an indexing script. If your records don’t need an Algolia-managed transformation, send them directly with an API client.

Quickstart

Create a transformation, destination, and task for a public product dataset, then run a Node.js script that pushes the records through the connector. The script uses pushTask to identify the connector task explicitly by its task ID.

Before you begin

Make sure you have:

Set up the Push to Algolia connector

1

Open the Push to Algolia connector

Go to the Algolia dashboard and select your Algolia . On the left sidebar, select Data sources, then open the Connectors page.
2

Connect the source

Select Push to Algolia, then select Connect.
3

Transform the records

This transformation adds a price_range attribute to each record. After the connector indexes your records, you can display price_range or configure it as a facet.Select Transform using the code editor and replace the placeholder Transformation code with this function:
JavaScript
Save the transformation.
4

Select index and credentials

Select Create a new destination to choose an for the connector to store records.Under Connect your data to Algolia Search, enter quickstart-products and, under Index credentials, select Create one for me.
Use a new index for this quickstart to avoid adding new records to it.
5

Create the destination

In Name, enter Quickstart push destination and select Create destination.
6

Create the task

Select Create task. The dashboard opens API Client & Code snippets with a generated pushTask example.Copy the taskID value from the example, then select Close.Continue with the next step instead of copying the generated records or code. The next steps use environment variables to keep your API key out of the source code.
7

Create a Node.js project

In a terminal, create a project and install the Algolia API client and dotenv:
Command line
8

Add your Algolia credentials

Create a .env file in the project directory:
.env
Set the variables to your Algolia application ID, write API key, analytics region, and task ID.To keep your Write API key secret, create a .gitignore file in the project directory:
.gitignore
9

Push the sample records

Create a push.mjs file with this code:
push.mjs
Run the script:
Command line
Copy the Run ID printed by the script.
10

Verify the indexing operation

Open the Connector Debugger and search for the run ID printed by push.mjs. Confirm that the operation completed successfully.Open the quickstart-products index in the Algolia dashboard. Confirm that it contains product records with attributes such as title, description, product_type, price, price_range, and showcase_image.
You can use this index as the data source for Build your first search experience. Before you start the UI steps in that quickstart, configure product_type as a facet for the quickstart-products index.

Use the connector with your app

In production, replace the quickstart data request in push.mjs with code that selects records from your app or data pipeline. For example, supply records from a processing job or a source for which Algolia doesn’t provide another connector.

Prepare your records

Send only the records required by the indexing operation. For example, your app can send a changed record after updating its source data instead of exporting and synchronizing the full dataset. Ensure each record has a stable, unique objectID. If your source uses a different unique property, map it before pushing the records:
JavaScript
Update your transformation to match your record structure. If you want to make a transformed attribute searchable, use it for faceting, or use it for ranking, update the corresponding index setting: searchableAttributes, attributesForFaceting, or customRanking.

Choose an API client method

Choose a method based on how you want to identify the connector task and update the index.
  • push, chunkedPush, and the WithTransformation helper methods select a user-created Push to Algolia task by index name. They support one user-created Push to Algolia connector, including when the index also uses Collections.
  • If multiple destinations link to the index or multiple user-created Push to Algolia connectors target it, use pushTask and specify the task ID. To send records through the Collections pipeline, use its task ID with pushTask.

Push with the Ingestion API

Use the Ingestion API client to choose the indexing action or identify a connector task by ID.

Push by task ID

Use pushTask to select a connector task by its task ID.

Push by index name

Use push when one task targets the specified index. The request returns an error if no task or more than one task matches the index name.

Push records in batches

Use chunkedPush to split a large record set into batches and send each batch with push. The default batch size is 1,000 records. Use it directly when you need more control over the indexing action or batch size.

Search API WithTransformation methods

Use the Search API client helpers to adapt an existing implementation that calls saveObjects, partialUpdateObjects, or replaceAllObjects. The helpers route records through the Push to Algolia connector and automatically split them into batches. They’re subject to the connector limits. To run the examples, install the latest API client.

Set up transformation options

Before calling a WithTransformation method, configure transformationOptions with your Algolia application’s analytics region. The API client throws an error if you omit transformationOptions.
transformationOptions creates a dedicated ingestion transporter that starts from the Ingestion API defaults: 25-second timeouts, hosts derived from the region, and no compression. It only overrides the options you set and doesn’t inherit the Search API client’s configuration. For more information, see Transformation options and the ingestion transporter.
transformationOptions replaces the deprecated setTransformationRegion method in Java, C#, and PHP, the set_transformation_region method in Python, and the transformation option in JavaScript.

Add or replace records with a transformation

To add or replace complete records with a transformation, call saveObjectsWithTransformation.

Add or update record attributes with a transformation

To add or update selected attributes with a transformation, call partialUpdateObjectsWithTransformation.

Replace all records with a transformation

To replace all records with a transformation, call replaceAllObjectsWithTransformation.

Supported indexing actions

The Push to Algolia connector supports all values of the action property for batch indexing operations. For deleteObject, delete, and clear actions, the connector skips the transformation and uses traditional indexing.

Connector Debugger

To debug push operations:
  • Check incoming events in the Connector Debugger. The runID returned by a successful push or pushTask request identifies the indexing operation.
  • To wait for a push or pushTask operation and receive its result in the response, add the watch parameter. The response reports successful and failed operations.

Limitations

This connector is subject to the following limitations:

See also

Last modified on July 31, 2026