Manage indices API client methods

This is documentation for v3 of the PHP API clients, which is not the latest version. To see the documentation for the latest version, see PHP v4.

This is documentation for v2 of the Ruby API clients, which is not the latest version. To see the documentation for the latest version, see Ruby v3.

This is documentation for v4 of the JavaScript API clients, which is not the latest version. To see the documentation for the latest version, see JavaScript v5.

This is documentation for v3 of the Python API clients, which is not the latest version. To see the documentation for the latest version, see Python v4.

This is documentation for v8 of the Swift API clients, which is not the latest version. To see the documentation for the latest version, see Swift v9.

This is documentation for v2 of the Kotlin API clients, which is not the latest version. To see the documentation for the latest version, see Kotlin v3.

This is documentation for v6 of the C# API clients, which is not the latest version. To see the documentation for the latest version, see C# v7.

This is documentation for v3 of the Java API clients, which is not the latest version. To see the documentation for the latest version, see Java v4.

This is documentation for v3 of the Go API clients, which is not the latest version. To see the documentation for the latest version, see Go v4.

This is documentation for v1 of the Scala API clients, which is not the latest version. To see the documentation for the latest version, see Scala v2.

List of methods

Create an index

Algolia creates a new index when you add a new object or add a setting to an empty index for the first time. Initializing a new index with the API client doesn’t create a new index on Algolia’s servers.

Don’t use sensitive or personally identifiable information (PII) as your index name, including names, user IDs, or email addresses. Index names appear in network requests and are publicly visible.

Asynchronous methods

All methods for managing indices are asynchronous. Calling these methods adds a new job to a queue: it’s this job, and not the method, that performs the desired action. Usually, the job takes seconds or milliseconds, but this depends on what’s in the queue: if the queue has many pending tasks, the new job must wait its turn.

To help managing the job queue, each method returns a unique taskID which you can pass to the waitTask method. Waiting for a task guarantees that the job has finished before proceeding with your new requests. Use waitTask to manage dependencies, for example, when deleting an index before creating a new index with the same name, or clearing an index before adding new objects.

Analytics data

Analytics data is connected to an index, and uses the index’s name.

Analytics data is collected on a separate server, using separate processes to your main indices. There’s no hard link between your indices and the collection and storage of their analytics data. They’re two sets of data on separate servers. Therefore, actions like deleting or moving an index don’t affect your analytics data.

Copying or moving an index doesn’t transfer analytics data from source to destination:

  • The analytics data stays on the source index.
  • The destination index doesn’t gain any new analytics data.

Even if you delete an index or change its name, the analytics data isn’t erased: you can still access it from the dashboard’s Analytics menu (by first creating a new blank index using the original index name).

Did you find this page helpful?