Skip to content

DokuWiki Search and Indexing — Full-Text Search, Indexer, and Search Configuration

DodaTech Updated 2026-06-28 8 min read

In this tutorial, you'll learn how DokuWiki's search system works, how the indexer processes page content, how to configure search options, and how to optimize search for wikis with thousands of pages.

What You'll Learn

  • How the DokuWiki indexer works
  • Full-text search capabilities and limitations
  • Search syntax (phrases, wildcards, boolean operators)
  • Configuring search behavior
  • Running the indexer manually
  • Search performance optimization

Why It Matters

Search is how users find content in a wiki with more than a few dozen pages. Even the best namespace organization cannot replace a good search. Understanding how DokuWiki's search works — and its limitations — helps you set user expectations and optimize the search experience for your users.

Real-World Use

A support team maintains a knowledge base with 800 articles. When a customer reports an issue, the support agent searches for related articles using keywords. DokuWiki's full-text search returns results from all namespaces. The agent finds the relevant article in seconds, resolves the issue, and adds a note linking the article to the customer issue. Search turns a large wiki into a useful tool.

Learning Path

flowchart LR
  A[Page Revisions] --> B[Search]
  B --> C[Categories]
  C --> D[ACL Basics]
  D --> E[User Management]
  E --> F[Advanced ACL]

How the Indexer Works

DokuWiki maintains a search index in data/index/. The index is a collection of files that map words to the pages where they appear.

data/index/
├── page.idx          # List of all page IDs
├── word.idx          # List of all words (stemmed)
├── index/            # Word-to-page mapping files
├── length.idx        # Word frequency data
└── title.idx         # Page titles

When a page is saved, the indexer:

  1. Reads the page content
  2. Strips wiki syntax
  3. Splits text into words
  4. Stems words (removes suffixes: "running" becomes "run")
  5. Removes stop words (common words like "the", "and", "is")
  6. Updates the index files with the word-to-page mapping

The index is updated incrementally — only changed pages are re-indexed.

Running the Indexer

The indexer runs automatically when pages are saved. You can also run it manually:

# Run the indexer from the command line
php bin/indexer.php

Indexer Options

# Re-index all pages (full rebuild)
php bin/indexer.php -f

# Index only a specific page
php bin/indexer.php -p projects:roadmap

# Index only the start page
php bin/indexer.php -p start

# Show help
php bin/indexer.php -h

A full rebuild is useful after bulk page imports or when index files are corrupted.

Triggering the Indexer via Web

You can trigger indexing by accessing the search page with a special parameter:

http://yourserver/wiki/search?q=test&do=reindex

This is useful when you do not have command-line access (e.g., shared hosting).

Search Syntax

DokuWiki supports basic search operators:

milestone

Returns all pages containing the word "milestone."

"project roadmap"

Use double quotes to search for an exact phrase.

Boolean AND

milestone roadmap

Multiple words are combined with AND by default. Returns pages containing both "milestone" and "roadmap."

Boolean OR

milestone OR deadline

Returns pages containing either word.

Excluding Words

milestone -roadmap

Returns pages containing "milestone" but not "roadmap."

Wildcard

mile*

Returns pages containing words starting with "mile": milestone, mileage, milestone.

The wildcard only works as a suffix (mile*), not as a prefix (*stone).

Search results include the namespace in the page title, making it easy to identify which namespace a result belongs to. You cannot search within a specific namespace using search syntax alone, but you can use the Advanced Search features of some templates.

Search Configuration

Configure search behavior in conf/local.php:

<?php
// Indexing settings
$conf['index_allow_spaces'] = 1;    // Allow spaces in page IDs (not recommended)

// Search settings
$conf['fulltext'] = 1;              // Enable full-text search (default)
$conf['search_nslimit'] = 0;        // Limit search depth (0 = unlimited)
$conf['search_fragment'] = 0;       // Show search result snippets (0=off, 1=on)
$conf['search_mangle'] = 1;         // Mangle search query for better matching

Search Result Snippets

When $conf['search_fragment'] is enabled, search results show a snippet of the page content with the matching words highlighted:

Project Roadmap (projects:roadmap)
...updated **milestone** dates for Q3. The **milestone** completion...

Snippets help users find the right page without clicking through to each result.

Search Limitations

DokuWiki's search has some limitations to be aware of:

Limitation Explanation
No relevance ranking Results are not ranked by relevance. They are listed alphabetically by page ID.
No fuzzy search Misspelled words do not match. "Milestone" does not find "milestone."
No stemming control Stemming is automatic. "Running" and "run" match the same index entry.
No search within specific namespace All searches span the entire wiki.
No search operators in web UI Advanced operators (AND, OR, wildcards) are available but not documented in the default UI.

Improving Search Experience

Use Descriptive Page Titles

Page titles are indexed and appear in search results. A page titled "Installation Guide" is more searchable than "Setup."

Use Consistent Terminology

If you call a concept "milestone" in one page and "deadline" in another, users searching for "milestone" will not find the "deadline" page. Use consistent terminology across your wiki.

Search considers link text when ranking. If many pages link to a page with the text "see the roadmap," that page ranks higher for "roadmap."

Add a Search Plugin

The "Searchstatistics" plugin provides search analytics — it shows what users are searching for and what they click. This helps you identify content gaps.

Rebuilding the Index

If search stops working or returns incorrect results, rebuild the index:

# Delete existing index and rebuild
rm -rf data/index/*
php bin/indexer.php -f

On shared hosting, you can trigger a full rebuild by:

  1. Going to the Admin panel
  2. Clicking "Index" in the search section
  3. Clicking "Rebuild Index"

Search and ACL

DokuWiki respects ACL permissions in search results. Pages that a user does not have permission to read do not appear in their search results. This means the same search query can return different results for different users.

Common Mistakes

  1. Not running the indexer after bulk imports: If you import 100 pages via the filesystem, the index is not updated until the indexer runs. Search will not find those pages until indexing is triggered.
  2. Expecting Google-quality search: DokuWiki's search is basic — no relevance ranking, no fuzzy matching, no auto-complete. For large wikis, consider the Elasticsearch plugin for advanced search.
  3. Ignoring stop words: Common words like "the," "and," "for" are excluded from indexing. Searching for "the setup guide" effectively searches for "setup guide."
  4. Corrupting index files: If the indexer is interrupted (e.g., server crash during indexing), index files can be corrupted. Rebuild the index to fix this.
  5. Not using descriptive page titles: A page with ID notes and no heading is hard to find via search. Always use descriptive headings as the first line of every page.

Practice Questions

  1. How does the DokuWiki indexer Process page content when a page is saved?
  2. What search syntax would you use to find pages containing both "installation" and "configuration" but not "Windows"?
  3. Why might search results differ between users on the same DokuWiki installation?
  4. Challenge: Create a script that analyzes search behavior on your wiki. The script should: list the 20 most common search terms (from a search log or by analyzing popular pages), identify pages with weak titles (no descriptive text in the first heading), suggest missing pages for common search terms that return no results, and recommend cross-links between pages that share common keywords. Test the script and implement at least 3 of its recommendations.

FAQ

Why is my new page not showing up in search results?

The indexer may not have run yet. DokuWiki indexes pages asynchronously. Try searching again after a few minutes, or run the indexer manually: php bin/indexer.php on the command line.

Can I search within a specific namespace?

DokuWiki does not have a built-in way to limit searches to a namespace. The Elasticsearch plugin or the Searchnamespaces plugin can add this capability. Without plugins, all searches span the entire wiki.

How do I rebuild the search index?

From the command line: rm -rf data/index/* && php bin/indexer.php -f. From the web admin panel: navigate to Admin > Index > Rebuild. A full rebuild may take several minutes for large wikis.

Does DokuWiki support search in PDF or other uploaded files?

No. DokuWiki's search only indexes wiki page content (.txt files). Uploaded files (PDFs, Word documents) are not indexed. You would need the Elasticsearch plugin or an external search service for file content search.

How can I improve search relevance on my wiki?

Use clear, descriptive page titles. Use consistent terminology across pages. Link related pages with descriptive anchor text. Consider the Pagelist plugin for creating dynamic indexes. For advanced needs, replace the built-in search with Elasticsearch.

Mini Project

Goal: Audit and optimize your wiki's search.

  1. Search for 5 terms that should return relevant results on your wiki
  2. Note any searches that return no results when they should
  3. Check if the indexer has run recently: look at data/index/page.idx modification time
  4. Run the indexer manually (full rebuild) if needed
  5. Verify search results improve after indexing
  6. Enable search result snippets if they are not enabled
  7. Review page titles across your wiki — update any unhelpful titles
  8. Create a search tips page and link it from the sidebar

What's Next

Search helps users find content. Now learn how to use categories and tags to organize content across namespace boundaries.

Built by the developers of DodaTech

Doda Browser, DodaZIP & Durga Antivirus Pro