import { SearchInput, SearchResult } from '@subit/common/lib/generated-types'; import { ID } from '@subit/common/lib/shared-types'; import { RequestContext } from '../../../api'; /** * This interface defines the contract that any database-specific search implementations * should follow. */ export interface SearchStrategy { getSearchResults(ctx: RequestContext, input: SearchInput, enabledOnly: boolean): Promise; getTotalCount(ctx: RequestContext, input: SearchInput, enabledOnly: boolean): Promise; /** * Returns a map of `facetValueId` => `count`, providing the number of times that * facetValue occurs in the result set. */ getFacetValueIds(ctx: RequestContext, input: SearchInput, enabledOnly: boolean): Promise>; }