Api clients / JavaScript / V3 / Methods

List Indices | JavaScript API Client V3 (Deprecated)

This version of the JavaScript API client has been deprecated in favor of the latest version of the JavaScript API client.

Required API Key: any key with the listIndexes ACL
Method signature
client.listIndexes(callback)

About this method

Get a list of indices with their associated metadata.

This method retrieves a list of all indices associated with a given application id.

The returned list includes the name of the index as well as its associated metadata, such as the number of records, size, last build time, and pending tasks.

Calling this method returns all indices, with no paging. So if there are 1000s of indices for a certain application id, then all 1000 indices will be returned at the same time.

The returned list complies with any ACL restrictions of the API key used to retrieve them. For example, if you’re using an API key that only has access to some indices, you will only retrieve these.

Examples

1
var_dump($client->listIndices());

Parameters

No parameters for this method.

Response

In this section we document the JSON response returned by the API. Each language will encapsulate this response inside objects specific to the language and/or the implementation. So the actual type in your language might differ from what is documented.

JSON format

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
{
  "items":[
    {
      "name": "airports",
      "createdAt": "2017-05-15T08:09:45.173Z",
      "updatedAt": "2017-05-15T08:09:45.173Z",
      "entries":  1005,
      "dataSize": 0,
      "fileSize": 0,
      "lastBuildTimeS": 1,
      "numberOfPendingTasks": 0,
      "pendingTask": false
    },
    [...]
  ],
  "nbPages":1
}
items
list of
nbPages
integer

The value is always 1. There is currently no pagination for this method. Every index is returned on the first call.

items ➔ index object

name
string

Index name.

createdAt
string

Index creation date.

updatedAt
string

Date of last update.

entries
integer

Number of records contained in the index.

dataSize
integer

Number of bytes of the index in minified format.

fileSize
integer

Number of bytes of the index binary file.

lastBuildTimeS
integer

Last build time in seconds.

numberOfPendingTasks
integer

Number of pending indexing operations.

pendingTask
boolean

A boolean which says whether the index has pending tasks.

Did you find this page helpful?