PingDirectory

Working with local DB VLV indexes

Local database (DB) virtual list view (VLV) indexes allow a client to request a subset of results from a sorted list that match a specific search base, scope, and filter.

The client can navigate through the list by passing a context back to the server with the virtual list view control. The local DB VLV index can be used only when the client request contains the VLV control and the client has been authorized with an access control instruction (ACI) with a targetcontrol of 2.16.840.1.113730.3.4.9.

A client request, which includes a virtual list view control, can be successfully processed without a matching local DB VLV index if the search is completely indexed. This is not an efficient means of using VLV since the server has to retrieve each entry twice.

Viewing the list of local DB VLV indexes

Steps

  • To view the default list of indexes, use dsconfig with the list-local-db-vlv-indexes option.

    Example:

    In this example, no VLV indexes are defined.

    $ bin/dsconfig list-local-db-vlv-indexes --backend-name userRoot

Creating a new local DB VLV index

Steps

  1. Use dsconfig with the create-local-db-vlv-index option and the --index-name, --backend-name, and --set index-type:(propertyValue) options.

    If you do not set any property values, the default values are assigned.

    Example:

    $ bin/dsconfig create-local-db-vlv-index \
      --index-name givenName --backend-name userRoot --set base-dn:dc=example,dc=com \
      --set scope:whole-subtree --set filter:"(objectclass=*)" \
      --set sort-order:givenName
  2. Rebuild the index using the rebuild-index tool.

    You must add the vlv. prefix to the index name to rebuild the VLV index.

    Example:

    The following command can be run with the server on or offline with the addition of the --task and connection options.

    $ bin/rebuild-index --baseDN dc=example,dc=com --index vlv.givenName

Modifying a VLV index’s configuration

Steps

  1. Use dsconfig with the set-local-db-vlv-index-prop option and the --index-name and --backend-name properties.

    Example:

    In this example, update the base-dn property.

    $ bin/dsconfig set-local-db-vlv-index-prop --index-name givenName \
      --backend-name userRoot --set base-dn:ou=People,dc=example,dc=com
  2. Rebuild the index using the rebuild-index tool.

    You must add the prefix vlv. to the index name.

    Example:

    The following command can be run with the server on or offline with the addition of the --task and connection options.

    $ bin/rebuild-index --baseDN dc=example,dc=com --index vlv.givenName

Rebuilding a VLV index

When rebuilding specific non-attribute indexes, it is important to include any appropriate prefixes or postfixes with the index name to avoid errors.

Steps

  • When rebuilding a VLV index with the rebuild-index tool, the index name must be preceded by vlv.

    bin/rebuild-index --index vlv.thisIndexName

    For the exact name to use in rebuilding the index, run the dbtest tool with the list-database-containers option and --backendID property.

    +

    bin/dbtest list-database-containers --backendID {backendID}

Deleting a VLV index

About this task

Delete a VLV index using the dsconfig tool. Before deleting it, check that the index is not being used in any plugin applications.

Steps

  1. To remove a VLV index from the database, use dsconfig with the delete-local-db-vlv-index option.

    Example:

    $ bin/dsconfig delete-local-db-vlv-index --index-name givenName \
      --backend-name userRoot
  2. To verify the deletion, try to view the VLV index.

    Example:

    $ bin/dsconfig get-local-db-vlv-index-prop --index-name givenName \
      --backend-name userRoot