---
title: "CLIインデックスコマンド"
slug: "the-cli-index-command"
abstract: "インデックス操作を自動化するDevEx CLIインデックスコマンドの参照。"
---
# CLIインデックスコマンド

[Sitecoreインデックスプラグイン](https://doc.sitecore.com/xp/ja/developers/103/developer-tools/indexing-plugin.html "Indexing plugin")にはindexコマンドが含まれています。このコマンドはインデックス操作を自動化します。インデックスプラグインをインストールするには、以下のコードを実行します。

dotnet sitecore plugin add -n Sitecore.DevEx.Extensibility.Indexing --version 4.0.0

> !注このコマンドはCLI 4.0以降から利用可能です。

## 使用例

コマンドの使い方は以下の通りです:

dotnet sitecore index subcommand options

## サブコマンド

以下のサブコマンドを使用できます:

副司令部

概要

list

環境から利用可能なインデックスのリストを提供します

schema-populate

管理スキーマを埋め込む

rebuild

すべてのインデックスを再構築します

statistic

すべての指数の統計

すべてのサブコマンドは権限要求が高い権限を必要とします。

## オプション

listサブコマンドで以下のオプションを使用できます:

オプション

必須ですか?

概要

\-n, --environment-name <environment-name>

オプション

Sitecore環境。デフォルト: default。

\-c, --config <CONFIG>

オプション

ルートディレクトリへのパス sitecore.config (デフォルト:cwd)。

\-v, --verbose

オプション

追加の診断およびパフォーマンスデータを報告してください。

\-t, --trace

オプション

追加の診断およびパフォーマンスデータを報告してください。

\-?, -h, --help

オプション

コマンドの助けを。

schema-populateサブコマンドで以下のオプションを使用できます:

オプション

必須ですか?

概要

\-i, --indexes <list-of-indexes>

オプション

指定されたインデックスのスキーマを埋めます。

\-n, --environment-name <environment-name>

オプション

Sitecore環境。デフォルト: default。

\-c, --config <CONFIG>

オプション

rootの *sitecore.config* ディレクトリへのパス(デフォルト:cwd)。

\-v, --verbose

オプション

追加の診断およびパフォーマンスデータを報告してください。

\-t, --trace

オプション

追加の診断およびパフォーマンスデータを報告してください。

\-?, -h, --help

オプション

コマンドの助けを。

rebuildサブコマンドで以下のオプションを使用できます:

オプション

必須ですか?

概要

\-i, --indexes <list-of-indexes>

オプション

指定されたインデックスを再構築します。

\-n, --environment-name <environment-name>

オプション

Sitecore環境。デフォルト: default。

\-c, --config <CONFIG>

オプション

rootの *sitecore.config* ディレクトリへのパス(デフォルト:cwd)。

\-v, --verbose

オプション

追加の診断およびパフォーマンスデータを報告してください。

\-t, --trace

オプション

追加の診断およびパフォーマンスデータを報告してください。

\-?, -h, --help

オプション

コマンドの助けを。

statisticサブコマンドで以下のオプションを使用できます:

オプション

必須ですか?

概要

\-n, --environment-name <environment-name>

オプション

Sitecore環境。デフォルト: default。

\-c, --config <CONFIG>

オプション

rootの *sitecore.config* ディレクトリへのパス(デフォルト:cwd)。

\-t, --trace

オプション

追加の診断およびパフォーマンスデータを報告してください。

\-?, -h, --help

オプション

コマンドの助けを。

## 例

以下はindexコマンドの使用例です。

-   コマンド:結果
-   dotnet sitecore index list:

List of Indexes:
sitecore\_master\_index
sitecore\_core\_index

-   dotnet sitecore index schema-populate:

The search indexes have been populated.

Result:
sitecore\_core\_index job ended
sitecore\_master\_index job ended
sitecore\_web\_index job ended

-   dotnet sitecore index schema-populate -i sitecore\_master\_index:

The search indexes have been populated.

Result:
sitecore\_master\_index job ended

-   dotnet sitecore index rebuild:

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

-   dotnet sitecore index rebuild -i sitecore\_master\_index:

The search indexes have been rebuilt.

Result:
sitecore\_master\_index job ended units processsed: 16620

-   dotnet sitecore index statistic:

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