🎉 Try the public beta of the new docs site at algolia.com/doc-beta! 🎉
Guides / Sending and managing data

Send and update your data

After you have structured your data into records, you need to send it to Algolia to make it searchable.

Index your data without coding

Index your data with coding

Name your index

Choose a unique, readable name, and make sure you don’t use any sensitive or personally identifiable information (PII) as your index name. This includes usernames, user IDs, or email addresses. As index names appear in network requests, you must consider them as being publicly available.

Authenticate with Algolia

You need an application ID and a valid API key to push your data. These credentials protect your data, and you can set different access levels for your team.

Every indexing operation requires these credentials. The application ID gives you access to your indices, and the appropriate API key gives you the permission to perform indexing operations.

Unique object identifiers

The engine identifies each record with a unique objectID, ideally, one you set yourself. If you don’t, Algolia generates them for you. You can retrieve the objectID by browsing the index. Later on, when you need to update or delete records, you must provide the objectID.

Send records in batches

Algolia lets you send one or more records in a single API call or batch records. You can batch your indexing operations with the API or the dashboard.

For optimal indexing performance, you should send your records in batches. An ideal batch size is ~10 MB, representing 1,000 to 10,000 records, depending on the average record size.

Batching reduces network calls and speeds up indexing. You’ll see the most significant performance improvements if you have many records, but it’s good practice for everyone to batch indexing operations whenever possible.

**Batching doesn’t change how Algolia counts indexing operations. ** Every indexing operation adds to your count. If you send several records, each still counts as one operation.

Update your data

After the initial data import, you need to keep your index up-to-date with the latest changes on your app or website. The appropriate update frequency depends on how often your content changes and how fast you need it to be searchable.

Since the engine prioritizes search over indexing updates, you should expect some delays when updating an index.

Take the example of an ecommerce store:

  • You want to update price changes or product availability in real time.
  • You don’t need to update the number of sales (used for custom ranking) as often, so you can periodically send them in batches.

Aim to find a balance between:

  • Getting fresh information into the search experience as quickly as possible
  • Reducing the number of operations (which affects your performance and, potentially, the Algolia pricing).

How to handle multiple users

You can use security-filtering to restrict the data users can see when searching. This allows for dedicated searchable content, which isn’t visible to unauthorized users.

Concurrency

When working in a concurrent environment, you might need more control to guarantee data consistency. The engine supports built-in operations that allow conditional updates based on versioning and optimistic locking.

Third-party integrations

You may use a framework or platform to power your app. Most of these solutions have their own databases and front ends. The goal is to send your data from these platforms to Algolia and manage data updates and search configurations.

Algolia offers several official integrations to simplify the indexing process for popular frameworks and platforms. If you’re using one of the solutions listed below, you can install the corresponding extension to index your content.

Did you find this page helpful?