nerdexam
Linux_Foundation

LFCS · Question #168

What does the slapindex tool do?

The correct answer is B. Regenerates indexes defined in slapd.conf. The slapindex tool is an OpenLDAP utility primarily used to regenerate or rebuild the database indexes defined within the slapd.conf file.

Submitted by lukas.cz· Apr 18, 2026Service Configuration

Question

What does the slapindex tool do?

Options

  • ADisplays information about the currently configured indexes.
  • BRegenerates indexes defined in slapd.conf
  • CDisplays only the DN of every entry in the directory, sorted by container.
  • DDefragments the LDAP database files.

How the community answered

(35 responses)
  • B
    91% (32)
  • C
    3% (1)
  • D
    6% (2)

Why each option

The `slapindex` tool is an OpenLDAP utility primarily used to regenerate or rebuild the database indexes defined within the `slapd.conf` file.

ADisplays information about the currently configured indexes.

While `slapindex` manipulates indexes, its primary function is rebuilding them, not displaying their configuration details; other tools or methods are used for viewing index definitions.

BRegenerates indexes defined in slapd.confCorrect

`slapindex` reads the entire LDAP database content and rebuilds all configured indexes from scratch or updates existing ones based on the index definitions in `slapd.conf`. This process is critical for maintaining optimal search performance, particularly after significant data imports, deletions, or structural modifications to the directory.

CDisplays only the DN of every entry in the directory, sorted by container.

Displaying DNs or sorting entries is typically performed using the `ldapsearch` utility with appropriate options and filters, not with `slapindex`.

DDefragments the LDAP database files.

`slapindex` rebuilds indexes, but it does not perform defragmentation of the underlying database files; that functionality is usually handled by the specific database backend (e.g., LMDB, BDB).

Concept tested: OpenLDAP slapindex utility

Topics

#slapindex#OpenLDAP#LDAP indexing#Database management

Community Discussion

No community discussion yet for this question.

Full LFCS Practice