@algolia/composition 0.0.1-beta.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,826 @@
1
+ import * as _algolia_client_common from '@algolia/client-common';
2
+ import { CreateClientOptions, RequestOptions, ClientOptions } from '@algolia/client-common';
3
+
4
+ type FacetHits = {
5
+ /**
6
+ * Facet value.
7
+ */
8
+ value: string;
9
+ /**
10
+ * Highlighted attribute value, including HTML tags.
11
+ */
12
+ highlighted: string;
13
+ /**
14
+ * Number of records with this facet value. [The count may be approximated](https://support.algolia.com/hc/en-us/articles/4406975248145-Why-are-my-facet-and-hit-counts-not-accurate-).
15
+ */
16
+ count: number;
17
+ };
18
+
19
+ type SearchForFacetValuesResults = {
20
+ indexName: string;
21
+ /**
22
+ * Matching facet values.
23
+ */
24
+ facetHits: Array<FacetHits>;
25
+ /**
26
+ * Whether the facet count is exhaustive (true) or approximate (false). For more information, see [Why are my facet and hit counts not accurate](https://support.algolia.com/hc/en-us/articles/4406975248145-Why-are-my-facet-and-hit-counts-not-accurate-).
27
+ */
28
+ exhaustiveFacetsCount: boolean;
29
+ /**
30
+ * Time the server took to process the request, in milliseconds.
31
+ */
32
+ processingTimeMS?: number;
33
+ };
34
+
35
+ type SearchForFacetValuesResponse = {
36
+ /**
37
+ * Search for facet values results.
38
+ */
39
+ results?: Array<SearchForFacetValuesResults>;
40
+ };
41
+
42
+ type CompositionRunAppliedRules = {
43
+ /**
44
+ * Unique record identifier.
45
+ */
46
+ objectID: string;
47
+ };
48
+
49
+ type CompositionRunSearchResponse = Record<string, any> & {
50
+ /**
51
+ * Unique record identifier.
52
+ */
53
+ objectID: string;
54
+ appliedRules?: Array<CompositionRunAppliedRules>;
55
+ };
56
+
57
+ type CompositionsSearchResponse = Record<string, any> & {
58
+ run: Array<CompositionRunSearchResponse>;
59
+ };
60
+
61
+ type CompositionBaseSearchResponse = Record<string, any> & {
62
+ compositions?: CompositionsSearchResponse;
63
+ };
64
+
65
+ /**
66
+ * Whether certain properties of the search response are calculated exhaustive (exact) or approximated.
67
+ */
68
+ type Exhaustive = {
69
+ /**
70
+ * Whether the facet count is exhaustive (`true`) or approximate (`false`). See the [related discussion](https://support.algolia.com/hc/en-us/articles/4406975248145-Why-are-my-facet-and-hit-counts-not-accurate-).
71
+ */
72
+ facetsCount?: boolean;
73
+ /**
74
+ * The value is `false` if not all facet values are retrieved.
75
+ */
76
+ facetValues?: boolean;
77
+ /**
78
+ * Whether the `nbHits` is exhaustive (`true`) or approximate (`false`). When the query takes more than 50ms to be processed, the engine makes an approximation. This can happen when using complex filters on millions of records, when typo-tolerance was not exhaustive, or when enough hits have been retrieved (for example, after the engine finds 10,000 exact matches). `nbHits` is reported as non-exhaustive whenever an approximation is made, even if the approximation didn’t, in the end, impact the exhaustivity of the query.
79
+ */
80
+ nbHits?: boolean;
81
+ /**
82
+ * Rules matching exhaustivity. The value is `false` if rules were enable for this query, and could not be fully processed due a timeout. This is generally caused by the number of alternatives (such as typos) which is too large.
83
+ */
84
+ rulesMatch?: boolean;
85
+ /**
86
+ * Whether the typo search was exhaustive (`true`) or approximate (`false`). An approximation is done when the typo search query part takes more than 10% of the query budget (ie. 5ms by default) to be processed (this can happen when a lot of typo alternatives exist for the query). This field will not be included when typo-tolerance is entirely disabled.
87
+ */
88
+ typo?: boolean;
89
+ };
90
+
91
+ type FacetStats = {
92
+ /**
93
+ * Minimum value in the results.
94
+ */
95
+ min?: number;
96
+ /**
97
+ * Maximum value in the results.
98
+ */
99
+ max?: number;
100
+ /**
101
+ * Average facet value in the results.
102
+ */
103
+ avg?: number;
104
+ /**
105
+ * Sum of all values in the results.
106
+ */
107
+ sum?: number;
108
+ };
109
+
110
+ /**
111
+ * Redirect rule data.
112
+ */
113
+ type RedirectRuleIndexData = {
114
+ ruleObjectID: string;
115
+ };
116
+
117
+ type RedirectRuleIndexMetadata = {
118
+ /**
119
+ * Source index for the redirect rule.
120
+ */
121
+ source: string;
122
+ /**
123
+ * Destination index for the redirect rule.
124
+ */
125
+ dest: string;
126
+ /**
127
+ * Reason for the redirect rule.
128
+ */
129
+ reason: string;
130
+ /**
131
+ * Redirect rule status.
132
+ */
133
+ succeed: boolean;
134
+ data: RedirectRuleIndexData;
135
+ };
136
+
137
+ /**
138
+ * [Redirect results to a URL](https://www.algolia.com/doc/guides/managing-results/rules/merchandising-and-promoting/how-to/redirects/), this this parameter is for internal use only.
139
+ */
140
+ type Redirect = {
141
+ index?: Array<RedirectRuleIndexMetadata>;
142
+ };
143
+
144
+ /**
145
+ * Order of facet names.
146
+ */
147
+ type Facets = {
148
+ /**
149
+ * Explicit order of facets or facet values. This setting lets you always show specific facets or facet values at the top of the list.
150
+ */
151
+ order?: Array<string>;
152
+ };
153
+
154
+ /**
155
+ * Order of facet values that aren\'t explicitly positioned with the `order` setting. - `count`. Order remaining facet values by decreasing count. The count is the number of matching records containing this facet value. - `alpha`. Sort facet values alphabetically. - `hidden`. Don\'t show facet values that aren\'t explicitly positioned.
156
+ */
157
+ type SortRemainingBy = 'count' | 'alpha' | 'hidden';
158
+
159
+ type Value = {
160
+ /**
161
+ * Explicit order of facets or facet values. This setting lets you always show specific facets or facet values at the top of the list.
162
+ */
163
+ order?: Array<string>;
164
+ sortRemainingBy?: SortRemainingBy;
165
+ /**
166
+ * Hide facet values.
167
+ */
168
+ hide?: Array<string>;
169
+ };
170
+
171
+ /**
172
+ * Order of facet names and facet values in your UI.
173
+ */
174
+ type FacetOrdering = {
175
+ facets?: Facets;
176
+ /**
177
+ * Order of facet values. One object for each facet.
178
+ */
179
+ values?: {
180
+ [key: string]: Value;
181
+ };
182
+ };
183
+
184
+ /**
185
+ * The redirect rule container.
186
+ */
187
+ type RedirectURL = {
188
+ url?: string;
189
+ };
190
+
191
+ /**
192
+ * URL for an image to show inside a banner.
193
+ */
194
+ type BannerImageUrl = {
195
+ url?: string;
196
+ };
197
+
198
+ /**
199
+ * Image to show inside a banner.
200
+ */
201
+ type BannerImage = {
202
+ urls?: Array<BannerImageUrl>;
203
+ title?: string;
204
+ };
205
+
206
+ /**
207
+ * Link for a banner defined in the Merchandising Studio.
208
+ */
209
+ type BannerLink = {
210
+ url?: string;
211
+ };
212
+
213
+ /**
214
+ * Banner with image and link to redirect users.
215
+ */
216
+ type Banner = {
217
+ image?: BannerImage;
218
+ link?: BannerLink;
219
+ };
220
+
221
+ /**
222
+ * Widgets returned from any rules that are applied to the current search.
223
+ */
224
+ type Widgets = {
225
+ /**
226
+ * Banners defined in the Merchandising Studio for a given search.
227
+ */
228
+ banners?: Array<Banner>;
229
+ };
230
+
231
+ /**
232
+ * Extra data that can be used in the search UI. You can use this to control aspects of your search UI, such as the order of facet names and values without changing your frontend code.
233
+ */
234
+ type RenderingContent = {
235
+ facetOrdering?: FacetOrdering;
236
+ redirect?: RedirectURL;
237
+ widgets?: Widgets;
238
+ };
239
+
240
+ type BaseSearchResponse = Record<string, any> & {
241
+ /**
242
+ * A/B test ID. This is only included in the response for indices that are part of an A/B test.
243
+ */
244
+ abTestID?: number;
245
+ /**
246
+ * Variant ID. This is only included in the response for indices that are part of an A/B test.
247
+ */
248
+ abTestVariantID?: number;
249
+ /**
250
+ * Computed geographical location.
251
+ */
252
+ aroundLatLng?: string;
253
+ /**
254
+ * Distance from a central coordinate provided by `aroundLatLng`.
255
+ */
256
+ automaticRadius?: string;
257
+ exhaustive?: Exhaustive;
258
+ /**
259
+ * Rules applied to the query.
260
+ */
261
+ appliedRules?: Array<Record<string, unknown>>;
262
+ /**
263
+ * See the `facetsCount` field of the `exhaustive` object in the response.
264
+ */
265
+ exhaustiveFacetsCount?: boolean;
266
+ /**
267
+ * See the `nbHits` field of the `exhaustive` object in the response.
268
+ */
269
+ exhaustiveNbHits?: boolean;
270
+ /**
271
+ * See the `typo` field of the `exhaustive` object in the response.
272
+ */
273
+ exhaustiveTypo?: boolean;
274
+ /**
275
+ * Facet counts.
276
+ */
277
+ facets?: {
278
+ [key: string]: {
279
+ [key: string]: number;
280
+ };
281
+ };
282
+ /**
283
+ * Statistics for numerical facets.
284
+ */
285
+ facets_stats?: {
286
+ [key: string]: FacetStats;
287
+ };
288
+ /**
289
+ * Index name used for the query.
290
+ */
291
+ index?: string;
292
+ /**
293
+ * Index name used for the query. During A/B testing, the targeted index isn\'t always the index used by the query.
294
+ */
295
+ indexUsed?: string;
296
+ /**
297
+ * Warnings about the query.
298
+ */
299
+ message?: string;
300
+ /**
301
+ * Number of hits selected and sorted by the relevant sort algorithm.
302
+ */
303
+ nbSortedHits?: number;
304
+ /**
305
+ * Post-[normalization](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/#what-does-normalization-mean) query string that will be searched.
306
+ */
307
+ parsedQuery?: string;
308
+ /**
309
+ * Time the server took to process the request, in milliseconds.
310
+ */
311
+ processingTimeMS: number;
312
+ /**
313
+ * Experimental. List of processing steps and their times, in milliseconds. You can use this list to investigate performance issues.
314
+ */
315
+ processingTimingsMS?: Record<string, unknown>;
316
+ /**
317
+ * Markup text indicating which parts of the original query have been removed to retrieve a non-empty result set.
318
+ */
319
+ queryAfterRemoval?: string;
320
+ redirect?: Redirect;
321
+ renderingContent?: RenderingContent;
322
+ /**
323
+ * Time the server took to process the request, in milliseconds.
324
+ */
325
+ serverTimeMS?: number;
326
+ /**
327
+ * Host name of the server that processed the request.
328
+ */
329
+ serverUsed?: string;
330
+ /**
331
+ * An object with custom data. You can store up to 32kB as custom data.
332
+ */
333
+ userData?: Record<string, unknown>;
334
+ /**
335
+ * Unique identifier for the query. This is used for [click analytics](https://www.algolia.com/doc/guides/analytics/click-analytics/).
336
+ */
337
+ queryID?: string;
338
+ /**
339
+ * Whether automatic events collection is enabled for the application.
340
+ */
341
+ _automaticInsights?: boolean;
342
+ };
343
+
344
+ type ResultsInjectedItemAppliedRulesInfoResponse = {
345
+ /**
346
+ * Unique record identifier.
347
+ */
348
+ objectID: string;
349
+ };
350
+
351
+ type ResultsInjectedItemInfoResponse = Record<string, any> & {
352
+ key: string;
353
+ appliedRules?: Array<ResultsInjectedItemAppliedRulesInfoResponse>;
354
+ };
355
+
356
+ type ResultsCompositionInfoResponse = {
357
+ injectedItems: Array<ResultsInjectedItemInfoResponse>;
358
+ };
359
+
360
+ type ResultsCompositionsResponse = Record<string, any> & {
361
+ compositions: {
362
+ [key: string]: ResultsCompositionInfoResponse;
363
+ };
364
+ };
365
+
366
+ /**
367
+ * Whether the whole query string matches or only a part.
368
+ */
369
+ type MatchLevel = 'none' | 'partial' | 'full';
370
+
371
+ /**
372
+ * Surround words that match the query with HTML tags for highlighting.
373
+ */
374
+ type HighlightResultOption = {
375
+ /**
376
+ * Highlighted attribute value, including HTML tags.
377
+ */
378
+ value: string;
379
+ matchLevel: MatchLevel;
380
+ /**
381
+ * List of matched words from the search query.
382
+ */
383
+ matchedWords: Array<string>;
384
+ /**
385
+ * Whether the entire attribute value is highlighted.
386
+ */
387
+ fullyHighlighted?: boolean;
388
+ };
389
+
390
+ type HighlightResult = HighlightResultOption | {
391
+ [key: string]: HighlightResult;
392
+ } | Array<HighlightResult>;
393
+
394
+ type CompositionIdRankingInfo = {
395
+ index: string;
396
+ injectedItemKey: string;
397
+ };
398
+
399
+ type CompositionRankingInfo = {
400
+ composed?: {
401
+ [key: string]: CompositionIdRankingInfo;
402
+ };
403
+ };
404
+
405
+ type MatchedGeoLocation = {
406
+ /**
407
+ * Latitude of the matched location.
408
+ */
409
+ lat?: number;
410
+ /**
411
+ * Longitude of the matched location.
412
+ */
413
+ lng?: number;
414
+ /**
415
+ * Distance between the matched location and the search location (in meters).
416
+ */
417
+ distance?: number;
418
+ };
419
+
420
+ type Personalization = {
421
+ /**
422
+ * The score of the filters.
423
+ */
424
+ filtersScore?: number;
425
+ /**
426
+ * The score of the ranking.
427
+ */
428
+ rankingScore?: number;
429
+ /**
430
+ * The score of the event.
431
+ */
432
+ score?: number;
433
+ };
434
+
435
+ /**
436
+ * Object with detailed information about the record\'s ranking.
437
+ */
438
+ type RankingInfo = {
439
+ /**
440
+ * Whether a filter matched the query.
441
+ */
442
+ filters?: number;
443
+ /**
444
+ * Position of the first matched word in the best matching attribute of the record.
445
+ */
446
+ firstMatchedWord: number;
447
+ /**
448
+ * Distance between the geo location in the search query and the best matching geo location in the record, divided by the geo precision (in meters).
449
+ */
450
+ geoDistance: number;
451
+ /**
452
+ * Precision used when computing the geo distance, in meters.
453
+ */
454
+ geoPrecision?: number;
455
+ matchedGeoLocation?: MatchedGeoLocation;
456
+ personalization?: Personalization;
457
+ /**
458
+ * Number of exactly matched words.
459
+ */
460
+ nbExactWords: number;
461
+ /**
462
+ * Number of typos encountered when matching the record.
463
+ */
464
+ nbTypos: number;
465
+ /**
466
+ * Whether the record was promoted by a rule.
467
+ */
468
+ promoted?: boolean;
469
+ /**
470
+ * Number of words between multiple matches in the query plus 1. For single word queries, `proximityDistance` is 0.
471
+ */
472
+ proximityDistance?: number;
473
+ /**
474
+ * Overall ranking of the record, expressed as a single integer. This attribute is internal.
475
+ */
476
+ userScore: number;
477
+ /**
478
+ * Number of matched words.
479
+ */
480
+ words?: number;
481
+ /**
482
+ * Whether the record is re-ranked.
483
+ */
484
+ promotedByReRanking?: boolean;
485
+ };
486
+
487
+ type HitRankingInfo = RankingInfo & CompositionRankingInfo;
488
+
489
+ /**
490
+ * Snippets that show the context around a matching search query.
491
+ */
492
+ type SnippetResultOption = {
493
+ /**
494
+ * Highlighted attribute value, including HTML tags.
495
+ */
496
+ value: string;
497
+ matchLevel: MatchLevel;
498
+ };
499
+
500
+ type SnippetResult = SnippetResultOption | {
501
+ [key: string]: SnippetResult;
502
+ } | Array<SnippetResult>;
503
+
504
+ /**
505
+ * Search result. A hit is a record from your index, augmented with special attributes for highlighting, snippeting, and ranking.
506
+ */
507
+ type Hit<T = Record<string, unknown>> = T & {
508
+ /**
509
+ * Unique record identifier.
510
+ */
511
+ objectID: string;
512
+ /**
513
+ * Surround words that match the query with HTML tags for highlighting.
514
+ */
515
+ _highlightResult?: {
516
+ [key: string]: HighlightResult;
517
+ };
518
+ /**
519
+ * Snippets that show the context around a matching search query.
520
+ */
521
+ _snippetResult?: {
522
+ [key: string]: SnippetResult;
523
+ };
524
+ _rankingInfo?: HitRankingInfo;
525
+ _distinctSeqID?: number;
526
+ };
527
+
528
+ type SearchHits<T = Record<string, unknown>> = Record<string, any> & {
529
+ /**
530
+ * Search results (hits). Hits are records from your index that match the search criteria, augmented with additional attributes, such as, for highlighting.
531
+ */
532
+ hits: Hit<T>[];
533
+ /**
534
+ * Search query.
535
+ */
536
+ query: string;
537
+ /**
538
+ * URL-encoded string of all search parameters.
539
+ */
540
+ params: string;
541
+ };
542
+
543
+ type SearchPagination = {
544
+ /**
545
+ * Page of search results to retrieve.
546
+ */
547
+ page: number;
548
+ /**
549
+ * Number of results (hits).
550
+ */
551
+ nbHits: number;
552
+ /**
553
+ * Number of pages of results.
554
+ */
555
+ nbPages: number;
556
+ /**
557
+ * Number of hits per page.
558
+ */
559
+ hitsPerPage: number;
560
+ };
561
+
562
+ type SearchResultsItem<T = Record<string, unknown>> = BaseSearchResponse & SearchPagination & SearchHits<T> & ResultsCompositionsResponse;
563
+
564
+ type SearchResults<T = Record<string, unknown>> = {
565
+ /**
566
+ * Search results.
567
+ */
568
+ results: SearchResultsItem<T>[];
569
+ };
570
+
571
+ type SearchResponse<T = Record<string, unknown>> = CompositionBaseSearchResponse & SearchResults<T>;
572
+
573
+ /**
574
+ * Range object with lower and upper values in meters to define custom ranges.
575
+ */
576
+ type Range = {
577
+ /**
578
+ * Lower boundary of a range in meters. The Geo ranking criterion considers all records within the range to be equal.
579
+ */
580
+ from?: number;
581
+ /**
582
+ * Upper boundary of a range in meters. The Geo ranking criterion considers all records within the range to be equal.
583
+ */
584
+ value?: number;
585
+ };
586
+
587
+ /**
588
+ * Precision of a coordinate-based search in meters to group results with similar distances. The Geo ranking criterion considers all matches within the same range of distances to be equal.
589
+ */
590
+ type AroundPrecision = number | Array<Range>;
591
+
592
+ /**
593
+ * Return all records with a valid `_geoloc` attribute. Don\'t filter by distance.
594
+ */
595
+ type AroundRadiusAll = 'all';
596
+
597
+ /**
598
+ * Maximum radius for a search around a central location. This parameter works in combination with the `aroundLatLng` and `aroundLatLngViaIP` parameters. By default, the search radius is determined automatically from the density of hits around the central location. The search radius is small if there are many hits close to the central coordinates.
599
+ */
600
+ type AroundRadius = number | AroundRadiusAll;
601
+
602
+ /**
603
+ * Filter the search by facet values, so that only records with the same facet values are retrieved. **Prefer using the `filters` parameter, which supports all filter types and combinations with boolean operators.** - `[filter1, filter2]` is interpreted as `filter1 AND filter2`. - `[[filter1, filter2], filter3]` is interpreted as `filter1 OR filter2 AND filter3`. - `facet:-value` is interpreted as `NOT facet:value`. While it\'s best to avoid attributes that start with a `-`, you can still filter them by escaping with a backslash: `facet:\\-value`.
604
+ */
605
+ type FacetFilters = Array<FacetFilters> | string;
606
+
607
+ type InsideBoundingBox = string | Array<Array<number>>;
608
+
609
+ /**
610
+ * Filter by numeric facets. **Prefer using the `filters` parameter, which supports all filter types and combinations with boolean operators.** You can use numeric comparison operators: `<`, `<=`, `=`, `!=`, `>`, `>=`. Comparisons are precise up to 3 decimals. You can also provide ranges: `facet:<lower> TO <upper>`. The range includes the lower and upper boundaries. The same combination rules apply as for `facetFilters`.
611
+ */
612
+ type NumericFilters = Array<NumericFilters> | string;
613
+
614
+ /**
615
+ * Filters to promote or demote records in the search results. Optional filters work like facet filters, but they don\'t exclude records from the search results. Records that match the optional filter rank before records that don\'t match. If you\'re using a negative filter `facet:-value`, matching records rank after records that don\'t match. - Optional filters don\'t work on virtual replicas. - Optional filters are applied _after_ sort-by attributes. - Optional filters are applied _before_ custom ranking attributes (in the default [ranking](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/)). - Optional filters don\'t work with numeric attributes.
616
+ */
617
+ type OptionalFilters = Array<OptionalFilters> | string;
618
+
619
+ /**
620
+ * ISO code for a supported language.
621
+ */
622
+ type SupportedLanguage = 'af' | 'ar' | 'az' | 'bg' | 'bn' | 'ca' | 'cs' | 'cy' | 'da' | 'de' | 'el' | 'en' | 'eo' | 'es' | 'et' | 'eu' | 'fa' | 'fi' | 'fo' | 'fr' | 'ga' | 'gl' | 'he' | 'hi' | 'hu' | 'hy' | 'id' | 'is' | 'it' | 'ja' | 'ka' | 'kk' | 'ko' | 'ku' | 'ky' | 'lt' | 'lv' | 'mi' | 'mn' | 'mr' | 'ms' | 'mt' | 'nb' | 'nl' | 'no' | 'ns' | 'pl' | 'ps' | 'pt' | 'pt-br' | 'qu' | 'ro' | 'ru' | 'sk' | 'sq' | 'sv' | 'sw' | 'ta' | 'te' | 'th' | 'tl' | 'tn' | 'tr' | 'tt' | 'uk' | 'ur' | 'uz' | 'zh';
623
+
624
+ type Params = {
625
+ /**
626
+ * Search query.
627
+ */
628
+ query?: string;
629
+ /**
630
+ * Filter expression to only include items that match the filter criteria in the response. You can use these filter expressions: - **Numeric filters.** `<facet> <op> <number>`, where `<op>` is one of `<`, `<=`, `=`, `!=`, `>`, `>=`. - **Ranges.** `<facet>:<lower> TO <upper>` where `<lower>` and `<upper>` are the lower and upper limits of the range (inclusive). - **Facet filters.** `<facet>:<value>` where `<facet>` is a facet attribute (case-sensitive) and `<value>` a facet value. - **Tag filters.** `_tags:<value>` or just `<value>` (case-sensitive). - **Boolean filters.** `<facet>: true | false`. You can combine filters with `AND`, `OR`, and `NOT` operators with the following restrictions: - You can only combine filters of the same type with `OR`. **Not supported:** `facet:value OR num > 3`. - You can\'t use `NOT` with combinations of filters. **Not supported:** `NOT(facet:value OR facet:value)` - You can\'t combine conjunctions (`AND`) with `OR`. **Not supported:** `facet:value OR (facet:value AND facet:value)` Use quotes around your filters, if the facet attribute name or facet value has spaces, keywords (`OR`, `AND`, `NOT`), or quotes. If a facet attribute is an array, the filter matches if it matches at least one element of the array. For more information, see [Filters](https://www.algolia.com/doc/guides/managing-results/refine-results/filtering/).
631
+ */
632
+ filters?: string;
633
+ /**
634
+ * Page of search results to retrieve.
635
+ */
636
+ page?: number;
637
+ /**
638
+ * Whether the search response should include detailed ranking information.
639
+ */
640
+ getRankingInfo?: boolean;
641
+ relevancyStrictness?: number;
642
+ facetFilters?: FacetFilters;
643
+ optionalFilters?: OptionalFilters;
644
+ numericFilters?: NumericFilters;
645
+ /**
646
+ * Number of hits per page.
647
+ */
648
+ hitsPerPage?: number;
649
+ /**
650
+ * Coordinates for the center of a circle, expressed as a comma-separated string of latitude and longitude. Only records included within a circle around this central location are included in the results. The radius of the circle is determined by the `aroundRadius` and `minimumAroundRadius` settings. This parameter is ignored if you also specify `insidePolygon` or `insideBoundingBox`.
651
+ */
652
+ aroundLatLng?: string;
653
+ /**
654
+ * Whether to obtain the coordinates from the request\'s IP address.
655
+ */
656
+ aroundLatLngViaIP?: boolean;
657
+ aroundRadius?: AroundRadius;
658
+ aroundPrecision?: AroundPrecision;
659
+ /**
660
+ * Minimum radius (in meters) for a search around a location when `aroundRadius` isn\'t set.
661
+ */
662
+ minimumAroundRadius?: number;
663
+ insideBoundingBox?: InsideBoundingBox | null;
664
+ /**
665
+ * Coordinates of a polygon in which to search. Polygons are defined by 3 to 10,000 points. Each point is represented by its latitude and longitude. Provide multiple polygons as nested arrays. For more information, see [filtering inside polygons](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filtering-inside-rectangular-or-polygonal-areas). This parameter is ignored if you also specify `insideBoundingBox`.
666
+ */
667
+ insidePolygon?: Array<Array<number>>;
668
+ /**
669
+ * Languages for language-specific query processing steps such as plurals, stop-word removal, and word-detection dictionaries. This setting sets a default list of languages used by the `removeStopWords` and `ignorePlurals` settings. This setting also sets a dictionary for word detection in the logogram-based [CJK](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/normalization/#normalization-for-logogram-based-languages-cjk) languages. To support this, you must place the CJK language **first**. **You should always specify a query language.** If you don\'t specify an indexing language, the search engine uses all [supported languages](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/supported-languages/), or the languages you specified with the `ignorePlurals` or `removeStopWords` parameters. This can lead to unexpected search results. For more information, see [Language-specific configuration](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/language-specific-configurations/).
670
+ */
671
+ queryLanguages?: Array<SupportedLanguage>;
672
+ /**
673
+ * ISO language codes that adjust settings that are useful for processing natural language queries (as opposed to keyword searches): - Sets `removeStopWords` and `ignorePlurals` to the list of provided languages. - Sets `removeWordsIfNoResults` to `allOptional`. - Adds a `natural_language` attribute to `ruleContexts` and `analyticsTags`.
674
+ */
675
+ naturalLanguages?: Array<SupportedLanguage>;
676
+ /**
677
+ * Whether to enable rules.
678
+ */
679
+ enableRules?: boolean;
680
+ /**
681
+ * Assigns a rule context to the search query. [Rule contexts](https://www.algolia.com/doc/guides/managing-results/rules/rules-overview/how-to/customize-search-results-by-platform/#whats-a-context) are strings that you can use to trigger matching rules.
682
+ */
683
+ ruleContexts?: Array<string>;
684
+ /**
685
+ * Unique pseudonymous or anonymous user identifier. This helps with analytics and click and conversion events. For more information, see [user token](https://www.algolia.com/doc/guides/sending-events/concepts/usertoken/).
686
+ */
687
+ userToken?: string;
688
+ /**
689
+ * Whether to include a `queryID` attribute in the response. The query ID is a unique identifier for a search query and is required for tracking [click and conversion events](https://www.algolia.com/guides/sending-events/getting-started/).
690
+ */
691
+ clickAnalytics?: boolean;
692
+ /**
693
+ * Whether this search will be included in Analytics.
694
+ */
695
+ analytics?: boolean;
696
+ /**
697
+ * Tags to apply to the query for [segmenting analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).
698
+ */
699
+ analyticsTags?: Array<string>;
700
+ /**
701
+ * Whether to enable A/B testing for this search.
702
+ */
703
+ enableABTest?: boolean;
704
+ /**
705
+ * Whether this search will use [Dynamic Re-Ranking](https://www.algolia.com/doc/guides/algolia-ai/re-ranking/). This setting only has an effect if you activated Dynamic Re-Ranking for this index in the Algolia dashboard.
706
+ */
707
+ enableReRanking?: boolean;
708
+ };
709
+
710
+ type RequestBody = {
711
+ params?: Params;
712
+ };
713
+
714
+ type SearchForFacetValuesParams = {
715
+ /**
716
+ * Search query.
717
+ */
718
+ query?: string;
719
+ /**
720
+ * Maximum number of facet values to return when [searching for facet values](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#search-for-facet-values).
721
+ */
722
+ maxFacetHits?: number;
723
+ searchQuery?: Params;
724
+ };
725
+
726
+ type SearchForFacetValuesRequest = {
727
+ params?: SearchForFacetValuesParams;
728
+ };
729
+
730
+ /**
731
+ * Properties for the `search` method.
732
+ */
733
+ type SearchProps = {
734
+ /**
735
+ * Unique Composition ObjectID.
736
+ */
737
+ compositionID: string;
738
+ requestBody: RequestBody;
739
+ };
740
+ /**
741
+ * Properties for the `searchForFacetValues` method.
742
+ */
743
+ type SearchForFacetValuesProps = {
744
+ /**
745
+ * Unique Composition ObjectID.
746
+ */
747
+ compositionID: string;
748
+ /**
749
+ * Facet attribute in which to search for values. This attribute must be included in the `attributesForFaceting` index setting with the `searchable()` modifier.
750
+ */
751
+ facetName: string;
752
+ searchForFacetValuesRequest?: SearchForFacetValuesRequest;
753
+ };
754
+
755
+ declare const apiClientVersion = "0.0.1-beta.10";
756
+ declare function createCompositionClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, ...options }: CreateClientOptions): {
757
+ transporter: _algolia_client_common.Transporter;
758
+ /**
759
+ * The `appId` currently in use.
760
+ */
761
+ appId: string;
762
+ /**
763
+ * The `apiKey` currently in use.
764
+ */
765
+ apiKey: string;
766
+ /**
767
+ * Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
768
+ */
769
+ clearCache(): Promise<void>;
770
+ /**
771
+ * Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
772
+ */
773
+ readonly _ua: string;
774
+ /**
775
+ * Adds a `segment` to the `x-algolia-agent` sent with every requests.
776
+ *
777
+ * @param segment - The algolia agent (user-agent) segment to add.
778
+ * @param version - The version of the agent.
779
+ */
780
+ addAlgoliaAgent(segment: string, version?: string): void;
781
+ /**
782
+ * Helper method to switch the API key used to authenticate the requests.
783
+ *
784
+ * @param params - Method params.
785
+ * @param params.apiKey - The new API Key to use.
786
+ */
787
+ setClientApiKey({ apiKey }: {
788
+ apiKey: string;
789
+ }): void;
790
+ /**
791
+ * Runs a query on a single composition and returns matching results.
792
+ *
793
+ * Required API Key ACLs:
794
+ * - search
795
+ * @param search - The search object.
796
+ * @param search.compositionID - Unique Composition ObjectID.
797
+ * @param search.requestBody - The requestBody object.
798
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
799
+ */
800
+ search<T>({ compositionID, requestBody }: SearchProps, requestOptions?: RequestOptions): Promise<SearchResponse<T>>;
801
+ /**
802
+ * Searches for values of a specified facet attribute on the composition\'s main source\'s index. - By default, facet values are sorted by decreasing count. You can adjust this with the `sortFacetValueBy` parameter. - Searching for facet values doesn\'t work if you have **more than 65 searchable facets and searchable attributes combined**.
803
+ *
804
+ * Required API Key ACLs:
805
+ * - search
806
+ * @param searchForFacetValues - The searchForFacetValues object.
807
+ * @param searchForFacetValues.compositionID - Unique Composition ObjectID.
808
+ * @param searchForFacetValues.facetName - Facet attribute in which to search for values. This attribute must be included in the `attributesForFaceting` index setting with the `searchable()` modifier.
809
+ * @param searchForFacetValues.searchForFacetValuesRequest - The searchForFacetValuesRequest object.
810
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
811
+ */
812
+ searchForFacetValues({ compositionID, facetName, searchForFacetValuesRequest }: SearchForFacetValuesProps, requestOptions?: RequestOptions): Promise<SearchForFacetValuesResponse>;
813
+ };
814
+
815
+ /**
816
+ * Error.
817
+ */
818
+ type ErrorBase = Record<string, any> & {
819
+ message?: string;
820
+ };
821
+
822
+ type CompositionClient = ReturnType<typeof createCompositionClient>;
823
+
824
+ declare function compositionClient(appId: string, apiKey: string, options?: ClientOptions): CompositionClient;
825
+
826
+ export { type AroundPrecision, type AroundRadius, type AroundRadiusAll, type Banner, type BannerImage, type BannerImageUrl, type BannerLink, type BaseSearchResponse, type CompositionBaseSearchResponse, type CompositionClient, type CompositionIdRankingInfo, type CompositionRankingInfo, type CompositionRunAppliedRules, type CompositionRunSearchResponse, type CompositionsSearchResponse, type ErrorBase, type Exhaustive, type FacetFilters, type FacetHits, type FacetOrdering, type FacetStats, type Facets, type HighlightResult, type HighlightResultOption, type Hit, type HitRankingInfo, type InsideBoundingBox, type MatchLevel, type MatchedGeoLocation, type NumericFilters, type OptionalFilters, type Params, type Personalization, type Range, type RankingInfo, type Redirect, type RedirectRuleIndexData, type RedirectRuleIndexMetadata, type RedirectURL, type RenderingContent, type RequestBody, type ResultsCompositionInfoResponse, type ResultsCompositionsResponse, type ResultsInjectedItemAppliedRulesInfoResponse, type ResultsInjectedItemInfoResponse, type SearchForFacetValuesParams, type SearchForFacetValuesProps, type SearchForFacetValuesRequest, type SearchForFacetValuesResponse, type SearchForFacetValuesResults, type SearchHits, type SearchPagination, type SearchProps, type SearchResponse, type SearchResults, type SearchResultsItem, type SnippetResult, type SnippetResultOption, type SortRemainingBy, type SupportedLanguage, type Value, type Widgets, apiClientVersion, compositionClient };