- Data cleaning. Correct inconsistencies or errors discovered after indexing, rename attributes, or change data types.
- A/B testing. Create variations of attributes for testing different ranking strategies.
- Index optimizations. Bucket, compute new values, convert units of measure.
The Algolia Index connector transforms indexed records without changing your source data.
If a correction requires original values that are no longer in the index, retrieve them from the source.
Get started
- Go to the Algolia dashboard and select your Algolia .
- On the left sidebar, select Data sources.
- On the Connectors page, select the Algolia Index connector and click Connect.
- Choose the index to transform.
- Create a new transformation or reuse an existing one.
- Create the task.
-
Choose when the task runs:
- On demand. You can manually trigger the task from the Task page in the dashboard, or using the API.
- Scheduled. You can select a schedule from the list, or enter a custom schedule with a cron expression.
0 */4 * * *and all predefined schedules, such as Every day, Algolia offsets each task’s scheduled run time by a fixed amount to distribute task executions over time. A task uses the same offset for every run. The offset is always shorter than the interval between runs. For example,0 */4 * * *schedules a task every four hours, starting at 00:00 UTC. With an offset of 2 hours and 37 minutes, the task would instead run at 02:37, 06:37, and 10:37 UTC. To schedule a task at specific times, list the hours in the cron expression. For example,0 0,4,8,12,16,20 * * *schedules a task at 00:00, 04:00, 08:00, 12:00, 16:00, and 20:00 UTC.
Costs
The Algolia Index connector browses your and re-applies the changes. Depending on the indexing strategy you choose, this adds read and write operations. These operations might lead to costs, depending on your plan. To control how often your connector task runs, change the schedule in the task configuration.Performance considerations
If you don’t need an Algolia-managed transformation step, send records directly to Algolia instead. The Algolia Index connector adds overhead to your ingestion process.Filter the source index
If your transformation doesn’t need to run over the whole index, set thefilters property on the Algolia Index connector source to restrict the records the connector browses.
Filtering at the source can reduce extraction time, read operations, and task duration.
Use the same syntax as the Search API filters parameter.
Declare attributes used in facet filters in attributesForFaceting on the source index.
Constraints
- Index size: no limit on the index size.
- Duration: each run can’t take longer than 60 minutes.
Choose an indexing strategy
Conflicting updates from multiple processes can cause data drift, leaving indexed values or computed attributes out of date. Choose an indexing strategy that preserves updates from your primary ingestion process. The connector reads records from an Algolia index and applies transformations. Make sure this workflow doesn’t conflict with your primary ingestion method, such as the API or another connector.Conflicts with full record updates
Be careful when using the Algolia Index connector with ingestion methods that use the full record updates action with real-time updates. Full record updates replace the entire record. If another process replaces a record after the connector updates it, that replacement can overwrite the transformed attributes. If the connector replaces a record using data read before another update, it can overwrite newer values. The following Algolia ecommerce integrations use the full record updates by default:Other connectors and API clients using partial record updates
Connectors and API clients using partial record updates work with the Algolia Index connector. Partial record updates change only the specified attributes and preserve other attributes. Concurrent updates to the same attributes can still overwrite each other. To avoid data loss, select your indexing strategy when using the Algolia Index connector and prefer partial updates whenever possible.- Partial record updates (recommended) updates selected attributes in your while preserving other attributes.
- Full record updates replaces individual records and can overwrite concurrent changes to those records. Avoid this strategy.
- Full reindexing replaces your index and can overwrite concurrent changes. Avoid this indexing strategy.
Example of concurrent updates
The following scenario illustrates a potential issue when an API client and the Algolia Index connector try to update the same index:-
API client:
- Ingests product data, including
price,category, andinventory. - Uses partial record updates.
- Runs on a cron job every hour.
- Ingests product data, including
-
Algolia Index connector:
- Reads records from the Algolia index and adds a new attribute,
discounted_price, based on theprice. - Uses partial record updates.
- Reads records from the Algolia index and adds a new attribute,
Outdated computed attributes
Concurrent updates can leave computed attributes out of date. For example, suppose the API client updates a product’sprice at 10 AM.
The Algolia Index connector reads that price at 10:07 AM and calculates discounted_price.
If the API client updates price again at 11 AM before the connector writes discounted_price,
the connector writes a value based on the earlier price.