13.7. Deleting Indexes

This section describes how to remove attributes and index types from the index.

13.7.1. Deleting an Attribute from the Default Index Entry

When using the default settings of Directory Server, several attributes listed in the default index entry, such as sn, are indexed. The following attributes are part of the default index:

Table 13.1. Default Index Attributes

aci
cn
entryusn
givenName
mail
mailAlternateAddress
mailHost
member
memberOf
nsUniqueId
ntUniqueId
ntUserDomainId
numsubordinates
objectclass
owner
parentid
seeAlso
sn
telephoneNumber
uid
uniquemember

Warning

Removing system indexes can significantly affect the Directory Server performance.
For example, to remove the sn attribute from the default index:
  1. Remove the attribute from the cn=default indexes,cn=config,cn=ldbm database,cn=plugins,cn=config entry:
    # ldapdelete -D "cn=Directory Manager" -W -p 389 -h server.example.com -x
    cn=sn,cn=default indexes,cn=config,cn=ldbm database,cn=plugins,cn=config
    If you do not remove the attribute from this entry, the index for the sn attribute is automatically recreated and corrupted after the server is restarted.
  2. Remove the cn=attribute_name,cn=index,cn=userRoot,cn=ldbm database,cn=plugins,cn=config entry. For details, see Section 13.7.2, “Removing an Attribute from the Index”

13.7.2. Removing an Attribute from the Index

In certain situations you want to remove an attribute from the index. This section describe the procedure using the command line and using the web console.

13.7.2.1. Removing an Attribute from the Index Using the Command Line

To remove an attribute from the index:
  1. If the attribute to remove is listed in the cn=default indexes,cn=config,cn=ldbm database,cn=plugins,cn=config default index entry, remove it from this entry first. For details, see Section 13.7.1, “Deleting an Attribute from the Default Index Entry”.
  2. Remove the attribute from the index. For example:
    # ldapdelete -D "cn=Directory Manager" -W -p 389 -h server.example.com -x
    cn=sn,cn=index,cn=database_name,cn=ldbm database,cn=plugins,cn=config
    After deleting the entry, Directory Server no longer maintains the index for the attribute.

13.7.2.2. Removing an Attribute from the Index Using the Web Console

To remove an attribute from the index:
  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 Actions button next to the attribute for which you want to remove the index, and select Delete Index.
  7. Click Yes to confirm.

13.7.3. Deleting Index Types Using the Command Line

For example, to remove the sub index type of the sn attribute from the index:
  1. Remove the index type:
    # ldapmodify -D "cn=Directory Manager" -W -x
    
    dn: cn=sn,cn=index,cn=database_name,cn=ldbm database,cn=plugins,cn=config
    changetype: modify
    delete: nsIndexType
    nsIndexType: sub
    After deleting the index entry, Directory Server no longer maintains the substring index for the attribute.

13.7.4. Removing Browsing Indexes

This section describes how to remove browsing entries from a database.

13.7.4.1. Removing Browsing Indexes Using the Command Line

The entries for an alphabetical browsing index and virtual list view (VLV) are the same. This section describes the steps involved in removing browsing indexes.
To remove a browsing index or virtual list view index using the command line:
  1. Remove the browsing index entries from the cn=index,cn=database_name,cn=ldbm database,cn=plugins,cn=config entry. For example:
    # ldapdelete -D "cn=Directory Manager" -W -p 389 -h server.example.com -x "cn=MCC ou=People dc=example dc=com,cn=userRoot,cn=ldbm database,cn=plugins,cn=config" "cn=by MCC ou=People dc=example dc=com,cn=MCC ou=People dc=example dc=com,cn=userRoot,cn=ldbm database,cn=plugins,cn=config"
    After deleting the two browsing index entries, Directory Server no longer maintains these indexed.