Skip to content
View as Markdown
View as Markdown

@salesforce/b2c-tooling-sdk / docs / searchDocs

Function: searchDocs()

searchDocs(query, limitOrOptions?): SearchResult[]

Defined in: packages/b2c-tooling-sdk/src/docs/search.ts:381

Searches the combined documentation index.

Higher scores are better. Results carry the full DocEntry (including category, summary, keywords, and url when available) so callers can triage matches without a follow-up read.

When workspace is provided, the categories relevant to those markers (e.g. sfra for an SFRA project, script-api/job-step for any cartridge project, pwa-kit-managed-runtime/commerce-api for PWA Kit, sfnext/commerce-api for Storefront Next — plus the always-relevant docs) are boosted. It only ever reorders results; use category/enabledCategories to hard-scope.

Parameters

query

string

The search query string

limitOrOptions?

Result limit (number) or SearchDocsOptions

number | SearchDocsOptions

Returns

SearchResult[]

Array of search results sorted by relevance (best first)

Example

typescript
// Favor the current workspace's docs (nothing hidden)
searchDocs('deploy bundle', {workspace: 'pwa-kit-v3'});
// Hard-scope to one category instead
searchDocs('components', {category: 'sfnext'});

Released under the Apache-2.0 License.