UNPKG

firestore-search-engine

Version:

Firestore Search Engine is a powerful helper library for enhancing search functionality in Firestore. Designed to handle misspellings, prefixes, and phonetic matching, this package generates multiple search variations for optimized approximate search resu

36 lines (35 loc) 1.92 kB
import type { BulkWriter, Firestore } from "@google-cloud/firestore"; import type { firestore } from "firebase-admin"; import { FirestoreSearchEngineConfig, FirestoreSearchEngineIndexesAllProps, FirestoreSearchEngineIndexesProps } from ".."; /** * The `BulkWriter` and `Firestore` objects are imported from the * '@google-cloud/firestore' package. These objects are used for batched writes * and cloud-based NoSQL databases respectively. * * Also, the `FirestoreSearchEngineConfig` and `FirestoreSearchEngineIndexesProps` objects * are imported from the parent directory. These are mostly likely used to configure * your Firestore Search engine. This can include settings such as security, indexes, etc. * * The function `generateTypos` from "../shared/generateTypos" is also imported. * It's used to programmatically generate various combinations of typo errors * (misspellings) based on a given string. * * For context-specific documentation, please refer to the respective modules' docstring or documentation. */ export declare class IndexesAll { private readonly firestoreInstance; private readonly fieldValueInstance; private readonly config; wordMinLength: number; wordMaxLength: number; constructor(firestoreInstance: Firestore, fieldValueInstance: typeof firestore.FieldValue, config: FirestoreSearchEngineConfig); execute({ documentProps, documentsToIndexes, }: { documentProps: FirestoreSearchEngineIndexesAllProps; documentsToIndexes: FirestoreSearchEngineIndexesProps["returnedFields"][]; }): Promise<void>; protected bulkWithLimitedKeywords(bulkData: { returnedFields: FirestoreSearchEngineIndexesProps["returnedFields"]; keywords: number[]; }[]): Promise<void>; protected cleanOldIndexes(returnedFields: FirestoreSearchEngineIndexesProps["returnedFields"], bulk: BulkWriter, bulkCount: number): Promise<void>; }