1. To create a filtered index, use the dsconfig tool.

    The following command creates an equality index on the companyDomain attribute and maintains an index for the equality filter defined "(objectclass=company)".

    $ bin/dsconfig create-local-db-index --backend-name "userRoot" \ 
      --index-name companyDomain --set maintain-equality-index-without-filter:true \
      --set index-type:equality --set equality-index-filter:"(objectclass=company)"
  2. After you have created the index, rebuild the indexes.
    1. Stop the server using bin/stop-server.
    2. Run the rebuild-index tool.
      $ bin/rebuild-index --baseDN dc=example,dc=com --index companyDomain
  3. Start the server using bin/start-server.