import type { SearchableType, SearchOptions, SearchSpec, SearchTerms, WeightedSearchOptions } from './types'; export interface SearchParams { __types: string[]; __limit: number; __offset: number; [key: string]: unknown; } export interface SearchQuery { query: string; params: SearchParams; options: Record; searchSpec: SearchSpec[]; terms: string[]; } export declare const DEFAULT_LIMIT = 1000; /** * Create search specs from supplied searchable types. * Search specs contain weighted paths which are used to construct GROQ queries for search. * * @param types - Searchable document types to create specs from. * @param optimizedIndexPaths - If true, will will convert all `__experimental_search` paths containing numbers into array syntax. * E.g. ['cover', 0, 'cards', 0, 'title'] => "cover[].cards[].title" * * This optimization will yield more search results than may be intended, but offers better performance over arrays with indices. * (which are currently unoptimizable by Content Lake) * @param maxAttributes - Maximum number of _unique_ searchable attributes to include across all types. * User-provided paths (e.g. with __experimental_search) do not count towards this limit. * @returns All matching search specs and `hasIndexedPaths`, a boolean indicating whether any paths contain indices. * @internal */ export declare function createSearchSpecs(types: SearchableType[], optimizeIndexedPaths: boolean, maxAttributes: number): { hasIndexedPaths: boolean; specs: SearchSpec[]; }; /** * Convert a string into an array of tokenized terms. * * Any (multi word) text wrapped in double quotes will be treated as "phrases", or separate tokens that * will not have its special characters removed. * E.g.`"the" "fantastic mr" fox fox book` => ["the", `"fantastic mr"`, "fox", "book"] * * Phrases wrapped in quotes are assigned relevance scoring differently from regular words. * * @param query - A string to convert into individual tokens * @returns All extracted tokens * @internal */ export declare function extractTermsFromQuery(query: string): string[]; /** * Generate search query data based off provided search terms and options. * * @param searchTerms - SearchTerms containing a string query and any number of searchable document types. * @param searchOpts - Optional search configuration. * @returns GROQ query, params and options to be used to fetch search results. * @internal */ export declare function createSearchQuery(searchTerms: SearchTerms, searchOpts?: SearchOptions & WeightedSearchOptions): SearchQuery; //# sourceMappingURL=createSearchQuery.d.ts.map