import { SearchTypes } from "@medusajs/framework/types"; import type { AttributeSchema, Row } from "./api-types"; import type { MedusaSearchIndexOptions } from "./options"; export type PlannedField = { path: string; type: string; is_array: boolean; is_date: boolean; field: SearchTypes.SearchFieldDefinition; dimensions?: number; embed?: boolean; }; export type TypoToleranceSettings = { enabled: boolean; min_word_size_for_one_typo: number; min_word_size_for_two_typos: number; disabled_on_attributes: Set; }; export type IndexPlan = { fields: Map; schema: Record; searchable: string[]; primary_key: string; options: MedusaSearchIndexOptions; typo_tolerance: TypoToleranceSettings; vectors: string[]; }; /** * Cloud only matches a term fuzzily when the query is at least * `3 * (distance + 1)` characters long, so the shortest word that can tolerate * one typo is 6 characters and two typos is 9. Configuring anything lower is * rejected at `upsertIndex` rather than silently raised. */ export declare function minWordSizeForTypos(distance: number): number; export declare function isSearchable(field: SearchTypes.SearchFieldDefinition): boolean; export declare function isFacetable(field: SearchTypes.SearchFieldDefinition): boolean; export declare function assertIndexSupported(definition: SearchTypes.ResolvedSearchIndexDefinition): void; export declare function buildIndexPlan(definition: SearchTypes.ResolvedSearchIndexDefinition): IndexPlan; export declare function toSearchDocument(document: SearchTypes.SearchDocument, plan: IndexPlan): Row; export declare function fromSearchDocument(row: Row, attributes: string[]): Record; //# sourceMappingURL=plan.d.ts.map