How to Index Traceable Items in Site Search
By default, the site’s lunr search indexes page headings but skips traceable items.
A traceable item renders as a plain element with an id attribute (for example <div id="REQ-002">), which lunr does not treat as a navigable anchor.
The antora-tracer package ships a patch that makes lunr index item anchors as separate search results.
Apply it so items like REQ-001 are discoverable in search.
Apply the patch
-
Install
patch-packageand the lunr extension version the patch targets:npm i -D patch-package @antora/lunr-extension@1.0.0-alpha.13 -
Copy the patch that ships with
antora-tracerinto your project:mkdir -p patches cp node_modules/@antora-tracer/core/patches/@antora+lunr-extension+1.0.0-alpha.13.patch patches/ -
Register
patch-packageas yourpostinstallscript:npm pkg set scripts.postinstall="patch-package"If you already have a
postinstallscript, appendpatch-packageto it instead of replacing it. -
Reinstall to apply the patch:
npm install
The patch stays applied across installs because postinstall re-runs patch-package.