Skip to content

Console Command Create Index

Kazunobu Yamaguchi edited this page Aug 17, 2014 · 4 revisions

コンソールコマンド: CREATE INDEX

Create Index

The SQL Create Index コマンドはスキーマで定義されたプロパティにインデックスを作成します.

Indexes can be:

  • unique, 重複を許可しない
  • not unique, 重複を許可
  • full-text, テキスト内の単語をインデックス化する. CONTAINSTEXT演算子を使ってクエリを作成できます

構文

    CREATE INDEX <name> [ON <class-name> (prop-names)] <type> [<key-type>]

Where:

  • name インデックスの論理名. Can be <class>.<property> to create an automatic index bound to a schema property. この場合は classはスキーマのクラス, property はクラスに作られたプロパティです. インデックスの名称には '.' を使用できないことに注意してください.
  • class-name name of class that automatic index created for. クラスはデータベース内に存在する必要があります
  • prop-names comma-separated list of properties that this automatic index is created for. プロパティはスキーマ内に存在する必要があります
  • type, 'unique', 'notunique', 'fulltext' が設定可能
  • key-type, キーの型 (オプション). On automatic indexes is auto-determined by reading the target schema property where the index is created. If not specified for manual indexes, at run-time during the first insertion the type will be auto determined by reading the type of the class.

    CREATE INDEX users.Id unique

詳細な情報はCreate index commandを参照してください

index のリファレンスに関しては Index guide 確認してください.

SQL commands に関する詳しい情報は SQL commands を参照.

これは Orient console のコマンドです. 全てのコマンドは Console-Commands から確認してください.

Clone this wiki locally