Skip to main content

SearchStrategy

This interface defines the contract that any database-specific search implementations should follow.

Info

This is configured via the searchStrategy property of the DefaultSearchPluginInitOptions.

Signature
interface SearchStrategy extends InjectableStrategy {    getSearchResults(ctx: RequestContext, input: SearchInput, enabledOnly: boolean): Promise<SearchResult[]>;    getTotalCount(ctx: RequestContext, input: SearchInput, enabledOnly: boolean): Promise<number>;    getFacetValueIds(ctx: RequestContext, input: SearchInput, enabledOnly: boolean): Promise<Map<ID, number>>;    getCollectionIds(ctx: RequestContext, input: SearchInput, enabledOnly: boolean): Promise<Map<ID, number>>;}

getSearchResults

method(ctx: RequestContext, input: SearchInput, enabledOnly: boolean) => Promise<SearchResult[]>

getTotalCount

method(ctx: RequestContext, input: SearchInput, enabledOnly: boolean) => Promise<number>

getFacetValueIds

method(ctx: RequestContext, input: SearchInput, enabledOnly: boolean) => Promise<Map<ID, number>>

getCollectionIds

method(ctx: RequestContext, input: SearchInput, enabledOnly: boolean) => Promise<Map<ID, number>>
Was this chapter helpful?
Report Issue
Edited Feb 4, 2026·Edit this page