How To
ForgeRock Identity Platform
Does not apply to Identity Cloud

How do I rebuild indexes in DS (All versions)?

Last updated Jun 15, 2021

The purpose of this article is to provide information on rebuilding indexes in DS. You need to rebuild indexes if you make configuration changes (adding, modifying or deleting indexes or index values) or if you experience degraded indexes.


1 reader recommends this article

Rebuilding indexes

You can rebuild indexes using the command line:

Rebuild a specific index

Enter the following command to rebuild a specific index:

  • DS 7 and later: $ ./rebuild-index --port 4444 --hostname ds1.example.com --bindDN --bindDN uid=admin --bindPassword password --baseDN "dc=example,dc=com" --index [indexname] --start 0
  • Pre-DS 7: $ ./rebuild-index --port 4444 --hostname ds1.example.com --bindDN "cn=Directory Manager" --bindPassword password --baseDN "dc=example,dc=com" --index [indexname] --start 0

You only need to specify a start time if you are rebuilding an index while the server is online; you can use --start 0 to rebuild an index immediately.

Rebuild all indexes

Enter the following command to rebuild all indexes:

  • DS 7 and later: $ ./rebuild-index --port 4444 --hostname ds1.example.com --bindDN --bindDN uid=admin --bindPassword password --baseDN "dc=example,dc=com" --rebuildAll
  • Pre-DS 7: $ ./rebuild-index --port 4444 --hostname ds1.example.com --bindDN "cn=Directory Manager" --bindPassword password --baseDN "dc=example,dc=com" --rebuildAll

Rebuild all degraded indexes

Enter the following command to rebuild all degraded indexes:

  • DS 7 and later: $ ./rebuild-index --port 4444 --hostname ds1.example.com --bindDN --bindDN uid=admin --bindPassword password --baseDN "dc=example,dc=com" --rebuildDegraded
  • Pre-DS 7: $ ./rebuild-index --port 4444 --hostname ds1.example.com --bindDN "cn=Directory Manager" --bindPassword password --baseDN "dc=example,dc=com" --rebuildDegraded
Note

You can verify an index after it has been rebuilt to check that it is no longer degraded. See How do I verify indexes in DS (All versions) are correct? for further information.

Control Panel (removed in DS 6)

In DS 5.x, you can also use the Control Panel: navigate to: Indexes > Rebuild Indexes and select the indexes you want to rebuild. Indexes that require rebuilding (they are degraded or have had configuration changes) are indicated by (*).

See Also

How do I troubleshoot issues with my indexes in DS (All versions)?

Unindexed searches causing slow searches and poor performance on DS (All versions) server

How do I know what index types are needed for search filters in DS (All versions)?

Indexes in DS

Rebuild Indexes 

Verify Indexes

Related Training

ForgeRock Directory Services Core Concepts (DS-400)

Related Issue Tracker IDs

N/A


Copyright and Trademarks Copyright © 2021 ForgeRock, all rights reserved.