Back to top

ReQL command: index_status

Command syntax

table.index_status([, index...]) → array

Description

Get the status of the specified indexes on this table, or the status of all indexes on this table if no indexes are specified.

The result is an array where for each index, there will be an object like this one:

{
    "index": <index_name>,
    "ready": True,
    "function": <binary>,
    "multi": <bool>,
    "outdated": <bool>
}

or this one:

{
    "index": <index_name>,
    "ready": False,
    "progress": <float>,
    "function": <binary>,
    "multi": <bool>,
    "outdated": <bool>
}

The multi field will be true or false depending on whether this index was created as a multi index (see index_create for details). The outdated field will be true if the index is outdated in the current version of RethinkDB and needs to be rebuilt. The progress field is a float between 0 and 1, indicating how far along the server is in constructing indexes after the most recent change to the table that would affect them. (0 indicates no such indexes have been constructed; 1 indicates all of them have.)

The function field is a binary object containing an opaque representation of the secondary index (including the multi argument if specified). It can be passed as the second argument to index_create to create a new index with the same function; see index_create for more information.

Example: Get the status of all the indexes on test:

r.table('test').index_status().run(conn)

Example: Get the status of the timestamp index:

r.table('test').index_status('timestamp').run(conn)

Example: Save the binary representation of the index:

func = r.table('test').index_status('timestamp').nth(0)['function'].run(conn)

Get more help

Couldn't find what you were looking for?