1.4. デフォルトインデックスの維持
Directory Server は、デフォルトのインデックス属性を、cn=default indexes,cn=config,cn=ldbm database,cn=plugins,cn=config
エントリーに格納します。なお、デフォルトのインデックス属性を維持できるのは、LDIF ステートメントを使用した場合のみです。
手順
たとえば、インデックスタイプが
eq
とsub
のデフォルトインデックスにroom Number
属性を追加するには、次のように入力します。#
ldapadd -D "cn=Directory Manager" -W -H ldap://server.example.com -x
dn: cn=roomNumber,cn=default indexes,cn=config,cn=ldbm database,cn=plugins,cn=config objectClass: nsIndex objectClass: top cn: roomNumber nsSystemIndex: false nsIndexType: eq nsIndexType: sub以下は、LDIF ステートメントの説明です。
-
objectClass: nsIndex
: このエントリーがインデックスエントリーであることを定義します。 -
objectClass: top
: このオブジェクトクラスは、インデックスエントリーで追加的に必要となります。 -
cn
: インデックスに属性の名前を設定します。 -
nsSystemIndex
: インデックスが Directory Server の運用に必須であるかどうかを示します。 -
nsIndexType
: この多値属性は、インデックスタイプを指定します。
-
たとえば、
roomNumber
属性のデフォルトのインデックス属性にpres
インデックスタイプを追加するには、次のように入力します。#
ldapmodify -D "cn=Directory Manager" -W -H ldap://server.example.com -x
dn: cn=roomNumber,cn=default indexes,cn=config,cn=ldbm database,cn=plugins,cn=config changetype: modify add: nsIndexType nsIndexType: presたとえば、
room Number
属性のデフォルトのインデックス属性からpres
インデックスタイプを削除するには、次のように入力します。#
ldapmodify -D "cn=Directory Manager" -W -H ldap://server.example.com -x
dn: cn=roomNumber,cn=default indexes,cn=config,cn=ldbm database,cn=plugins,cn=config changetype: modify delete: nsIndexType nsIndexType: presたとえば、デフォルトのインデックスから
room Number
属性を削除するには、次のように入力します。#
ldapdelete -D "cn=Directory Manager" -W -H ldap://server.example.com -x cn=roomNumber,cn=default indexes,cn=config,cn=ldbm database,cn=plugins,cn=config
検証
デフォルトのインデックス属性をリスト表示して、変更を確認します。
#
ldapsearch -H ldap://server.example.com:389 -D "cn=Directory Manager" -W -b "cn=default indexes,cn=config,cn=ldbm database,cn=plugins,cn=config" -x -s one -o ldif-wrap=no