Get Index Operation


  • Use GetIndexOperation to retrieve an 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
var getIndexOp = new GetIndexOperation("Orders/Totals");

// Execute the operation by passing it to Maintenance.Send
IndexDefinition index = store.Maintenance.Send(getIndexOp);

// Access the index definition
var state = index.State;
var lockMode = index.LockMode;
var deploymentMode = index.DeploymentMode;
// etc.
// Define the get index operation, pass the index name
var getIndexOp = new GetIndexOperation("Orders/Totals");

// Execute the operation by passing it to Maintenance.SendAsync
IndexDefinition index = await store.Maintenance.SendAsync(getIndexOp);

// Access the index definition
var state = index.State;
var lockMode = index.LockMode;
var deploymentMode = index.DeploymentMode;
// etc.

Syntax

public GetIndexOperation(string indexName)
Parameters Type Description
indexName string Name of index to get
Return value of store.Maintenance.Send(getIndexOp)
IndexDefinition An instance of class IndexDefinition