이 콘텐츠는 선택한 언어로 제공되지 않습니다.

13.2. Creating Standard Indexes


This section describes how to create presence, equality, approximate, substring, and international indexes for specific attributes using the command line and the web console.

Note

When you create a new index type, Directory Server uses this default index as a template for each new database that will be created in future. If you update the default index, the updated settings are not applied to existing databases. To apply a new index to an existing database, use the dsctl db2index command or a cn=index,cn=tasks task, as described in Section 13.3, “Creating New Indexes to Existing Databases”.

13.2.1. Creating Indexes Using the Command Line

Note

You cannot create new system indexes because system indexes are hard-coded in Directory Server.
Use ldapmodify to add the new index attributes to your directory.
  • To create a new index that will become one of the default indexes, add the new index attributes to the cn=default indexes,cn=config,cn=ldbm database,cn=plugins,cn=config entry.
  • To create a new index for a particular database, add it to the cn=index,cn=database_name,cn=ldbm database,cn=plugins,cn=config entry, where cn=database_name corresponds to the name of the database.

Note

Avoid creating entries under cn=config in the dse.ldif file. The cn=config entry in the dse.ldif configuration file is not stored in the same highly scalable database as regular entries. As a result, if many entries, particularly entries that are likely to be updated frequently, are stored under cn=config, performance will probably suffer. Although we recommend you do not store simple user entries under cn=config for performance reasons, it can be useful to store special user entries such as the Directory Manager entry or replication manager (supplier bind DN) entry under cn=config since this centralizes configuration information.
For information on the LDIF update statements required to add entries, see Section 3.1.4, “Updating a Directory Entry”.
For example, to create presence, equality, and substring indexes for the sn (surname) attribute in the Example1 database:
  1. Run ldapmodify and add the LDIF entry for the new indexes:
    # ldapmodify -a -D "cn=Directory Manager" -W -p 389 -h server.example.com -x
    
    dn: cn=sn,cn=index,cn=Example1,cn=ldbm database,cn=plugins,cn=config
    changetype: add
    objectClass:top
    objectClass:nsIndex
    cn:sn
    nsSystemIndex:false
    nsIndexType:pres
    nsIndexType:eq
    nsIndexType:sub
    nsMatchingRule:2.16.840.1.113730.3.3.2.3.1
    Copy to Clipboard Toggle word wrap
    The cn attribute contains the name of the attribute to index, in this example the sn attribute. The entry is a member of the nsIndex object class. The nsSystemIndex attribute is false, indicating that the index is not essential to Directory Server operations. The multi-valued nsIndexType attribute specifies the presence (pres), equality (eq) and substring (sub) indexes. Each keyword has to be entered on a separate line. The nsMatchingRule attribute in the example specifies the OID of the Bulgarian collation order; the matching rule can indicate any possible value match, such as languages or other formats like date or integer.
    You can use the keyword none in the nsIndexType attribute to specify that no indexes are to be maintained for the attribute. This example temporarily disables the sn indexes on the Example1 database by changing the nsIndexType to none:
    dn: cn=sn,cn=index,cn=Example1,cn=ldbm database,cn=plugins,cn=config
    objectClass:top
    objectClass:nsIndex
    cn:sn
    nsSystemIndex:false
    nsIndexType:none
    Copy to Clipboard Toggle word wrap
For a complete list of matching rules and their OIDs, see Section 14.3.4, “Using Matching Rules”, and for the index configuration attributes, see the Red Hat Directory Server Configuration, Command, and File Reference.

Note

Always use the attribute's primary name (not the attribute's alias) when creating indexes. The primary name of the attribute is the first name listed for the attribute in the schema; for example, uid for the user ID attribute.

13.2.2. Creating Indexes Using the Web Console

To create presence, equality, approximate, substring, or international indexes:
  1. Open the Directory Server user interface in the web console. See Section 1.4, “Logging Into Directory Server Using the Web Console”.
  2. Select the instance.
  3. Open the Database menu.
  4. Select the suffix entry.
  5. Open the Indexes tab.
  6. Click the Add Index button.
  7. Select the attribute to index, the type of index, and optionally a matching rule.
  8. Click Create Index.
맨 위로 이동
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다. 최신 업데이트를 확인하세요.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

Theme

© 2025 Red Hat