sanity
Version:
Sanity is a real-time content infrastructure with a scalable, hosted backend featuring a Graph Oriented Query Language (GROQ), asset pipelines and fast edge caches
18 lines (16 loc) • 515 B
text/typescript
import {
type SearchStrategyFactory,
type TextSearchResults,
type WeightedSearchResults,
} from './common'
import {createTextSearch} from './text-search'
import {createWeightedSearch} from './weighted'
/** @internal */
export const createSearch: SearchStrategyFactory<TextSearchResults | WeightedSearchResults> = (
searchableTypes,
client,
options,
) => {
const factory = options.unstable_enableNewSearch ? createTextSearch : createWeightedSearch
return factory(searchableTypes, client, options)
}