Explore related content in the Algolia Academy
Push data to Algolia with the API clients
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. For more information, see:Unique object identifiers
The engine identifies each record with a uniqueobjectID
, 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 approximately 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. For more information, see: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. 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.
- 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).