Skip to main content

Commands: Indexes: Get

There are few methods that allow you to retrieve an index from a database:

GetIndex

GetIndex is used to retrieve an index definition from a database.

Syntax

IndexDefinition GetIndex(string name);
Parameters
namestringname of an index
Return Value
IndexDefinitionInstance of IndexDefinition representing index.

Example

IndexDefinition index = store.DatabaseCommands.GetIndex("Orders/Totals");

GetIndexes

GetIndexes is used to retrieve multiple index definitions from a database.

Syntax

IndexDefinition[] GetIndexes(int start, int pageSize);
Parameters
startstringNumber of indexes that should be skipped
pageSizeintMaximum number of indexes that will be retrieved
Return Value
IndexDefinitionInstance of IndexDefinition representing index.

Example

IndexDefinition[] indexes = store.DatabaseCommands.GetIndexes(0, 10);

GetIndexNames

GetIndexNames is used to retrieve multiple index names from a database.

Syntax

string[] GetIndexNames(int start, int pageSize);
Parameters
startstringNumber of index names that should be skipped
pageSizeintMaximum number of index names that will be retrieved
Return Value
string[]This methods returns an array of index name as a result.

Example

string[] indexNames = store.DatabaseCommands.GetIndexNames(0, 10);