import { SearchIndex } from 'algoliasearch'; import Space from '../lib/Space'; import { ProsprSearch } from './prosprsearch'; import { IQueryProps } from '../Interfaces/Product'; import { SearchResponse } from '@algolia/client-search'; export interface ISearchIndexServices { algolia: SearchIndex | null; addioSearch: ProsprSearch | null; } /** * Returns objet with possible index service instances * As of now, checks for Algolia and Addio Search * @param space - the spaceObj to check * @param partialIndexID - the partial index ID to consult for search, excluding the env. variable (prod_ or test_ will be added in function). ** Important to use index ID, not table ID! */ export declare const getIndexServices: (space: Space, partialIndexID: string) => ISearchIndexServices; /** * Save new entry objects to provided search index services * @param services - the services to check for save * @param newEntry - the object to save * @param processLogStr - the string to add to the log shown with service response */ export declare const saveNewEntryToIndex: (services: ISearchIndexServices, newEntry: any, processLogStr?: string) => Promise; /** * Save a partial object entry to provided search index services. * @param services - the services to check for save * @param partialNewEntry - the object to save * @param processLogStr - the string to add to the log shown with service response * @param createIfNoExists = Optionnal. If should create entry if it does not already exist in search index */ export declare const partialSaveNewEntryToIndex: (services: ISearchIndexServices, partialNewEntry: any, processLogStr: string, createIfNoExists?: boolean) => Promise; /** * Remove objects to provided search index services * @param services - the services to check for save * @param objectId - the object to save * @param processLogStr - the string to add to the log shown with service response */ export declare const removeObjectFromIndex: (services: ISearchIndexServices, objectId: string, processLogStr?: string) => Promise; /** * Returns an object with base info needed to call Algolia/AddioSearch with search query. * @param space */ export declare const getFetchInfoAlgoliaAddioSearch: (space: Space) => { app: string; api: string; space: Space; useProspr?: boolean | undefined; }; /** * Fetch entries from either algolia or AddioSearch (prospr) for a provided index. Client-side only! * @param param0 */ export declare const fetchEntriesAlgoliaAddioSearch: ({ space, indice, hpp, page, query, filters, f, useProspr }: Partial) => Promise>; /** * Returns search result from active search index service. Server-side friendly! * @param parameters Parsed parameters of IQueryProps. Space and indice must be provided, other props are optionnal. */ export declare const searchAPIFetchAlgoliaAddioSearch: ({ app, api, indice, hpp, page, query, filters, f, useProspr }: IQueryProps) => Promise | undefined>;