1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482 |
- import { AuthModeType } from '@algolia/client-common';
- import { ClientTransporterOptions } from '@algolia/client-common';
- import { CreateClient } from '@algolia/client-common';
- import { Request } from '@algolia/transporter';
- import { RequestOptions } from '@algolia/transporter';
- import { Transporter } from '@algolia/transporter';
- import { WaitablePromise } from '@algolia/client-common';
- export declare const addApiKey: (base: SearchClient) => (acl: readonly ApiKeyACLType[], requestOptions?: (AddApiKeyOptions & Pick<RequestOptions, string | number>) | undefined) => Readonly<WaitablePromise<AddApiKeyResponse>>;
- export declare type AddApiKeyOptions = {
- /**
- * A Unix timestamp used to define the expiration date of the API key.
- */
- readonly validity?: number;
- /**
- * Specify the maximum number of hits this API key can retrieve in one call.
- * This parameter can be used to protect you from attempts at retrieving your entire index contents by massively querying the index.
- */
- readonly maxHitsPerQuery?: number;
- /**
- * Specify the maximum number of API calls allowed from an IP address per hour. Each time an API call is performed with this key, a check is performed.
- */
- readonly maxQueriesPerIPPerHour?: number;
- /**
- * Specify the list of targeted indices. You can target all indices starting with a prefix or ending with a suffix using the ‘*’ character.
- */
- readonly indexes?: readonly string[];
- /**
- * Specify the list of referers. You can target all referers starting with a prefix, ending with a suffix using the ‘*’ character.
- */
- readonly referers?: readonly string[];
- /**
- * Specify the list of query parameters. You can force the query parameters for a query using the url string format.
- */
- readonly queryParameters?: string;
- /**
- * Specify a description of the API key. Used for informative purposes only. It has impact on the functionality of the API key.
- */
- readonly description?: string;
- };
- export declare type AddApiKeyResponse = {
- /**
- * The returned api key.
- */
- key: string;
- /**
- * Date of creation of the api key.
- */
- createdAt: string;
- };
- export declare const ApiKeyACLEnum: Readonly<Record<string, ApiKeyACLType>>;
- export declare type ApiKeyACLType = 'addObject' | 'analytics' | 'browse' | 'deleteIndex' | 'deleteObject' | 'editSettings' | 'listIndexes' | 'logs' | 'personalization' | 'recommendation' | 'search' | 'seeUnretrievableAttributes' | 'settings' | 'usage';
- export declare const assignUserID: (base: SearchClient) => (userID: string, clusterName: string, requestOptions?: RequestOptions | undefined) => Readonly<Promise<AssignUserIDResponse>>;
- export declare type AssignUserIDResponse = {
- /**
- * Date of creation of the userId.
- */
- createdAt: string;
- };
- export declare const assignUserIDs: (base: SearchClient) => (userIDs: readonly string[], clusterName: string, requestOptions?: RequestOptions | undefined) => Readonly<Promise<AssignUserIDsResponse>>;
- export declare type AssignUserIDsResponse = {
- /**
- * Date of creation of the userId
- */
- createdAt: string;
- };
- export declare type AutomaticFacetFilter = {
- /**
- * Attribute to filter on. This must match a facet placeholder in the rule’s pattern.
- */
- readonly facet: string;
- /**
- * Whether the filter is disjunctive (true) or conjunctive (false).
- */
- readonly disjunctive?: boolean;
- /**
- * Score for the filter. Typically used for optional or disjunctive filters.
- */
- readonly score?: number;
- };
- export declare const batch: (base: SearchIndex) => (requests: readonly BatchRequest[], requestOptions?: RequestOptions | undefined) => Readonly<WaitablePromise<BatchResponse>>;
- export declare const BatchActionEnum: Readonly<Record<string, BatchActionType>>;
- export declare type BatchActionType = 'addObject' | 'updateObject' | 'partialUpdateObject' | 'partialUpdateObjectNoCreate' | 'deleteObject' | 'delete' | 'clear';
- export declare type BatchRequest = {
- /**
- * The batch action.
- */
- readonly action: BatchActionType;
- /**
- * The body of the given `action`. Note that, bodies difer
- * depending of the action.
- */
- readonly body: Record<string, any>;
- };
- export declare type BatchResponse = {
- /**
- * The operation task id. May be used to perform a wait task.
- */
- taskID: number;
- /**
- * The object ids created/updated by the batch request.
- */
- objectIDs: string[];
- };
- export declare const browseObjects: (base: SearchIndex) => <TObject>(requestOptions?: (SearchOptions & BrowseOptions<TObject> & RequestOptions) | undefined) => Readonly<Promise<void>>;
- export declare type BrowseOptions<TObject> = {
- /**
- * The callback called for each batch of objects.
- */
- readonly batch?: (batch: ReadonlyArray<TObject & ObjectWithObjectID>) => any;
- /**
- * The callback called to determine if the browse should stop. By
- * default this checks whether there's any more content to get.
- */
- readonly shouldStop?: (response: BrowseResponse<TObject>) => boolean;
- };
- export declare type BrowseRequestData = {
- /**
- * If available, should be used for browsing to the next page.
- */
- readonly cursor?: string;
- /**
- * If cursor is not available, should be used for browsing to the next page.
- */
- readonly page?: number;
- };
- export declare type BrowseResponse<TObject> = {
- /**
- * The hits per page.
- */
- hits: Array<TObject & ObjectWithObjectID>;
- /**
- * The cursor used for iterate on the next page.
- */
- cursor?: string;
- };
- export declare const browseRules: (base: SearchIndex) => (requestOptions?: (SearchRulesOptions & BrowseOptions<Rule> & RequestOptions) | undefined) => Readonly<Promise<void>>;
- export declare const browseSynonyms: (base: SearchIndex) => (requestOptions?: (SearchSynonymsOptions & BrowseOptions<Synonym> & RequestOptions) | undefined) => Readonly<Promise<void>>;
- export declare const chunkedBatch: (base: SearchIndex) => (bodies: readonly object[], action: BatchActionType, requestOptions?: (RequestOptions & ChunkOptions) | undefined) => Readonly<WaitablePromise<ChunkedBatchResponse>>;
- export declare type ChunkedBatchResponse = {
- /**
- * The operations task ids. May be used to perform a wait task.
- */
- taskIDs: number[];
- /**
- * The object ids created/updated/deleted by the multiple requests.
- */
- objectIDs: string[];
- };
- export declare type ChunkOptions = {
- /**
- * The number of objects per batch.
- */
- readonly batchSize?: number;
- };
- export declare const clearDictionaryEntries: (base: SearchClient) => (dictionary: DictionaryName, requestOptions?: (RequestOptions & DictionaryEntriesOptions) | undefined) => Readonly<WaitablePromise<DictionaryEntriesResponse>>;
- export declare const clearObjects: (base: SearchIndex) => (requestOptions?: RequestOptions | undefined) => Readonly<WaitablePromise<DeleteResponse>>;
- export declare const clearRules: (base: SearchIndex) => (requestOptions?: (RequestOptions & ClearRulesOptions) | undefined) => Readonly<WaitablePromise<DeleteResponse>>;
- export declare type ClearRulesOptions = {
- /**
- * If the clear rules request should be forward to replicas.
- */
- readonly forwardToReplicas?: boolean;
- };
- export declare const clearSynonyms: (base: SearchIndex) => (requestOptions?: (ClearSynonymsOptions & RequestOptions) | undefined) => Readonly<WaitablePromise<DeleteResponse>>;
- export declare type ClearSynonymsOptions = {
- /**
- * If the clear synonyms request should be forward to replicas.
- */
- readonly forwardToReplicas?: boolean;
- };
- export declare type Cluster = {
- /**
- * The cluster name
- */
- readonly clusterName: string;
- /**
- * Number of records in the cluster.
- */
- readonly nbRecords: number;
- /**
- * Number of users assign to the cluster.
- */
- readonly nbUserIDs: number;
- /**
- * Data size taken by all the users assigned to the cluster.
- */
- readonly dataSize: number;
- };
- export declare type Condition = {
- /**
- * Query patterns are expressed as a string with a specific syntax. A pattern is a sequence of tokens.
- */
- readonly pattern?: string;
- /**
- * Apply this rule only when the filter matches.
- */
- readonly filters?: string;
- /**
- * is | startsWith | endsWith | contains: Whether the pattern must match the beginning or the end of the query string, or both, or none.
- */
- readonly anchoring?: 'is' | 'startsWith' | 'endsWith' | 'contains';
- /**
- * Rule context (format: [A-Za-z0-9_-]+). When specified, the rule is contextual and applies only when the same context is specified at query time (using the ruleContexts parameter).
- * When absent, the rule is generic and always applies (provided that its other conditions are met, of course).
- */
- readonly context?: string;
- /**
- * If set to true, alternatives make the rule to trigger on synonyms, typos and plurals.
- * Note that setting ignorePlurals to false overrides this parameter.
- */
- readonly alternatives?: boolean;
- };
- export declare type Consequence = {
- /**
- * Additional search parameters. Any valid search parameter is allowed.
- */
- readonly params?: ConsequenceParams & Pick<SearchOptions, Exclude<keyof SearchOptions, 'query'>>;
- /**
- * Objects to promote as hits.
- */
- readonly promote?: readonly ConsequencePromote[];
- /**
- * Objects to hide from hits.
- */
- readonly hide?: ReadonlyArray<{
- readonly objectID: string;
- }>;
- /**
- * Whether the Query Rule should promote or not promoted items.
- */
- readonly filterPromotes?: boolean;
- /**
- * Custom JSON object that will be appended to the userData array in the response.
- * This object is not interpreted by the API. It is limited to 1kB of minified JSON.
- */
- readonly userData?: any;
- };
- export declare type ConsequenceParams = {
- /**
- * When providing a string, it replaces the entire query string.
- * When providing an object, it describes incremental edits to be made to the query string (but you can’t do both).
- */
- readonly query?: ConsequenceQuery | string;
- /**
- * Names of facets to which automatic filtering must be applied; they must match the facet name of a facet value placeholder in the query pattern.
- */
- readonly automaticFacetFilters?: readonly AutomaticFacetFilter[] | readonly string[];
- /**
- * Same syntax as automaticFacetFilters, but the engine treats the filters as optional.
- * Behaves like optionalFilters.
- */
- readonly automaticOptionalFacetFilters?: readonly AutomaticFacetFilter[] | readonly string[];
- /**
- * Content defining how the search interface should be rendered.
- * A default value for this can be set via settings
- */
- readonly renderingContent?: Settings['renderingContent'];
- };
- export declare type ConsequencePromote = {
- /**
- * Unique identifier of the object to promote.
- */
- readonly objectID: string;
- /**
- * Promoted rank for the object (zero-based).
- */
- readonly position: number;
- } | {
- /**
- * List of unique identifiers for the objects to promote.
- */
- readonly objectIDs: readonly string[];
- /**
- * Promoted start rank for the objects (zero-based).
- */
- readonly position: number;
- };
- export declare type ConsequenceQuery = {
- /**
- * List of removes.
- */
- readonly remove?: readonly string[];
- /**
- * List of edits.
- */
- readonly edits?: ReadonlyArray<{
- /**
- * Type of edit.
- */
- readonly type?: 'remove' | 'replace';
- /**
- * Text or patterns to remove from the query string.
- */
- readonly delete?: string;
- /**
- * Text that should be inserted in place of the removed text inside the query string.
- */
- readonly insert?: string;
- }>;
- };
- export declare const copyIndex: (base: SearchClient) => (from: string, to: string, requestOptions?: (CopyIndexOptions & RequestOptions) | undefined) => Readonly<WaitablePromise<IndexOperationResponse>>;
- export declare type CopyIndexOptions = {
- readonly scope?: readonly ScopeType[];
- };
- export declare const copyRules: (base: SearchClient) => (from: string, to: string, requestOptions?: RequestOptions | undefined) => Readonly<WaitablePromise<IndexOperationResponse>>;
- export declare const copySettings: (base: SearchClient) => (from: string, to: string, requestOptions?: RequestOptions | undefined) => Readonly<WaitablePromise<IndexOperationResponse>>;
- export declare const copySynonyms: (base: SearchClient) => (from: string, to: string, requestOptions?: RequestOptions | undefined) => Readonly<WaitablePromise<IndexOperationResponse>>;
- export declare function createBrowsablePromise<TObject>(options: {
- readonly shouldStop: (response: BrowseResponse<TObject>) => boolean;
- readonly request: (data: BrowseRequestData) => Readonly<Promise<BrowseResponse<TObject>>>;
- } & BrowseOptions<TObject>): Readonly<Promise<void>>;
- export declare type CreateIndex = <TMethods extends {
- readonly [key: string]: (base: SearchIndex) => (...args: any) => any;
- }>(indexName: string, options?: {
- readonly methods?: TMethods;
- }) => SearchIndex & {
- [key in keyof TMethods extends string ? keyof TMethods : never]: ReturnType<TMethods[key]>;
- };
- export declare function createMissingObjectIDError(): Error;
- export declare function createObjectNotFoundError(): Error;
- export declare const createSearchClient: CreateClient<SearchClient, SearchClientOptions & ClientTransporterOptions>;
- export declare function createValidUntilNotFoundError(): Error;
- export declare const customRequest: <TResponse = any>(base: SearchClient) => (request: Request, requestOptions?: RequestOptions | undefined) => Readonly<Promise<TResponse>>;
- export declare const deleteApiKey: (base: SearchClient) => (apiKey: string, requestOptions?: RequestOptions | undefined) => Readonly<WaitablePromise<DeleteApiKeyResponse>>;
- export declare type DeleteApiKeyResponse = {
- /**
- * The date when the api key was deleted.
- */
- deletedAt: string;
- };
- export declare const deleteBy: (base: SearchIndex) => (filters: DeleteByFiltersOptions, requestOptions?: RequestOptions | undefined) => Readonly<WaitablePromise<DeleteResponse>>;
- export declare type DeleteByFiltersOptions = {
- /**
- * Filter the query with numeric, facet and/or tag filters.
- */
- readonly filters?: string;
- /**
- * Filter hits by facet value.
- */
- readonly facetFilters?: string | readonly string[] | ReadonlyArray<readonly string[] | string>;
- /**
- * Filter on numeric attributes.
- */
- readonly numericFilters?: string | readonly string[] | ReadonlyArray<readonly string[] | string>;
- /**
- * Filter hits by tags. tagFilters is a different way of filtering, which relies on the _tags
- * attribute. It uses a simpler syntax than filters. You can use it when you want to do
- * simple filtering based on tags.
- */
- readonly tagFilters?: string | readonly string[] | ReadonlyArray<readonly string[] | string>;
- /**
- * Search for entries around a central geolocation, enabling a geo search within a circular area.
- */
- readonly aroundLatLng?: string;
- /**
- * Search for entries around a given location automatically computed from the requester’s IP address.
- */
- readonly aroundLatLngViaIP?: boolean;
- /**
- * Search inside a rectangular area (in geo coordinates).
- */
- readonly insideBoundingBox?: ReadonlyArray<readonly number[]> | string;
- /**
- * Search inside a polygon (in geo coordinates).
- */
- readonly insidePolygon?: ReadonlyArray<readonly number[]>;
- };
- export declare const deleteDictionaryEntries: (base: SearchClient) => (dictionary: DictionaryName, objectIDs: readonly string[], requestOptions?: (RequestOptions & DictionaryEntriesOptions) | undefined) => Readonly<WaitablePromise<DictionaryEntriesResponse>>;
- export declare const deleteIndex: (base: SearchIndex) => (requestOptions?: RequestOptions | undefined) => Readonly<WaitablePromise<DeleteResponse>>;
- export declare const deleteObject: (base: SearchIndex) => (objectID: string, requestOptions?: RequestOptions | undefined) => Readonly<WaitablePromise<DeleteResponse>>;
- export declare const deleteObjects: (base: SearchIndex) => (objectIDs: readonly string[], requestOptions?: (RequestOptions & ChunkOptions) | undefined) => Readonly<WaitablePromise<ChunkedBatchResponse>>;
- export declare type DeleteResponse = {
- /**
- * The operation task id. May be used to perform a wait task.
- */
- taskID: number;
- };
- export declare const deleteRule: (base: SearchIndex) => (objectID: string, requestOptions?: RequestOptions | undefined) => Readonly<WaitablePromise<DeleteResponse>>;
- export declare const deleteSynonym: (base: SearchIndex) => (objectID: string, requestOptions?: (RequestOptions & DeleteSynonymOptions) | undefined) => Readonly<WaitablePromise<DeleteResponse>>;
- export declare type DeleteSynonymOptions = {
- /**
- * If the delete synonym request should be forward to replicas.
- */
- readonly forwardToReplicas?: boolean;
- };
- export declare type DictionaryEntriesOptions = {
- /**
- * Array of dictionary entries
- */
- readonly dictionaryEntries: readonly DictionaryEntry[];
- };
- export declare type DictionaryEntriesResponse = {
- /**
- * When the given rules got saved.
- */
- updatedAt: number;
- /**
- * The operation task id. May be used to perform a wait task.
- */
- taskID: number;
- };
- export declare type DictionaryEntry = {
- /**
- * Unique identifier for the rule (format: [A-Za-z0-9_-]+).
- */
- readonly objectID: string;
- readonly language: string;
- readonly word?: string;
- readonly words?: readonly string[];
- readonly decomposition?: readonly string[];
- readonly state?: 'enabled' | 'disabled';
- };
- export declare type DictionaryName = 'plurals' | 'stopwords' | 'compounds';
- export declare type DictionarySettings = {
- /**
- * Disable the builtin Algolia entries for a type of dictionary per language.
- */
- readonly disableStandardEntries: RequireAtLeastOne<Record<DictionaryName, Record<string, boolean>>>;
- };
- export declare const exists: (base: SearchIndex) => (requestOptions?: RequestOptions | undefined) => Readonly<Promise<boolean>>;
- export declare type FacetHit = {
- /**
- * The value of the facet.
- */
- readonly value: string;
- /**
- * The highlighted value.
- */
- readonly highlighted: string;
- /**
- * The count.
- */
- readonly count: number;
- };
- export declare const findAnswers: (base: SearchIndex) => <TObject>(query: string, queryLanguages: readonly string[], requestOptions?: (RequestOptions & FindAnswersOptions) | undefined) => Readonly<Promise<FindAnswersResponse<TObject>>>;
- export declare type FindAnswersOptions = {
- /**
- * Attributes to use for predictions.
- * If using the default (["*"]), all attributes are used to find answers.
- */
- readonly attributesForPrediction?: readonly string[];
- /**
- * Maximum number of answers to retrieve from the Answers Engine.
- * Cannot be greater than 1000.
- */
- readonly nbHits?: number;
- /**
- * Threshold for the answers’ confidence score:
- * only answers with extracts that score above this threshold are returned.
- */
- readonly threshold?: number;
- /**
- * Whether the attribute name in which the answer was found should be returned.
- * This option is expensive in processing time.
- */
- readonly returnExtractAttribute?: boolean;
- /**
- * Algolia search parameters to use to fetch the hits.
- * Can be any search parameter, except:
- * - attributesToSnippet
- * - hitsPerPage
- * - queryType
- * - naturalLanguages and associated parameters
- * (removeStopWords, ignorePlurals, and removeWordsIfNoResults)
- */
- readonly searchParameters?: Omit<SearchOptions, 'attributesToSnippet' | 'hitsPerPage' | 'queryType' | 'naturalLanguages' | 'removeStopWords' | 'ignorePlurals' | 'removeWordsIfNoResults'>;
- };
- export declare type FindAnswersResponse<TObject = {}> = Omit<SearchResponse<TObject>, 'hits'> & {
- /**
- * The hits returned by the search.
- *
- * Hits are ordered according to the ranking or sorting of the index being queried.
- */
- hits: Array<Hit<TObject & {
- _answer?: {
- extract: string;
- score: number;
- extractAttribute: string;
- };
- }>>;
- };
- export declare const findObject: (base: SearchIndex) => <TObject>(callback: (object: TObject & ObjectWithObjectID) => boolean, requestOptions?: (FindObjectOptions & RequestOptions) | undefined) => Readonly<Promise<FindObjectResponse<TObject>>>;
- export declare type FindObjectOptions = {
- /**
- * If the underlying find object options should paginate
- * over a search method.
- */
- readonly paginate?: boolean;
- /**
- * The query used by the underlying find object to
- * find the object.
- */
- readonly query?: string;
- };
- export declare type FindObjectResponse<TObject> = {
- /**
- * The found object.
- */
- object: TObject & ObjectWithObjectID;
- /**
- * The position where the object was found.
- */
- position: number;
- /**
- * The page where the object was found.
- */
- page: number;
- };
- export declare const generateSecuredApiKey: () => (parentApiKey: string, restrictions: SecuredApiKeyRestrictions) => string;
- export declare const getApiKey: (base: SearchClient) => (apiKey: string, requestOptions?: RequestOptions | undefined) => Readonly<Promise<GetApiKeyResponse>>;
- export declare type GetApiKeyResponse = {
- /**
- * The api key value
- */
- value: string;
- /**
- * Date of creation (Unix timestamp).
- */
- createdAt: number;
- /**
- * List of permissions the key contains.
- */
- acl: ApiKeyACLType[];
- /**
- * A Unix timestamp used to define the expiration date of the API key.
- */
- validity: number;
- /**
- * Specify the maximum number of hits this API key can retrieve in one call.
- * This parameter can be used to protect you from attempts at retrieving your entire index contents by massively querying the index.
- */
- maxHitsPerQuery?: number;
- /**
- * Specify the maximum number of API calls allowed from an IP address per hour. Each time an API call is performed with this key, a check is performed.
- */
- maxQueriesPerIPPerHour?: number;
- /**
- * Specify the list of targeted indices. You can target all indices starting with a prefix or ending with a suffix using the ‘*’ character.
- */
- indexes?: string[];
- /**
- * Specify the list of referers. You can target all referers starting with a prefix, ending with a suffix using the ‘*’ character.
- */
- referers?: string[];
- /**
- * IPv4 network allowed to use the generated key.
- * This is used for more protection against API key leaking and reuse.
- * Note that you can only provide a single source, but you can specify a range of IPs (e.g., 192.168.1.0/24).
- */
- restrictSources?: string;
- /**
- * Specify the list of query parameters. You can force the query parameters for a query using the url string format.
- */
- queryParameters?: string;
- /**
- * Specify a description of the API key. Used for informative purposes only. It has impact on the functionality of the API key.
- */
- description?: string;
- };
- export declare const getAppTask: (base: SearchClient) => (taskID: number, requestOptions?: RequestOptions | undefined) => Readonly<Promise<TaskStatusResponse>>;
- export declare const getDictionarySettings: (base: SearchClient) => (requestOptions?: RequestOptions | undefined) => Readonly<Promise<GetDictionarySettingsResponse>>;
- export declare type GetDictionarySettingsResponse = {
- /**
- * Disable the builtin Algolia entries for a type of dictionary per language.
- */
- readonly disableStandardEntries: RequireAtLeastOne<Record<DictionaryName, Record<string, boolean>>>;
- };
- export declare const getLogs: (base: SearchClient) => (requestOptions?: RequestOptions | undefined) => Readonly<Promise<GetLogsResponse>>;
- export declare type GetLogsOptions = {
- /**
- * The offset.
- */
- readonly offset: number;
- /**
- * The length size.
- */
- readonly length: number;
- };
- export declare type GetLogsResponse = {
- /**
- * The list of logs.
- */
- logs: Log[];
- };
- export declare const getObject: (base: SearchIndex) => <TObject>(objectID: string, requestOptions?: (RequestOptions & GetObjectOptions) | undefined) => Readonly<Promise<TObject & ObjectWithObjectID>>;
- export declare type GetObjectOptions = {
- /**
- * The attributes that should come with witch object.
- */
- readonly attributesToRetrieve?: readonly string[];
- };
- export declare const getObjectPosition: <TObject>() => (searchResponse: SearchResponse<TObject>, objectID: string) => number;
- export declare const getObjects: (base: SearchIndex) => <TObject>(objectIDs: readonly string[], requestOptions?: (RequestOptions & GetObjectsOptions) | undefined) => Readonly<Promise<GetObjectsResponse<TObject>>>;
- export declare type GetObjectsOptions = {
- /**
- * The attributes that should come with witch object.
- */
- readonly attributesToRetrieve?: readonly string[];
- };
- export declare type GetObjectsResponse<TObject> = {
- /**
- * The list of results.
- */
- results: Array<(TObject & ObjectWithObjectID) | null>;
- };
- export declare const getRule: (base: SearchIndex) => (objectID: string, requestOptions?: RequestOptions | undefined) => Readonly<Promise<Rule>>;
- export declare const getSecuredApiKeyRemainingValidity: () => (securedApiKey: string) => number;
- export declare const getSettings: (base: SearchIndex) => (requestOptions?: RequestOptions | undefined) => Readonly<Promise<Settings>>;
- export declare const getSynonym: (base: SearchIndex) => (objectID: string, requestOptions?: RequestOptions | undefined) => Readonly<Promise<Synonym>>;
- export declare const getTask: (base: SearchIndex) => (taskID: number, requestOptions?: RequestOptions | undefined) => Readonly<Promise<TaskStatusResponse>>;
- export declare const getTopUserIDs: (base: SearchClient) => (requestOptions?: RequestOptions | undefined) => Readonly<Promise<GetTopUserIDsResponse>>;
- export declare type GetTopUserIDsResponse = {
- /**
- * Mapping of cluster names to top users.
- */
- topUsers: Record<string, UserIDResponse[]>;
- };
- export declare const getUserID: (base: SearchClient) => (userID: string, requestOptions?: RequestOptions | undefined) => Readonly<Promise<UserIDResponse>>;
- export declare const hasPendingMappings: (base: SearchClient) => (requestOptions?: (HasPendingMappingsOptions & RequestOptions) | undefined) => Readonly<Promise<HasPendingMappingsResponse>>;
- export declare type HasPendingMappingsOptions = {
- /**
- * If the clusters pending mapping state should be on the response.
- *
- * @defaultValue false
- */
- readonly retrieveMappings?: boolean;
- /**
- * If the clusters pending mapping state should be on the response.
- *
- * @defaultValue false
- *
- * @internal
- */
- readonly getClusters?: boolean;
- };
- export declare type HasPendingMappingsResponse = {
- /**
- * If there is any clusters with pending mapping state.
- */
- pending: boolean;
- /**
- * Describe cluster pending (migrating, creating, deleting) mapping state.
- */
- clusters?: {
- [key: string]: string[];
- };
- };
- declare type HighlightMatch = {
- readonly value: string;
- readonly matchLevel: 'none' | 'partial' | 'full';
- readonly matchedWords: readonly string[];
- readonly fullyHighlighted?: boolean;
- };
- export declare type HighlightResult<THit> = THit extends string | number ? HighlightMatch : {
- [KAttribute in keyof THit]?: HighlightResult<THit[KAttribute]>;
- };
- export declare type Hit<THit> = THit & {
- readonly objectID: string;
- readonly _highlightResult?: HighlightResult<THit>;
- readonly _snippetResult?: SnippetResult<THit>;
- readonly _rankingInfo?: RankingInfo;
- readonly _distinctSeqID?: number;
- };
- export declare type Index = {
- /**
- * Index name.
- */
- readonly name: string;
- /**
- * Index creation date. (ISO-8601 format)
- */
- readonly createdAt: string;
- /**
- * Date of last update. (ISO-8601 format)
- */
- readonly updatedAt: string;
- /**
- * Number of records contained in the index
- */
- readonly entries: number;
- /**
- * Number of bytes of the index in minified format.
- */
- readonly dataSize: number;
- /**
- * Number of bytes of the index binary file.
- */
- readonly fileSize: number;
- /**
- * Last build time in seconds.
- */
- readonly lastBuildTimeS: number;
- /**
- * Number of pending indexing operations.
- */
- readonly numberOfPendingTasks: number;
- /**
- * A boolean which says whether the index has pending tasks.
- */
- readonly pendingTask: boolean;
- /**
- * Only present if the index is a replica.
- * Contains the name of the related primary index.
- */
- readonly primary?: string;
- /**
- * Only present if the index is a primary index with replicas.
- * Contains the names of all linked replicas.
- */
- readonly replicas?: readonly string[];
- };
- export declare type IndexOperationResponse = {
- /**
- * The operation task id. May be used to perform a wait task.
- */
- taskID: number;
- };
- /**
- * @deprecated please use `Index` instead of `Indice`
- */
- export declare type Indice = Index;
- export declare const initIndex: (base: SearchClient) => CreateIndex;
- export declare const listApiKeys: (base: SearchClient) => (requestOptions?: RequestOptions | undefined) => Readonly<Promise<ListApiKeysResponse>>;
- export declare type ListApiKeysResponse = {
- /**
- * List of keys
- */
- keys: GetApiKeyResponse[];
- };
- export declare const listClusters: (base: SearchClient) => (requestOptions?: RequestOptions | undefined) => Readonly<Promise<ListClustersResponse>>;
- export declare type ListClustersResponse = {
- /**
- * List of clusters.
- */
- clusters: Cluster[];
- };
- export declare const listIndices: (base: SearchClient) => (requestOptions?: RequestOptions | undefined) => Readonly<Promise<ListIndicesResponse>>;
- export declare type ListIndicesResponse = {
- /**
- * Number of pages
- */
- nbPages: number;
- /**
- * List of index response
- */
- items: Index[];
- };
- export declare const listUserIDs: (base: SearchClient) => (requestOptions?: (ListUserIDsOptions & RequestOptions) | undefined) => Readonly<Promise<ListUserIDsResponse>>;
- export declare type ListUserIDsOptions = {
- /**
- * Page to fetch.
- */
- readonly page?: number;
- /**
- * Number of users to retrieve per page.
- */
- readonly hitsPerPage?: number;
- };
- export declare type ListUserIDsResponse = {
- /**
- * List of users id.
- */
- userIDs: UserIDResponse[];
- };
- export declare type Log = {
- /**
- * Timestamp in ISO-8601 format.
- */
- readonly timestamp: string;
- /**
- * Rest type of the method.
- */
- readonly method: string;
- /**
- * Http response code.
- */
- readonly answer_code: string;
- /**
- * Request body. It’s truncated after 1000 characters.
- */
- readonly query_body: string;
- /**
- * Answer body. It’s truncated after 1000 characters.
- */
- readonly answer: string;
- /**
- * Request URL.
- */
- readonly url: string;
- /**
- * Client ip of the call.
- */
- readonly ip: string;
- /**
- * SHA1 ID of entry.
- */
- readonly sha1: string;
- /**
- * Request Headers (API Key is obfuscated).
- */
- readonly query_headers: string;
- /**
- * Number Of Api Calls
- */
- readonly nb_api_calls?: string;
- /**
- * Processing time for the query. This does not include network time.
- */
- readonly processing_time_ms: string;
- /**
- * Number of hits returned for the query.
- */
- readonly query_nb_hits?: string;
- /**
- * Exhaustive flags used during the query.
- */
- readonly exhaustive?: boolean;
- /**
- * Index name of the log
- */
- readonly index?: string;
- /**
- * Internal queries performed for this query.
- */
- readonly inner_queries: ReadonlyArray<{
- /**
- * Index name of the query.
- */
- readonly index_name: string;
- /**
- * Query ID of the query.
- */
- readonly query_id?: string;
- /**
- * The offset of the query.
- */
- readonly offset?: number;
- /**
- * The user token of the query.
- */
- readonly user_token?: string;
- }>;
- };
- export declare const moveIndex: (base: SearchClient) => (from: string, to: string, requestOptions?: RequestOptions | undefined) => Readonly<WaitablePromise<IndexOperationResponse>>;
- export declare const multipleBatch: (base: SearchClient) => (requests: readonly MultipleBatchRequest[], requestOptions?: RequestOptions | undefined) => Readonly<WaitablePromise<MultipleBatchResponse>>;
- export declare type MultipleBatchRequest = {
- /**
- * The index name where the multiple batch are going to be applied.
- */
- readonly indexName: string;
- /**
- * The action used.
- */
- readonly action: BatchActionType;
- /**
- * The body associated with the request.
- */
- readonly body: Record<string, any>;
- };
- export declare type MultipleBatchResponse = {
- /**
- * The list of object ids.
- */
- objectIDs: string[];
- /**
- * The operation task id. May be used to perform a wait task.
- */
- taskID: Record<string, number>;
- };
- export declare type MultipleGetObject = {
- /**
- * The index name.
- */
- readonly indexName: string;
- /**
- * The object id.
- */
- readonly objectID: string;
- /**
- * The attributes that should be returned with the object.
- */
- readonly attributesToRetrieve?: readonly string[];
- };
- export declare const multipleGetObjects: (base: SearchClient) => <TObject>(requests: readonly MultipleGetObject[], requestOptions?: RequestOptions | undefined) => Readonly<Promise<MultipleGetObjectsResponse<TObject>>>;
- export declare type MultipleGetObjectsResponse<TObject> = {
- /**
- * The list of objects.
- */
- results: Array<TObject & ObjectWithObjectID>;
- };
- export declare const multipleQueries: (base: SearchClient) => <TObject>(queries: readonly MultipleQueriesQuery[], requestOptions?: (RequestOptions & MultipleQueriesOptions) | undefined) => Readonly<Promise<MultipleQueriesResponse<TObject>>>;
- export declare type MultipleQueriesOptions = {
- readonly strategy?: StrategyType;
- };
- export declare type MultipleQueriesQuery = SharedMultipleQueriesQuery & ({
- readonly type?: 'default';
- } | {
- readonly type: 'facet';
- /**
- * The facet name.
- */
- readonly facet: string;
- /**
- * The search options.
- */
- readonly params?: SharedMultipleQueriesQuery['params'] & {
- /**
- * The search query used to search the facet attribute. Follows the same rules for an index query: a single character, a partial word, a word, or a phrase.
- */
- readonly facetQuery?: string;
- };
- });
- export declare type MultipleQueriesResponse<TObject> = {
- /**
- * The list of results.
- */
- results: Array<SearchResponse<TObject>>;
- };
- export declare const multipleSearchForFacetValues: (base: SearchClient) => (queries: readonly {
- readonly indexName: string;
- readonly params: SearchForFacetValuesQueryParams & SearchOptions;
- }[], requestOptions?: RequestOptions | undefined) => Readonly<Promise<readonly SearchForFacetValuesResponse[]>>;
- export declare type ObjectWithObjectID = {
- /**
- * The object id of the object.
- */
- readonly objectID: string;
- };
- export declare const partialUpdateObject: (base: SearchIndex) => (object: Record<string, any>, requestOptions?: (RequestOptions & ChunkOptions & PartialUpdateObjectsOptions) | undefined) => Readonly<WaitablePromise<PartialUpdateObjectResponse>>;
- export declare type PartialUpdateObjectResponse = {
- /**
- * The operation task id. May be used to perform a wait task.
- */
- taskID: number;
- /**
- * The object id updated.
- */
- objectID: string;
- };
- export declare const partialUpdateObjects: (base: SearchIndex) => (objects: readonly Record<string, any>[], requestOptions?: (RequestOptions & ChunkOptions & PartialUpdateObjectsOptions) | undefined) => Readonly<WaitablePromise<ChunkedBatchResponse>>;
- export declare type PartialUpdateObjectsOptions = {
- /**
- * If the object should be created when does not exist.
- */
- readonly createIfNotExists?: boolean;
- };
- export declare type RankingInfo = {
- readonly promoted: boolean;
- readonly nbTypos: number;
- readonly firstMatchedWord: number;
- readonly proximityDistance?: number;
- readonly geoDistance: number;
- readonly geoPrecision?: number;
- readonly nbExactWords: number;
- readonly words: number;
- readonly filters: number;
- readonly userScore: number;
- readonly matchedGeoLocation?: {
- readonly lat: number;
- readonly lng: number;
- readonly distance: number;
- };
- readonly personalization?: {
- readonly filtersScore: number;
- readonly rankingScore: number;
- readonly score: number;
- };
- readonly promotedByReRanking?: boolean;
- };
- export declare const removeUserID: (base: SearchClient) => (userID: string, requestOptions?: RequestOptions | undefined) => Readonly<Promise<RemoveUserIDResponse>>;
- export declare type RemoveUserIDResponse = {
- /**
- * When the given `userID` got removed.
- */
- deletedAt: string;
- };
- export declare const replaceAllObjects: (base: SearchIndex) => (objects: readonly Readonly<Record<string, any>>[], requestOptions?: (ReplaceAllObjectsOptions & ChunkOptions & SaveObjectsOptions & RequestOptions) | undefined) => Readonly<WaitablePromise<ChunkedBatchResponse>>;
- export declare type ReplaceAllObjectsOptions = {
- /**
- * If the all objects should be replaced using wait operations. Keep
- * in mind that, when the `safe` option is used, the operation may
- * take a little more than expected.
- */
- readonly safe?: boolean;
- };
- export declare const replaceAllRules: (base: SearchIndex) => (rules: readonly Rule[], requestOptions?: (RequestOptions & SaveRulesOptions) | undefined) => Readonly<WaitablePromise<SaveRulesResponse>>;
- export declare const replaceAllSynonyms: (base: SearchIndex) => (synonyms: readonly Synonym[], requestOptions?: (RequestOptions & Pick<SaveSynonymsOptions, "forwardToReplicas">) | undefined) => Readonly<WaitablePromise<SaveSynonymsResponse>>;
- export declare const replaceDictionaryEntries: (base: SearchClient) => (dictionary: DictionaryName, entries: readonly DictionaryEntry[], requestOptions?: (RequestOptions & DictionaryEntriesOptions) | undefined) => Readonly<WaitablePromise<DictionaryEntriesResponse>>;
- export declare type RequireAtLeastOne<TType> = {
- [TKey in keyof TType]-?: Required<Pick<TType, TKey>> & Partial<Pick<TType, Exclude<keyof TType, TKey>>>;
- }[keyof TType];
- export declare const restoreApiKey: (base: SearchClient) => (apiKey: string, requestOptions?: RequestOptions | undefined) => Readonly<WaitablePromise<RestoreApiKeyResponse>>;
- export declare type RestoreApiKeyResponse = {
- /**
- * Restoration date of the API key.
- */
- createdAt: string;
- };
- export declare type Rule = {
- /**
- * Unique identifier for the rule (format: [A-Za-z0-9_-]+).
- */
- readonly objectID: string;
- /**
- * Condition of the rule, expressed using the following variables: pattern, anchoring, context.
- *
- * @deprecated This parameter is deprecated in favor of `conditions`.
- */
- readonly condition?: Condition;
- /**
- * Conditions of the rule, expressed using the following variables: pattern, anchoring, context.
- */
- readonly conditions?: readonly Condition[];
- /**
- * Consequence of the rule. At least one of the following object must be used: params, promote, hide, userData.
- */
- readonly consequence?: Consequence;
- /**
- * This field is intended for rule management purposes, in particular to ease searching for rules and presenting them to human readers. It is not interpreted by the API.
- */
- readonly description?: string;
- /**
- * Whether the rule is enabled. Disabled rules remain in the index, but are not applied at query time.
- */
- readonly enabled?: boolean;
- /**
- * By default, rules are permanently valid. When validity periods are specified, the rule applies only during those periods; it is ignored the rest of the time.
- * The list must not be empty.
- */
- readonly validity?: readonly TimeRange[];
- };
- export declare const saveDictionaryEntries: (base: SearchClient) => (dictionary: DictionaryName, entries: readonly DictionaryEntry[], requestOptions?: (RequestOptions & DictionaryEntriesOptions) | undefined) => Readonly<WaitablePromise<DictionaryEntriesResponse>>;
- export declare const saveObject: (base: SearchIndex) => (object: Readonly<Record<string, any>>, requestOptions?: (RequestOptions & ChunkOptions & SaveObjectsOptions) | undefined) => Readonly<WaitablePromise<SaveObjectResponse>>;
- export declare type SaveObjectResponse = {
- /**
- * The operation task id. May be used to perform a wait task.
- */
- taskID: number;
- /**
- * The object id saved.
- */
- objectID: string;
- };
- export declare const saveObjects: (base: SearchIndex) => (objects: readonly Readonly<Record<string, any>>[], requestOptions?: (RequestOptions & ChunkOptions & SaveObjectsOptions) | undefined) => Readonly<WaitablePromise<ChunkedBatchResponse>>;
- export declare type SaveObjectsOptions = {
- /**
- * If the object id should be generated when does not exists.
- */
- readonly autoGenerateObjectIDIfNotExist?: boolean;
- };
- export declare const saveRule: (base: SearchIndex) => (rule: Rule, requestOptions?: (RequestOptions & SaveRulesOptions) | undefined) => Readonly<WaitablePromise<SaveRuleResponse>>;
- export declare type SaveRuleResponse = {
- /**
- * When the given rules got saved.
- */
- updatedAt: number;
- /**
- * The operation task id. May be used to perform a wait task.
- */
- taskID: number;
- };
- export declare const saveRules: (base: SearchIndex) => (rules: readonly Rule[], requestOptions?: (RequestOptions & SaveRulesOptions) | undefined) => Readonly<WaitablePromise<SaveRulesResponse>>;
- export declare type SaveRulesOptions = {
- /**
- * If the saved rules should be forward to replicas.
- */
- readonly forwardToReplicas?: boolean;
- /**
- * If the existing rules should be removed.
- */
- readonly clearExistingRules?: boolean;
- };
- export declare type SaveRulesResponse = {
- /**
- * When the given rules got saved.
- */
- updatedAt: number;
- /**
- * The operation task id. May be used to perform a wait task.
- */
- taskID: number;
- };
- export declare const saveSynonym: (base: SearchIndex) => (synonym: Synonym, requestOptions?: (RequestOptions & SaveSynonymsOptions) | undefined) => Readonly<WaitablePromise<SaveSynonymResponse>>;
- export declare type SaveSynonymResponse = {
- /**
- * When the given synonyms got saved.
- */
- updatedAt: number;
- /**
- * The operation task id. May be used to perform a wait task.
- */
- taskID: number;
- };
- export declare const saveSynonyms: (base: SearchIndex) => (synonyms: readonly Synonym[], requestOptions?: (SaveSynonymsOptions & RequestOptions) | undefined) => Readonly<WaitablePromise<SaveSynonymsResponse>>;
- export declare type SaveSynonymsOptions = {
- /**
- * If the saved synonyms should be forward to replicas.
- */
- readonly forwardToReplicas?: boolean;
- /**
- * If the existing synonyms should be removed.
- * @deprecated use clearExistingSynonyms
- */
- readonly replaceExistingSynonyms?: boolean;
- /**
- * If the existing synonyms should be removed.
- */
- readonly clearExistingSynonyms?: boolean;
- };
- export declare type SaveSynonymsResponse = {
- /**
- * When the given synonyms got saved.
- */
- updatedAt: number;
- /**
- * The operation task id. May be used to perform a wait task.
- */
- taskID: number;
- };
- export declare const ScopeEnum: Readonly<Record<string, ScopeType>>;
- export declare type ScopeType = 'settings' | 'synonyms' | 'rules';
- export declare const search: (base: SearchIndex) => <TObject>(query: string, requestOptions?: (RequestOptions & SearchOptions) | undefined) => Readonly<Promise<SearchResponse<TObject>>>;
- export declare type SearchClient = {
- /**
- * The application id.
- */
- readonly appId: string;
- /**
- * The underlying transporter.
- */
- readonly transporter: Transporter;
- /**
- * Mutates the transporter, adding the given user agent.
- */
- readonly addAlgoliaAgent: (segment: string, version?: string) => void;
- /**
- * Clears both requests and responses caches.
- */
- readonly clearCache: () => Readonly<Promise<void>>;
- };
- export declare type SearchClientOptions = {
- /**
- * The application id.
- */
- readonly appId: string;
- /**
- * The api key.
- */
- readonly apiKey: string;
- /**
- * The auth mode type. In browser environments credentials may
- * be passed within the headers.
- */
- readonly authMode?: AuthModeType;
- };
- export declare const searchDictionaryEntries: (base: SearchClient) => (dictionary: DictionaryName, query: string, requestOptions?: RequestOptions | undefined) => Readonly<Promise<SearchDictionaryEntriesResponse>>;
- export declare type SearchDictionaryEntriesResponse = {
- /**
- * The dictionary entries returned by the search.
- */
- hits: DictionaryEntry[];
- /**
- * Index of the current page (zero-based).
- */
- page: number;
- /**
- * Number of dictionary entries matched by the query.
- */
- nbHits: number;
- /**
- * Number of pages returned.
- *
- * Calculation is based on the total number of hits (nbHits) divided by the
- * number of hits per page (hitsPerPage), rounded up to the nearest integer.
- */
- nbPages: number;
- };
- export declare const searchForFacetValues: (base: SearchIndex) => (facetName: string, facetQuery: string, requestOptions?: (RequestOptions & SearchOptions) | undefined) => Readonly<Promise<SearchForFacetValuesResponse>>;
- export declare type SearchForFacetValuesQueryParams = {
- /**
- * The facet name.
- */
- readonly facetName: string;
- /**
- * The facet query.
- */
- readonly facetQuery: string;
- };
- export declare type SearchForFacetValuesResponse = {
- /**
- * The list of facet hits.
- */
- facetHits: FacetHit[];
- /**
- * The exhaustive facets count.
- */
- exhaustiveFacetsCount: boolean;
- /**
- * The time that the API toke the process the request.
- */
- processingTimeMS?: number;
- };
- export declare type SearchIndex = {
- /**
- * The application id.
- */
- readonly appId: string;
- /**
- * The index name.
- */
- readonly indexName: string;
- /**
- * The underlying transporter.
- */
- readonly transporter: Transporter;
- };
- export declare type SearchOptions = {
- /**
- * Create a new query with an empty search query.
- */
- readonly query?: string;
- /**
- * Allows a search for similar objects, but the query has to be constructed on your end and included alongside an empty query.
- *
- * The similarQuery should be made from the tags and keywords of the relevant object.
- */
- readonly similarQuery?: string;
- /**
- * Filter hits by facet value.
- */
- readonly facetFilters?: string | readonly string[] | ReadonlyArray<readonly string[] | string>;
- /**
- * Create filters for ranking purposes, where records that match the filter are ranked highest.
- */
- readonly optionalFilters?: string | readonly string[] | ReadonlyArray<readonly string[] | string>;
- /**
- * Filter on numeric attributes.
- */
- readonly numericFilters?: string | readonly string[] | ReadonlyArray<readonly string[] | string>;
- /**
- * Filter hits by tags. tagFilters is a different way of filtering, which relies on the _tags
- * attribute. It uses a simpler syntax than filters. You can use it when you want to do
- * simple filtering based on tags.
- */
- readonly tagFilters?: string | readonly string[] | ReadonlyArray<readonly string[] | string>;
- /**
- * Determines how to calculate the total score for filtering.
- */
- readonly sumOrFiltersScores?: boolean;
- /**
- * Filter the query with numeric, facet and/or tag filters.
- */
- readonly filters?: string;
- /**
- * Specify the page to retrieve.
- */
- readonly page?: number;
- /**
- * Set the number of hits per page.
- */
- readonly hitsPerPage?: number;
- /**
- * Specify the offset of the first hit to return.
- */
- readonly offset?: number;
- /**
- * Set the number of hits to retrieve (used only with offset).
- */
- readonly length?: number;
- /**
- * List of attributes to highlight.
- */
- readonly attributesToHighlight?: readonly string[];
- /**
- * List of attributes to snippet, with an optional maximum number of words to snippet.
- */
- readonly attributesToSnippet?: readonly string[];
- /**
- * Gives control over which attributes to retrieve and which not to retrieve.
- */
- readonly attributesToRetrieve?: readonly string[];
- /**
- * The HTML string to insert before the highlighted parts in all highlight and snippet results.
- */
- readonly highlightPreTag?: string;
- /**
- * The HTML string to insert after the highlighted parts in all highlight and snippet results
- */
- readonly highlightPostTag?: string;
- /**
- * String used as an ellipsis indicator when a snippet is truncated.
- */
- readonly snippetEllipsisText?: string;
- /**
- * Restrict highlighting and snippeting to items that matched the query.
- */
- readonly restrictHighlightAndSnippetArrays?: boolean;
- /**
- * Facets to retrieve.
- */
- readonly facets?: readonly string[];
- /**
- * Maximum number of facet values to return for each facet during a regular search.
- */
- readonly maxValuesPerFacet?: number;
- /**
- * Force faceting to be applied after de-duplication (via the Distinct setting).
- */
- readonly facetingAfterDistinct?: boolean;
- /**
- * Minimum number of characters a word in the query string must contain to accept matches with 1 typo
- */
- readonly minWordSizefor1Typo?: number;
- /**
- * Minimum number of characters a word in the query string must contain to accept matches with 2 typos.
- */
- readonly minWordSizefor2Typos?: number;
- /**
- * Whether to allow typos on numbers (“numeric tokens”) in the query string.
- */
- readonly allowTyposOnNumericTokens?: boolean;
- /**
- * List of attributes on which you want to disable typo tolerance.
- */
- readonly disableTypoToleranceOnAttributes?: readonly string[];
- /**
- * Controls if and how query words are interpreted as prefixes.
- */
- readonly queryType?: 'prefixLast' | 'prefixAll' | 'prefixNone';
- /**
- * Selects a strategy to remove words from the query when it doesn’t match any hits.
- */
- readonly removeWordsIfNoResults?: 'none' | 'lastWords' | 'firstWords' | 'allOptional';
- /**
- * Enables the advanced query syntax.
- */
- readonly advancedSyntax?: boolean;
- /**
- * AdvancedSyntaxFeatures can be exactPhrase or excludeWords
- */
- readonly advancedSyntaxFeatures?: ReadonlyArray<'exactPhrase' | 'excludeWords'>;
- /**
- * A list of words that should be considered as optional when found in the query.
- */
- readonly optionalWords?: string | readonly string[];
- /**
- * List of attributes on which you want to disable the exact ranking criterion.
- */
- readonly disableExactOnAttributes?: readonly string[];
- /**
- * Controls how the exact ranking criterion is computed when the query contains only one word.
- */
- readonly exactOnSingleWordQuery?: 'attribute' | 'none' | 'word';
- /**
- * List of alternatives that should be considered an exact match by the exact ranking criterion.
- */
- readonly alternativesAsExact?: ReadonlyArray<'ignorePlurals' | 'singleWordSynonym' | 'multiWordsSynonym'>;
- /**
- * Whether rules should be globally enabled.
- */
- readonly enableRules?: boolean;
- /**
- * Enables contextual rules.
- */
- readonly ruleContexts?: readonly string[];
- /**
- * Enables de-duplication or grouping of results.
- */
- readonly distinct?: boolean | number;
- /**
- * Whether the current query will be taken into account in the Analytics
- */
- readonly analytics?: boolean;
- /**
- * List of tags to apply to the query in the analytics.
- */
- readonly analyticsTags?: readonly string[];
- /**
- * Whether to take into account an index’s synonyms for a particular search.
- */
- readonly synonyms?: boolean;
- /**
- * Whether to highlight and snippet the original word that matches the synonym or the synonym itself.
- */
- readonly replaceSynonymsInHighlight?: boolean;
- /**
- * Precision of the proximity ranking criterion.
- */
- readonly minProximity?: number;
- /**
- * Choose which fields the response will contain. Applies to search and browse queries.
- */
- readonly responseFields?: readonly string[];
- /**
- * Maximum number of facet hits to return during a search for facet values.
- */
- readonly maxFacetHits?: number;
- /**
- * Whether to include or exclude a query from the processing-time percentile computation.
- */
- readonly percentileComputation?: boolean;
- /**
- * Enable the Click Analytics feature.
- */
- readonly clickAnalytics?: boolean;
- /**
- * The `personalizationImpact` parameter sets the percentage of the impact that personalization has on ranking records. The
- * value must be between 0 and 100 (inclusive). This parameter will not be taken into account if `enablePersonalization`
- * is **false**.
- */
- readonly personalizationImpact?: number;
- /**
- * Enable personalization for the query
- */
- readonly enablePersonalization?: boolean;
- /**
- * Restricts a given query to look in only a subset of your searchable attributes.
- */
- readonly restrictSearchableAttributes?: readonly string[];
- /**
- * Restricts a given query to look in only a subset of your searchable attributes.
- */
- readonly sortFacetValuesBy?: 'count' | 'alpha';
- /**
- * Controls whether typo tolerance is enabled and how it is applied.
- */
- readonly typoTolerance?: boolean | 'min' | 'strict';
- /**
- * Search for entries around a central geolocation, enabling a geo search within a circular area.
- */
- readonly aroundLatLng?: string;
- /**
- * Search for entries around a given location automatically computed from the requester’s IP address.
- */
- readonly aroundLatLngViaIP?: boolean;
- /**
- * Search for entries around a given location automatically computed from the requester’s IP address.
- */
- readonly aroundRadius?: number | 'all';
- /**
- * Precision of geo search (in meters), to add grouping by geo location to the ranking formula.
- */
- readonly aroundPrecision?: number | ReadonlyArray<{
- readonly from: number;
- readonly value: number;
- }>;
- /**
- * Minimum radius (in meters) used for a geo search when aroundRadius is not set.
- */
- readonly minimumAroundRadius?: number;
- /**
- * Search inside a rectangular area (in geo coordinates).
- */
- readonly insideBoundingBox?: ReadonlyArray<readonly number[]> | string;
- /**
- * Search inside a polygon (in geo coordinates).
- */
- readonly insidePolygon?: ReadonlyArray<readonly number[]>;
- /**
- * Treats singular, plurals, and other forms of declensions as matching terms.
- */
- readonly ignorePlurals?: boolean | readonly string[];
- /**
- * Removes stop (common) words from the query before executing it.
- */
- readonly removeStopWords?: boolean | readonly string[];
- /**
- * List of supported languages with their associated language ISO code.
- *
- * Apply a set of natural language best practices such as ignorePlurals,
- * removeStopWords, removeWordsIfNoResults, analyticsTags and ruleContexts.
- */
- readonly naturalLanguages?: readonly string[];
- /**
- * When true, each hit in the response contains an additional _rankingInfo object.
- */
- readonly getRankingInfo?: boolean;
- /**
- * A user identifier.
- * Format: alpha numeric string [a-zA-Z0-9_-]
- * Length: between 1 and 64 characters.
- */
- readonly userToken?: string;
- /**
- * Can be to enable or disable A/B tests at query time.
- * Engine's default: true
- */
- readonly enableABTest?: boolean;
- /**
- * Enable word segmentation (also called decompounding) at query time for
- * compatible languages. For example, this turns the Dutch query
- * "spaanplaatbehang" into "spaan plaat behang" to retrieve more relevant
- * results.
- */
- readonly decompoundQuery?: boolean;
- /**
- * The relevancy threshold to apply to search in a virtual index [0-100]. A Bigger
- * value means fewer, but more relevant results, smaller value means more, but
- * less relevant results.
- */
- readonly relevancyStrictness?: number;
- /**
- * Whether this search should use Dynamic Re-Ranking.
- * @link https://www.algolia.com/doc/guides/algolia-ai/re-ranking/
- *
- * Note: You need to turn on Dynamic Re-Ranking on your index for it to have an effect on
- * your search results. You can do this through the Re-Ranking page on the dashboard.
- * This parameter is only used to turn off Dynamic Re-Ranking (with false) at search time.
- */
- readonly enableReRanking?: boolean;
- /**
- * When Dynamic Re-Ranking is enabled, only records that match these filters will be impacted by Dynamic Re-Ranking.
- */
- readonly reRankingApplyFilter?: string | readonly string[] | ReadonlyArray<readonly string[] | string> | null;
- };
- export declare type SearchResponse<TObject = {}> = {
- /**
- * The hits returned by the search.
- *
- * Hits are ordered according to the ranking or sorting of the index being queried.
- */
- hits: Array<Hit<TObject>>;
- /**
- * Index of the current page (zero-based).
- */
- page: number;
- /**
- * Number of hits returned (used only with offset)
- */
- length?: number;
- /**
- * The offset of the first hit to returned.
- */
- offset?: number;
- /**
- * Number of hits matched by the query.
- */
- nbHits: number;
- /**
- * Subset of hits selected when relevancyStrictness is applied.
- */
- nbSortedHits?: number;
- /**
- * Number of pages returned.
- *
- * Calculation is based on the total number of hits (nbHits) divided by the
- * number of hits per page (hitsPerPage), rounded up to the nearest integer.
- */
- nbPages: number;
- /**
- * Maximum number of hits returned per page.
- */
- hitsPerPage: number;
- /**
- * Time the server took to process the request, in milliseconds. This does not include network time.
- */
- processingTimeMS: number;
- /**
- * Whether the nbHits is exhaustive (true) or approximate (false).
- *
- * An approximation is done when the query takes more than 50ms to be
- * processed (this can happen when using complex filters on millions on records).
- */
- exhaustiveNbHits: boolean;
- /**
- * Whether the facet count is exhaustive (true) or approximate (false).
- */
- exhaustiveFacetsCount?: boolean;
- /**
- * A mapping of each facet name to the corresponding facet counts.
- */
- facets?: Record<string, Record<string, number>>;
- /**
- * Statistics for numerical facets.
- */
- facets_stats?: Record<string, {
- /**
- * The minimum value in the result set.
- */
- min: number;
- /**
- * The maximum value in the result set.
- */
- max: number;
- /**
- * The average facet value in the result set.
- */
- avg: number;
- /**
- * The sum of all values in the result set.
- */
- sum: number;
- }>;
- /**
- * The query used to search. Accepts every character, and every character entered will be used in the search.
- *
- * An empty query can be used to fetch all records.
- */
- query: string;
- /**
- * A markup text indicating which parts of the original query have been removed in order to retrieve a non-empty result set.
- */
- queryAfterRemoval?: string;
- /**
- * A url-encoded string of all search parameters.
- */
- params: string;
- /**
- * Unique identifier of the search query, to be sent in Insights methods. This identifier links events back to the search query it represents.
- *
- * Returned only if clickAnalytics is true.
- */
- queryID?: string;
- /**
- * Used to return warnings about the query.
- */
- message?: string;
- /**
- * The computed geo location.
- *
- * Format: "lat,lng", where the latitude and longitude are expressed as decimal floating point number.
- */
- aroundLatLng?: string;
- /**
- * The automatically computed radius.
- */
- automaticRadius?: string;
- /**
- * Actual host name of the server that processed the request.
- *
- * Our DNS supports automatic failover and load balancing, so this may differ from the host name used in the request.
- */
- serverUsed?: string;
- /**
- * Index name used for the query.
- */
- index?: string;
- /**
- * Index name used for the query. In case of AB test, the index targetted isn’t always the index used by the query.
- */
- indexUsed?: string;
- /**
- * In case of AB test, reports the variant ID used. The variant ID is the position in the array of variants (starting at 1).
- */
- abTestVariantID?: number;
- /**
- * The query string that will be searched, after normalization.
- */
- parsedQuery?: string;
- /**
- * Custom user data.
- */
- userData?: any;
- /**
- * Rules applied to the query.
- */
- appliedRules?: Array<Record<string, any>>;
- /**
- * The explanation of the decompounding at query time.
- */
- explain?: {
- /**
- * The explain query match.
- */
- match: {
- /**
- * The explain query match alternatives.
- */
- alternatives: Array<{
- /**
- * The alternative type.
- */
- types: string[];
- /**
- * The list of alternative words.
- */
- words: string[];
- /**
- * The number of typos.
- */
- typos: number;
- /**
- * The offset.
- */
- offset: number;
- /**
- * The length.
- */
- length: number;
- }>;
- };
- /**
- * Query parameter reporting. Parameters are reported
- * as a JSON object with one field per parameter.
- */
- params?: Record<string, any>;
- };
- /**
- * The relevancy threshold applied to search in a virtual index.
- */
- appliedRelevancyStrictness?: number;
- renderingContent?: Settings['renderingContent'];
- };
- export declare const searchRules: (base: SearchIndex) => (query: string, requestOptions?: (RequestOptions & SearchRulesOptions) | undefined) => Readonly<Promise<SearchResponse<Rule>>>;
- export declare type SearchRulesOptions = {
- /**
- * Full text query.
- */
- readonly query?: string;
- /**
- * When specified, restricts matches to rules with a specific anchoring type. When omitted, all anchoring types may match.
- */
- readonly anchoring?: string;
- /**
- * Restricts matches to contextual rules with a specific context (exact match).
- */
- readonly context?: string;
- /**
- * Requested page (zero-based).
- */
- readonly page?: number;
- /**
- * Maximum number of hits in a page. Minimum is 1, maximum is 1000.
- */
- readonly hitsPerPage?: number;
- /**
- * When specified, restricts matches to rules with a specific enabled status.
- * When absent (default), all rules are retrieved, regardless of their enabled status.
- */
- readonly enabled?: boolean;
- };
- export declare const searchSynonyms: (base: SearchIndex) => (query: string, requestOptions?: (SearchSynonymsOptions & RequestOptions) | undefined) => Readonly<Promise<SearchSynonymsResponse>>;
- export declare type SearchSynonymsOptions = {
- /**
- * The synonym type.
- */
- readonly type?: string;
- /**
- * Page to retrieve.
- */
- readonly page?: number;
- /**
- * Number of hits per page.
- */
- readonly hitsPerPage?: number;
- };
- export declare type SearchSynonymsResponse = {
- /**
- * The list of synonyms.
- */
- hits: Synonym[];
- /**
- * The number of synonyms on the list.
- */
- nbHits: number;
- };
- export declare const searchUserIDs: (base: SearchClient) => (query: string, requestOptions?: (SearchUserIDsOptions & RequestOptions) | undefined) => Readonly<Promise<SearchUserIDsResponse>>;
- export declare type SearchUserIDsOptions = {
- /**
- * If specified, only clusters assigned to this cluster can be returned.
- * */
- readonly cluster?: string;
- /**
- * Page to fetch.
- */
- readonly page?: number;
- /**
- * Number of users to return by page.
- */
- readonly hitsPerPage?: number;
- };
- export declare type SearchUserIDsResponse = {
- /**
- * List of userID matching the query.
- */
- hits: UserIDResponse[];
- /**
- * Current page.
- */
- page: number;
- /**
- * Number of userIDs matching the query.
- */
- nbHits: number;
- /**
- * Number of hits retrieved per page.
- */
- hitsPerPage: number;
- /**
- * Timestamp of the last update of the index.
- */
- updatedAt: number;
- };
- export declare type SecuredApiKeyRestrictions = SearchOptions & {
- /**
- * A Unix timestamp used to define the expiration date of the API key.
- */
- readonly validUntil?: number;
- /**
- * List of index names that can be queried.
- */
- readonly restrictIndices?: readonly string[] | string;
- /**
- * IPv4 network allowed to use the generated key. This is used for more protection against API key leaking and reuse.
- */
- readonly restrictSources?: string;
- /**
- * Specify a user identifier. This is often used with rate limits.
- */
- readonly userToken?: string;
- };
- export declare const setDictionarySettings: (base: SearchClient) => (settings: DictionarySettings, requestOptions?: RequestOptions | undefined) => Readonly<WaitablePromise<DictionaryEntriesResponse>>;
- export declare const setSettings: (base: SearchIndex) => (settings: Settings, requestOptions?: (RequestOptions & SetSettingsOptions) | undefined) => Readonly<WaitablePromise<SetSettingsResponse>>;
- export declare type SetSettingsOptions = {
- /**
- * If the saved settings should be forward to replicas.
- */
- readonly forwardToReplicas?: boolean;
- };
- export declare type SetSettingsResponse = {
- /**
- * The operation task id. May be used to perform a wait task.
- */
- taskID: number;
- /**
- * When the settings got updated.
- */
- updatedAt: number;
- };
- export declare type Settings = {
- /**
- * The complete list of attributes that will be used for searching.
- */
- readonly searchableAttributes?: readonly string[];
- /**
- * @deprecated Use `searchableAttributes` instead.
- */
- readonly attributesToIndex?: readonly string[];
- /**
- * The complete list of attributes that will be used for faceting.
- */
- readonly attributesForFaceting?: readonly string[];
- /**
- * List of attributes that cannot be retrieved at query time.
- */
- readonly unretrievableAttributes?: readonly string[];
- /**
- * Gives control over which attributes to retrieve and which not to retrieve.
- */
- readonly attributesToRetrieve?: readonly string[];
- /**
- * Controls the way results are sorted.
- */
- readonly ranking?: readonly string[];
- /**
- * Specifies the custom ranking criterion.
- */
- readonly customRanking?: readonly string[];
- /**
- * Creates replicas, exact copies of an index.
- */
- readonly replicas?: readonly string[];
- /**
- * @deprecated Use `replicas` instead.
- */
- readonly slaves?: readonly string[];
- /**
- * The primary parameter is automatically added to a replica's settings when the replica is created and cannot be modified.
- *
- * Can not be setted.
- */
- readonly primary?: string;
- /**
- * Maximum number of facet values to return for each facet during a regular search.
- */
- readonly maxValuesPerFacet?: number;
- /**
- * Controls how facet values are sorted.
- */
- readonly sortFacetValuesBy?: 'count' | 'alpha';
- /**
- * List of attributes to highlight.
- */
- readonly attributesToHighlight?: readonly string[];
- /**
- * List of attributes to snippet, with an optional maximum number of words to snippet.
- */
- readonly attributesToSnippet?: readonly string[];
- /**
- * The HTML string to insert before the highlighted parts in all highlight and snippet results.
- */
- readonly highlightPreTag?: string;
- /**
- * The HTML string to insert after the highlighted parts in all highlight and snippet results.
- */
- readonly highlightPostTag?: string;
- /**
- * String used as an ellipsis indicator when a snippet is truncated.
- */
- readonly snippetEllipsisText?: string;
- /**
- * Restrict highlighting and snippeting to items that matched the query.
- */
- readonly restrictHighlightAndSnippetArrays?: boolean;
- /**
- * Set the number of hits per page.
- */
- readonly hitsPerPage?: number;
- /**
- * Set the maximum number of hits accessible via pagination.
- */
- readonly paginationLimitedTo?: number;
- /**
- * Minimum number of characters a word in the query string must contain to accept matches with 1 typo.
- */
- readonly minWordSizefor1Typo?: number;
- /**
- * Minimum number of characters a word in the query string must contain to accept matches with 2 typos.
- */
- readonly minWordSizefor2Typos?: number;
- /**
- * Controls whether typo tolerance is enabled and how it is applied.
- */
- readonly typoTolerance?: string | boolean;
- /**
- * hether to allow typos on numbers (“numeric tokens”) in the query string.
- */
- readonly allowTyposOnNumericTokens?: boolean;
- /**
- * List of attributes on which you want to disable typo tolerance.
- */
- readonly disableTypoToleranceOnAttributes?: readonly string[];
- /**
- * List of words on which you want to disable typo tolerance.
- */
- readonly disableTypoToleranceOnWords?: readonly string[];
- /**
- * Control which separators are indexed.
- */
- readonly separatorsToIndex?: string;
- /**
- * Treats singular, plurals, and other forms of declensions as matching terms.
- */
- readonly ignorePlurals?: readonly string[] | boolean;
- /**
- * Sets the languages to be used by language-specific settings and functionalities such as ignorePlurals, removeStopWords, and CJK word-detection.
- */
- readonly queryLanguages?: readonly string[];
- /**
- * A list of language ISO code.
- */
- readonly indexLanguages?: readonly string[];
- /**
- * Whether rules should be globally enabled.
- */
- readonly enableRules?: boolean;
- /**
- * Controls if and how query words are interpreted as prefixes.
- */
- readonly queryType?: 'prefixLast' | 'prefixAll' | 'prefixNone';
- /**
- * Selects a strategy to remove words from the query when it doesn’t match any hits.
- */
- readonly removeWordsIfNoResults?: 'none' | 'lastWords' | 'firstWords' | 'allOptional';
- /**
- * Enables the advanced query syntax.
- */
- readonly advancedSyntax?: boolean;
- /**
- * AdvancedSyntaxFeatures can be exactPhrase or excludeWords
- */
- readonly advancedSyntaxFeatures?: ReadonlyArray<'exactPhrase' | 'excludeWords'>;
- /**
- * A list of words that should be considered as optional when found in the query.
- */
- readonly optionalWords?: readonly string[];
- /**
- * List of attributes on which you want to disable prefix matching.
- */
- readonly disablePrefixOnAttributes?: readonly string[];
- /**
- * List of attributes on which you want to disable the exact ranking criterion.
- */
- readonly disableExactOnAttributes?: readonly string[];
- /**
- * Controls how the exact ranking criterion is computed when the query contains only one word.
- */
- readonly exactOnSingleWordQuery?: 'attribute' | 'none' | 'word';
- /**
- * List of alternatives that should be considered an exact match by the exact ranking criterion.
- */
- readonly alternativesAsExact?: ReadonlyArray<'ignorePlurals' | 'singleWordSynonym' | 'multiWordsSynonym'>;
- /**
- * Removes stop (common) words from the query before executing it.
- */
- readonly removeStopWords?: boolean | readonly string[];
- /**
- * List of numeric attributes that can be used as numerical filters.
- */
- readonly numericAttributesForFiltering?: readonly string[];
- /**
- * Enables compression of large integer arrays.
- */
- readonly allowCompressionOfIntegerArray?: boolean;
- /**
- * Name of the de-duplication attribute to be used with the distinct feature.
- */
- readonly attributeForDistinct?: string;
- /**
- * Enables de-duplication or grouping of results.
- */
- readonly distinct?: boolean | number;
- /**
- * Whether to highlight and snippet the original word that matches the synonym or the synonym itself.
- */
- readonly replaceSynonymsInHighlight?: boolean;
- /**
- * Allows proximity to impact which searchable attribute is matched in the attribute ranking stage.
- */
- readonly attributeCriteriaComputedByMinProximity?: boolean;
- /**
- * Precision of the proximity ranking criterion.
- */
- readonly minProximity?: number;
- /**
- * Choose which fields the response will contain. Applies to search and browse queries.
- */
- readonly responseFields?: readonly string[];
- /**
- * Maximum number of facet hits to return during a search for facet values.
- */
- readonly maxFacetHits?: number;
- /**
- * List of attributes on which to do a decomposition of camel case words.
- */
- readonly camelCaseAttributes?: readonly string[];
- /**
- * Specify on which attributes in your index Algolia should apply word-splitting (“decompounding”)
- */
- readonly decompoundedAttributes?: Readonly<Record<string, readonly string[]>>;
- /**
- * Characters that should not be automatically normalized by the search engine.
- */
- readonly keepDiacriticsOnCharacters?: string;
- /**
- * Overrides Algolia's default normalization.
- */
- readonly customNormalization?: Readonly<Record<string, Readonly<Record<string, string>>>>;
- /**
- * Enable personalization for queries by default
- */
- readonly enablePersonalization?: boolean;
- /**
- * Custom userData that could be added to the Settings.
- */
- readonly userData?: any;
- /**
- * Enable word segmentation (also called decompounding) at query time for
- * compatible languages. For example, this turns the Dutch query
- * "spaanplaatbehang" into "spaan plaat behang" to retrieve more relevant
- * results.
- */
- readonly decompoundQuery?: boolean;
- /**
- * Specify on which attributes in your index Algolia should apply Japanese
- * transliteration to make words indexed in Katakana or Kanji searchable in Hiragana.
- */
- readonly attributesToTransliterate?: readonly string[];
- /**
- * The relevancy threshold to apply to search in a virtual index [0-100]. A Bigger
- * value means fewer, but more relevant results, smaller value means more, but
- * less relevant results.
- */
- readonly relevancyStrictness?: number;
- /**
- * Content defining how the search interface should be rendered.
- * This is set via the settings for a default value and can be overridden via rules
- */
- readonly renderingContent?: {
- /**
- * defining how facets should be ordered
- */
- readonly facetOrdering?: {
- /**
- * the ordering of facets (widgets)
- */
- readonly facets?: {
- /**
- * pinned order of facet lists
- */
- readonly order?: readonly string[];
- };
- /**
- * the ordering of facet values, within an individual list
- */
- readonly values?: {
- readonly [facet: string]: {
- /**
- * pinned order of facet values
- */
- readonly order?: readonly string[];
- /**
- * How to display the remaining items.
- * - facet count (descending)
- * - alphabetical (ascending)
- * - hidden (show only pinned values)
- */
- readonly sortRemainingBy?: 'count' | 'alpha' | 'hidden';
- };
- };
- };
- };
- /**
- * Whether this index should use Dynamic Re-Ranking.
- * @link https://www.algolia.com/doc/guides/algolia-ai/re-ranking/
- *
- * Note: You need to turn on Dynamic Re-Ranking on your index for it to have an effect on
- * your search results. You can do this through the Re-Ranking page on the dashboard.
- */
- readonly enableReRanking?: boolean;
- /**
- * When Dynamic Re-Ranking is enabled, only records that match these filters will be impacted by Dynamic Re-Ranking.
- */
- readonly reRankingApplyFilter?: string | readonly string[] | ReadonlyArray<readonly string[] | string> | null;
- };
- declare type SharedMultipleQueriesQuery = {
- /**
- * The type of query to perform.
- *
- * @defaultValue "default"
- */
- readonly type?: 'default' | 'facet';
- /**
- * The index name.
- */
- readonly indexName: string;
- /**
- * The search options.
- */
- readonly params?: SearchOptions;
- /**
- * The query associated with the request.
- */
- readonly query?: string;
- };
- declare type SnippetMatch = {
- readonly value: string;
- readonly matchLevel: 'none' | 'partial' | 'full';
- };
- export declare type SnippetResult<THit> = THit extends string | number ? SnippetMatch : {
- [KAttribute in keyof THit]: SnippetResult<THit[KAttribute]>;
- };
- export declare const StrategyEnum: Readonly<Record<string, StrategyType>>;
- export declare type StrategyType = 'none' | 'stopIfEnoughMatches';
- export declare type Synonym = {
- /**
- * Synonym object ID.
- */
- readonly objectID: string;
- /**
- * There are 4 synonym types. The parameter can be one of the following value.
- */
- readonly type: SynonymType;
- /**
- * A list of synonyms.
- */
- readonly synonyms?: readonly string[];
- /**
- * Defines the synonym. A word or expression, used as the basis for the array of synonyms.
- */
- readonly input?: string;
- /**
- * A single word, used as the basis for the below array of corrections.
- */
- readonly word?: string;
- /**
- * An list of corrections of the word.
- */
- readonly corrections?: readonly string[];
- /**
- * A single word, used as the basis for the below list of replacements.
- */
- readonly placeholder?: string;
- /**
- * An list of replacements of the placeholder.
- */
- readonly replacements?: readonly string[];
- };
- export declare const SynonymEnum: Readonly<Record<string, SynonymType>>;
- export declare type SynonymType = 'synonym' | 'oneWaySynonym' | 'altCorrection1' | 'altCorrection2' | 'placeholder';
- export declare type TaskStatusResponse = {
- /**
- * The operation status. When the value is `published` the
- * operation is completed.
- */
- status: string;
- /**
- * If the operation is pending.
- */
- pendingTask: boolean;
- };
- export declare type TimeRange = {
- /**
- * DateTime with UTC offset for Serialization/Deserialization in unix timespan.
- */
- readonly from: number;
- /**
- * DateTime with UTC offset for Serialization/Deserialization in unix timespan.
- */
- readonly until: number;
- };
- export declare const updateApiKey: (base: SearchClient) => (apiKey: string, requestOptions?: (UpdateApiKeyOptions & Pick<RequestOptions, string | number>) | undefined) => Readonly<WaitablePromise<UpdateApiKeyResponse>>;
- export declare type UpdateApiKeyOptions = {
- /**
- * List of permissions the key contains.
- */
- readonly acl?: readonly ApiKeyACLType[];
- /**
- * A Unix timestamp used to define the expiration date of the API key.
- */
- readonly validity?: number;
- /**
- * Specify the maximum number of hits this API key can retrieve in one call.
- * This parameter can be used to protect you from attempts at retrieving your entire index contents by massively querying the index.
- */
- readonly maxHitsPerQuery?: number;
- /**
- * Specify the maximum number of API calls allowed from an IP address per hour. Each time an API call is performed with this key, a check is performed.
- */
- readonly maxQueriesPerIPPerHour?: number;
- /**
- * Specify the list of targeted indices. You can target all indices starting with a prefix or ending with a suffix using the ‘*’ character.
- */
- readonly indexes?: readonly string[];
- /**
- * Specify the list of referers. You can target all referers starting with a prefix, ending with a suffix using the ‘*’ character.
- */
- readonly referers?: readonly string[];
- /**
- * Specify the list of query parameters. You can force the query parameters for a query using the url string format.
- */
- readonly queryParameters?: string;
- /**
- * Specify a description of the API key. Used for informative purposes only. It has impact on the functionality of the API key.
- */
- readonly description?: string;
- };
- export declare type UpdateApiKeyResponse = {
- /**
- * The api key.
- */
- key: string;
- /**
- * Date of update
- */
- updatedAt: string;
- };
- export declare type UserIDResponse = {
- /**
- * userID of the user.
- */
- userID: string;
- /**
- * Cluster on which the user is assigned
- */
- clusterName: string;
- /**
- * Number of records belonging to the user.
- */
- nbRecords: number;
- /**
- * Data size used by the user.
- */
- dataSize: number;
- };
- export declare const waitAppTask: (base: SearchClient) => (taskID: number, requestOptions?: RequestOptions | undefined) => Readonly<Promise<void>>;
- export declare const waitTask: (base: SearchIndex) => (taskID: number, requestOptions?: RequestOptions | undefined) => Readonly<Promise<void>>;
- export { }
|