search.ts
8 documented symbols. Read the signatures first, then expand each item for parameters, return types, and examples.
8
symbols
7
functions
1
modules
12
parameters
7
returns
Reference
fnbuildSearchIndex(srcDir: string, base: string, extensions: readonly string[] = DEFAULT_MARKDOWN_EXTENSIONS): Promise<string>Builds the search index from Markdown files.
Builds the search index from Markdown files.
Signature
export async function buildSearchIndex(srcDir: string, base: string, extensions: readonly string[] = DEFAULT_MARKDOWN_EXTENSIONS): Promise<string>
Parameters
-
srcDirstring -
basestring -
extensionsreadonly string[]optional · default: DEFAULTMARKDOWNEXTENSIONS
Returns
Promise<string>
fngenerateSearchModule(options: ResolvedSearchOptions, indexPath: string): stringClient-side search module code. This is injected into the bundle as a virtual m…
Client-side search module code. This is injected into the bundle as a virtual module.
Signature
export function generateSearchModule(options: ResolvedSearchOptions, indexPath: string): string
Parameters
-
optionsResolvedSearchOptions -
indexPathstring
Returns
string
fngetSearchDocumentScopes(doc: Pick<SearchDocument, "id" | "url">): string[]Derives hierarchical search scopes from a document id or URL. For example, api/…
Derives hierarchical search scopes from a document id or URL.
For example, api/math/index yields ["api", "api/math"].
Signature
export function getSearchDocumentScopes(doc: Pick<SearchDocument, "id" | "url">): string[]
Parameters
-
docPick<SearchDocument, "id" | "url">
Returns
string[]
fnmatchesSearchScopes(doc: Pick<SearchDocument, "id" | "url">, scopes: string[]): booleanReturns true when a search document belongs to at least one requested scope.
Returns true when a search document belongs to at least one requested scope.
Signature
export function matchesSearchScopes(doc: Pick<SearchDocument, "id" | "url">, scopes: string[]): boolean
Parameters
-
docPick<SearchDocument, "id" | "url"> -
scopesstring[]
Returns
boolean
fnparseScopedSearchQuery(query: string): ScopedSearchQuerySplits a raw query into free-text terms and @scope prefixes.
Splits a raw query into free-text terms and @scope prefixes.
Signature
export function parseScopedSearchQuery(query: string): ScopedSearchQuery
Parameters
-
querystring
Returns
fnresolveSearchOptions(options: SearchOptions | boolean | undefined): ResolvedSearchOptionsResolves search options with defaults.
Resolves search options with defaults.
Signature
export function resolveSearchOptions(options: SearchOptions | boolean | undefined): ResolvedSearchOptions
Parameters
-
optionsSearchOptions | boolean | undefined
Returns
modulesearchFull-text search functionality for Ox Content. Generates search index at build time and provides client-side search.
Full-text search functionality for Ox Content.
Generates search index at build time and provides client-side search.
fnwriteSearchIndex(indexJson: string, outDir: string): Promise<void>Writes the search index to a file.
Writes the search index to a file.
Signature
export async function writeSearchIndex(indexJson: string, outDir: string): Promise<void>
Parameters
-
indexJsonstring -
outDirstring
Returns
Promise<void>