The CLI index command
Reference of the DevEx CLI index command that automates indexing operations.
The Sitecore indexing plugin includes an index
command. This command automates indexing operations. To install the indexing plugin, run the following code:
dotnet sitecore plugin add -n Sitecore.DevEx.Extensibility.Indexing --version 4.0.0
Note
This command is available from CLI 4.0 or later.
You can use the command as follows:
dotnet sitecore index [subcommand] [options]
You can use the following subcommands:
Subcommand | Description |
---|---|
| Provides the list of available indexes from the environment |
| Populates the managed schema |
| Rebuilds all the indexes |
| Statistics of all the indexes |
You can use the following options with the list
subcommand:
Option | Required? | Description |
---|---|---|
| Optional | The Sitecore environment to use. Default: |
| Optional | Path to root |
| Optional | Report additional diagnostic and performance data. |
| Optional | Report additional diagnostic and performance data. |
| Optional | Help for the command. |
You can use the following options with the schema-populate
subcommand:
Option | Required? | Description |
---|---|---|
| Optional | Populate theschema for specified indexes. |
| Optional | The Sitecore environment to use. Default: |
| Optional | Path to root sitecore.config directory (default: cwd). |
| Optional | Report additional diagnostic and performance data. |
| Optional | Report additional diagnostic and performance data. |
| Optional | Help for the command. |
You can use the following options with the rebuild
subcommand:
Option | Required? | Description |
---|---|---|
| Optional | Rebuild the specified indexes. |
| Optional | The Sitecore environment to use. Default: |
| Optional | Path to root sitecore.config directory (default: cwd). |
| Optional | Report additional diagnostic and performance data. |
| Optional | Report additional diagnostic and performance data. |
| Optional | Help for the command. |
You can use the following options with the statistic
subcommand:
Option | Required? | Description |
---|---|---|
| Optional | The Sitecore environment to use. Default: |
| Optional | Path to root sitecore.config directory (default: cwd). |
| Optional | Report additional diagnostic and performance data. |
| Optional | Help for the command. |
The following are examples of the index
command use:
Command | Result |
---|---|
| List of Indexes: sitecore_master_index sitecore_core_index |
| The search indexes have been populated. Result: sitecore_core_index [job ended] sitecore_master_index [job ended] sitecore_web_index [job ended] |
| The search indexes have been populated. Result: sitecore_master_index [job ended] |
| The search indexes have been rebuilt. Result: sitecore_core_index [job ended] [units processsed: 13596] sitecore_master_index [job ended] [units processsed: 16620] sitecore_web_index [job ended] [units processsed: 13596] |
| The search indexes have been rebuilt. Result: sitecore_master_index [job ended] [units processsed: 16620] |
| Index statistics: sitecore_core_index Rebuild Time: Never Run Last Updated: 08/13/2021 - 08:45 (UTC) Approximate Throughput: items per second Has Deletions: False Out of Date: False Document Count: 0 Number of Fields: -1 Number of Terms: -1 |