Skip to content
duxt

useDuxtSearch()

Search every active source and interleave its locally ranked results.

Signature

const { search, init, labelled } = useDuxtSearch();

Returns

ValueWhat it is
searchRun a query, across every source
initBuild the index, called when the dialog first opens
labelledResults carrying the source they came from

Notes

The index is built on first use, not on page load: a reader who never searches never pays for it.

Content ranks each collection separately. Because the resulting scores are not comparable across collections, the composable interleaves their result lists by position and puts the source being read first in each round. labelled retains the provenance needed to explain that merge in the interface.

Was this page helpful?