import * as functions from 'firebase-functions'; /** * Full Text Search * @param change - functions change interface * @param context - event context * @param field - the field to index * @param fk - the foreign key fields to get * @param type - { id, map, array } - defaults to id * @param n - number of word chunks to index at a time * @param searchCol - name of search collection */ export declare function fullTextIndex(change: functions.Change, context: functions.EventContext, field: string, fk?: string, type?: string, n?: number, searchCol?: string): Promise; /** * Relevant search callable function * @param _opts { * query - query to search * col - collection to search * fields - fields to search * searchCol - name of search collection, default _search * termField - name of term field to search, default _term * filterFunc - name of function to filter * limit - number of search results to limit, default 10 * startId - id field for paging, only works with _all index * } * @retuns - will return a sorted array of docs with {id, relevance} * the higher the relevance, the better match it is... */ export declare function relevantSearch(_opts: { query: string; col: string; fields: string; searchCol?: string; termField?: string; filterFunc?: any; limit?: number; startId?: string; }): Promise; /** * Trigram Search callable function * @param _opts { * query - query to search * col - collection to search * fields - fields to search * searchCol - name of search collection, default _search * termField - name of term field to search, default _term * limit - number of search results to limit, default 10 * } * @retuns - will return a sorted array of docs with {id, relevance} * the higher the relevance, the better match it is... */ export declare function trigramSearch(_opts: { query: string; col: string; fields?: string[]; searchCol?: string; termField?: string; limit?: number; }): Promise; /** * indexes a collection by relevance * @param change * @param context * @param _opts: { * fields - array of fields to index * searchCol - name of search collection, default _search * numWords - number of words to index at a time, default 6 * combine - whether or not to combine fields in one collection, default true * combinedCol - name of combined fields collection, default _all * termField - name of terms array, default _term * filterFunc - function to filter, can pass a soundex function * } */ export declare function relevantIndex(change: functions.Change, context: functions.EventContext, _opts: { fields: string[]; searchCol?: string; numWords?: number; combine?: boolean; combinedCol?: string; termField?: string; filterFunc?: any; }): Promise; /** * Generates an index for trigrams on a document * @param change * @param context * @param _opts { * fields - array of fields to index * trigramCol - name of trigram colleciton, default _trigrams * combine - whether or not to combine fields in one collection, default true * combinedCol - name of combined collection, default _all * termField - name of field to store trigrams, default _term * } */ export declare function trigramIndex(change: functions.Change, context: functions.EventContext, _opts: { trigramCol?: string; combinedCol?: string; combine?: boolean; termField?: string; fields: string[]; }): Promise;