Get Index Operation
-
Use
GetIndexOperation
to retrieve the index definition from the database. -
The operation will execute on the node defined by the client configuration.
However, the index definition returned is taken from the database record,
which is common to all the database-group nodes.
i.e., an index state change done only on a local node is not reflected. -
To get the index state on the local node use
GetIndexStatisticsOperation
. -
In this page:
Get Index example
// Define the get index operation, pass the index name
const getIndexOp = new GetIndexOperation("Orders/Totals");
// Execute the operation by passing it to maintenance.send
const indexDefinition = await store.maintenance.send(getIndexOp);
// Access the index definition
const state = indexDefinition.state;
const lockMode = indexDefinition.lockMode;
const deploymentMode = indexDefinition.deploymentMode;
// etc.
Syntax
const getIndexOp = new GetIndexOperation(indexName);
Parameters | Type | Description |
---|---|---|
indexName | string |
Name of index to get |
Return value of store.maintenance.send(getIndexOp) |
Description |
---|---|
IndexDefinition |
An instance of class IndexDefinition |