Built-in HTML search engine
HelpNDoc's HTML output includes a built-in JavaScript search engine designed with one main goal: fast, lightweight local searching. The search index is automatically generated during documentation build and optimized to remain as small as possible. This minimizes download size for end-users while ensuring quick searches directly inside the web browser.
Unlike server-based search systems, this engine runs entirely on the client side. No external services, databases, or server scripts are required: everything happens locally using JavaScript and the pre-built search index.
Because the search runs on a compact local dataset, it focuses on speed and simplicity rather than advanced linguistic analysis or large-scale indexing features.
How the Search Engine Works
- The index is generated automatically by HelpNDoc during compilation.
- Searches are performed locally in the user's browser.
- Queries are case-insensitive.
- Results are ranked according to how frequently the search terms appear within each topic.
This design allows documentation to remain portable and fully functional even when hosted as static HTML files.
Supported Search Syntax
The search engine supports a simple yet flexible query format based on keywords and prefixes.
1. Basic Keywords
Enter one or more words separated by spaces:
welcome install
Topics containing either word will appear in results (OR behavior).
2. Required Terms (AND)
Prefix a term with + to require it:
+setup +install
All required terms must be present in the topic.
To force AND behavior, prefix every word with +.
3. Excluded Terms
Prefix a term with - to remove matching topics:
upgrade -deprecated
Any topic containing the excluded word will be filtered out.
4. Combined Queries
You can mix required and excluded terms:
+install +setup -legacy
This query:
- Requires install and setup
- Excludes legacy
Matching Behavior
The search engine uses substring matching by default, meaning partial words are supported. For example, searching for encrypt also matches:
- encrypted
- encryption
- encrypts
- unencrypted
You can also force full-word matching by surrounding a term with quotes. For example, searching for "document" matches only the exact word "document" and will not match "documentation" or "documents".
Tips for Better Results
- Use specific keywords instead of generic words.
- Add +required terms to narrow results.
- Use -excluded terms to remove irrelevant topics.
- Combine multiple operators for precise searches.
Limitations
Because the search engine operates locally on a compact browser-based index, it intentionally keeps features simple:
- Limited query parsing : supports keywords, +required, -excluded terms, and quoted full-word matching, but not advanced phrases or natural language queries.
- No full-text phrase search : searching for multiple successive words does not match exact sentences or word order.
- No linguistic analysis : there is no stemming logic beyond basic sub-string matching, synonyms, or language processing.
- No large external indexing : only the generated local index is used, keeping size small but limiting depth.
- No server-side ranking : results are ranked only by local term frequency, without advanced relevance algorithms.
This trade-off ensures extremely fast performance and minimal download size, but it also means the search capabilities remain intentionally simple.
Customizing the HTML Search Engine
The behavior and appearance of the built-in HTML search engine can be adjusted directly from the HTML documentation settings. These options allow you to control how the search feature is presented to users and how the search index is generated.
For detailed instructions on where to find these options, refer to the Customize HTML documentation settings page.
Search engine: accent-insensitive search
Enables accent-insensitive matching for Latin-based languages. When this option is enabled, accented characters are treated as their base letters during searches (for example, é matches e, ñ matches n, à matches a). This allows searches like cafe to find café, resume to match résumé, and jalapeno to match jalapeño, helping users locate content even if they omit accents when typing.
Search engine: minimum number of characters
Specifies the minimum word length included in the search index.
- Lower values include more words, improving search coverage but increasing index size and download time.
- Higher values reduce index size and improve loading speed, but shorter words will not be searchable.
Search tab title
Defines the text displayed on the search tab in the navigation interface. This lets you rename the tab to better match your documentation style or language.
Show the search tab
Controls whether the search tab is visible in the generated HTML documentation. Disabling this option hides the search interface while keeping the rest of the documentation unchanged.
Replacing the Search Engine
The built-in search engine is fully integrated into the default HTML templates, but it is not mandatory. If you need advanced functionality (such as server-side indexing, external search providers, or a completely different JavaScript engine) you can replace it entirely.
It is possible to create a custom search experience by building custom HTML templates and integrating your own search solution, including server-side ones. Refer to the Working with templates documentation for detailed instructions on how to create HelpNDoc custom templates.