The CLI index command
Version:
The Sitecore indexing plugin includes an index command. This command automates indexing operations. To install the indexing plugin, run the following code:
Note
This command is available from CLI 4.0 or later.
Usage
Usage
You can use the command as follows:
Subcommands
Subcommands
You can use the following subcommands:
| Subcommand | Description |
|---|---|
list | Provides the list of available indexes from the environment |
schema-populate | Populates the managed schema |
rebuild | Rebuilds all the indexes |
statistic | Statistics of all the indexes |
All the subcommands require elevated permissions.
Options
Options
You can use the following options with the list subcommand:
| Option | Required? | Description |
|---|---|---|
-n, --environment-name <environment-name> | Optional | The Sitecore environment to use. Default: default. |
-c, --config <CONFIG> | Optional | Path to root sitecore.config directory (default: cwd). |
-v, --verbose | Optional | Report additional diagnostic and performance data. |
-t, --trace | Optional | Report additional diagnostic and performance data. |
-?, -h, --help | Optional | Help for the command. |
You can use the following options with the schema-populate subcommand:
| Option | Required? | Description |
|---|---|---|
-i, --indexes <list-of-indexes> | Optional | Populate the schema for specified indexes. |
-n, --environment-name <environment-name> | Optional | The Sitecore environment to use. Default: default. |
-c, --config <CONFIG> | Optional | Path to root sitecore.config directory (default: cwd). |
-v, --verbose | Optional | Report additional diagnostic and performance data. |
-t, --trace | Optional | Report additional diagnostic and performance data. |
-?, -h, --help | Optional | Help for the command. |
You can use the following options with the rebuild subcommand:
| Option | Required? | Description |
|---|---|---|
-i, --indexes <list-of-indexes> | Optional | Rebuild the specified indexes. |
-n, --environment-name <environment-name> | Optional | The Sitecore environment to use. Default: default. |
-c, --config <CONFIG> | Optional | Path to root sitecore.config directory (default: cwd). |
-v, --verbose | Optional | Report additional diagnostic and performance data. |
-t, --trace | Optional | Report additional diagnostic and performance data. |
-?, -h, --help | Optional | Help for the command. |
You can use the following options with the statistic subcommand:
| Option | Required? | Description |
|---|---|---|
-n, --environment-name <environment-name> | Optional | The Sitecore environment to use. Default: default. |
-c, --config <CONFIG> | Optional | Path to root sitecore.config directory (default: cwd). |
-t, --trace | Optional | Report additional diagnostic and performance data. |
-?, -h, --help | Optional | Help for the command. |
Examples
Examples
The following are examples of the index command use:
- Command: Result
dotnet sitecore index list:
dotnet sitecore index schema-populate:
dotnet sitecore index schema-populate -i sitecore_master_index:
dotnet sitecore index rebuild:
dotnet sitecore index rebuild -i sitecore_master_index:
dotnet sitecore index statistic:
If you have suggestions for improving this article, let us know!