How do I rebuild indexes in DS (All versions)?
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 ds.example.com --bindDN uid=admin --bindPassword password --baseDN "dc=example,dc=com" --index [indexname] --start 0
- DS 6.x: $ ./rebuild-index --port 4444 --hostname ds.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 ds.example.com --bindDN uid=admin --bindPassword password --baseDN "dc=example,dc=com" --rebuildAll
- DS 6.x: $ ./rebuild-index --port 4444 --hostname ds.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 ds.example.com --bindDN uid=admin --bindPassword password --baseDN "dc=example,dc=com" --rebuildDegraded
- DS 6.x: $ ./rebuild-index --port 4444 --hostname ds.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.
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)?
Related Training
ForgeRock Directory Services Core Concepts (DS-400)
Related Issue Tracker IDs
N/A