Indexing
Docsense builds its index from your source files, not from rendered HTML.
What gets indexed
For each Markdown or MDX file, Docsense stores:
- Title from frontmatter (
titleorsidebar_label) or the first heading - Sections from headings (
##,###, and so on), including body text under each heading - Code blocks under those headings (kept for ranking)
- Tags from
tagsorkeywordsin frontmatter when present - Page type, version, and language (from path, frontmatter, or plugin defaults)
Page types
Filters in the search modal use pageType.
Docsense sets page type in this order:
- Explicit
pageTypein frontmatter - Inferred from the URL path
- Fallback to
pageordocs
Path rules:
| Path contains | Page type |
|---|---|
/how-to or /howto | howto |
/concept | concept |
/reference | reference |
/tutorial | tutorial |
/api or api-reference | api |
/blog | blog |
/docs (and none of the above) | docs |
Example frontmatter:
---
title: Install Docsense
pageType: howto
---
What is stripped (and what MDX keeps)
The indexer turns Markdown into plain text for search. It removes common markup noise and also:
- Drops
import/exportlines and MDX comments - Keeps string values from textish JSX attributes (
title,description,alt,aria-label,label,cta, and similar)
Critical terms should still appear in headings or prose when possible. See MDX extraction and stemming.
Where the index lives
Default output:
static/docsense/search-index.json
Change the relative path with the plugin indexPath option. The SearchBar loads it from your site root (for example /docsense/search-index.json).
Next steps
- MDX extraction and stemming - What text is extracted from MDX.
- Ranking and typos - How indexed fields are scored.
- Plugin options -
docsDirs,indexPath, and related settings. - Use filters and page limits - Page types from paths and frontmatter.
- FAQ - Common product questions.