@algolia/composition 1.3.0 → 1.4.0
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.
- package/README.md +4 -4
- package/dist/browser.d.ts +116 -116
- package/dist/builds/browser.js +1 -1
- package/dist/builds/browser.js.map +1 -1
- package/dist/builds/browser.min.js +1 -1
- package/dist/builds/browser.min.js.map +1 -1
- package/dist/builds/browser.umd.js +1 -1
- package/dist/builds/fetch.js +1 -1
- package/dist/builds/fetch.js.map +1 -1
- package/dist/builds/node.cjs +1 -1
- package/dist/builds/node.cjs.map +1 -1
- package/dist/builds/node.js +1 -1
- package/dist/builds/node.js.map +1 -1
- package/dist/builds/worker.js +1 -1
- package/dist/builds/worker.js.map +1 -1
- package/dist/fetch.d.ts +116 -116
- package/dist/node.d.cts +116 -116
- package/dist/node.d.ts +116 -116
- package/dist/src/compositionClient.cjs +1 -1
- package/dist/src/compositionClient.cjs.map +1 -1
- package/dist/src/compositionClient.js +1 -1
- package/dist/src/compositionClient.js.map +1 -1
- package/dist/worker.d.ts +116 -116
- package/package.json +7 -7
package/dist/fetch.d.ts
CHANGED
|
@@ -29,14 +29,14 @@ type SearchForFacetValuesResults = {
|
|
|
29
29
|
/**
|
|
30
30
|
* Time the server took to process the request, in milliseconds.
|
|
31
31
|
*/
|
|
32
|
-
processingTimeMS?: number;
|
|
32
|
+
processingTimeMS?: number | undefined;
|
|
33
33
|
};
|
|
34
34
|
|
|
35
35
|
type SearchForFacetValuesResponse = {
|
|
36
36
|
/**
|
|
37
37
|
* Search for facet values results.
|
|
38
38
|
*/
|
|
39
|
-
results?: Array<SearchForFacetValuesResults
|
|
39
|
+
results?: Array<SearchForFacetValuesResults> | undefined;
|
|
40
40
|
};
|
|
41
41
|
|
|
42
42
|
type CompositionRunAppliedRules = {
|
|
@@ -51,7 +51,7 @@ type CompositionRunSearchResponse = Record<string, any> & {
|
|
|
51
51
|
* Unique record identifier.
|
|
52
52
|
*/
|
|
53
53
|
objectID: string;
|
|
54
|
-
appliedRules?: Array<CompositionRunAppliedRules
|
|
54
|
+
appliedRules?: Array<CompositionRunAppliedRules> | undefined;
|
|
55
55
|
};
|
|
56
56
|
|
|
57
57
|
type CompositionsSearchResponse = Record<string, any> & {
|
|
@@ -59,7 +59,7 @@ type CompositionsSearchResponse = Record<string, any> & {
|
|
|
59
59
|
};
|
|
60
60
|
|
|
61
61
|
type CompositionBaseSearchResponse = Record<string, any> & {
|
|
62
|
-
compositions?: CompositionsSearchResponse;
|
|
62
|
+
compositions?: CompositionsSearchResponse | undefined;
|
|
63
63
|
};
|
|
64
64
|
|
|
65
65
|
/**
|
|
@@ -69,42 +69,42 @@ type Exhaustive = {
|
|
|
69
69
|
/**
|
|
70
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
71
|
*/
|
|
72
|
-
facetsCount?: boolean;
|
|
72
|
+
facetsCount?: boolean | undefined;
|
|
73
73
|
/**
|
|
74
74
|
* The value is `false` if not all facet values are retrieved.
|
|
75
75
|
*/
|
|
76
|
-
facetValues?: boolean;
|
|
76
|
+
facetValues?: boolean | undefined;
|
|
77
77
|
/**
|
|
78
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
79
|
*/
|
|
80
|
-
nbHits?: boolean;
|
|
80
|
+
nbHits?: boolean | undefined;
|
|
81
81
|
/**
|
|
82
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
83
|
*/
|
|
84
|
-
rulesMatch?: boolean;
|
|
84
|
+
rulesMatch?: boolean | undefined;
|
|
85
85
|
/**
|
|
86
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
87
|
*/
|
|
88
|
-
typo?: boolean;
|
|
88
|
+
typo?: boolean | undefined;
|
|
89
89
|
};
|
|
90
90
|
|
|
91
91
|
type FacetStats = {
|
|
92
92
|
/**
|
|
93
93
|
* Minimum value in the results.
|
|
94
94
|
*/
|
|
95
|
-
min?: number;
|
|
95
|
+
min?: number | undefined;
|
|
96
96
|
/**
|
|
97
97
|
* Maximum value in the results.
|
|
98
98
|
*/
|
|
99
|
-
max?: number;
|
|
99
|
+
max?: number | undefined;
|
|
100
100
|
/**
|
|
101
101
|
* Average facet value in the results.
|
|
102
102
|
*/
|
|
103
|
-
avg?: number;
|
|
103
|
+
avg?: number | undefined;
|
|
104
104
|
/**
|
|
105
105
|
* Sum of all values in the results.
|
|
106
106
|
*/
|
|
107
|
-
sum?: number;
|
|
107
|
+
sum?: number | undefined;
|
|
108
108
|
};
|
|
109
109
|
|
|
110
110
|
/**
|
|
@@ -138,7 +138,7 @@ type RedirectRuleIndexMetadata = {
|
|
|
138
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
139
|
*/
|
|
140
140
|
type Redirect = {
|
|
141
|
-
index?: Array<RedirectRuleIndexMetadata
|
|
141
|
+
index?: Array<RedirectRuleIndexMetadata> | undefined;
|
|
142
142
|
};
|
|
143
143
|
|
|
144
144
|
/**
|
|
@@ -148,7 +148,7 @@ type Facets = {
|
|
|
148
148
|
/**
|
|
149
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
150
|
*/
|
|
151
|
-
order?: Array<string
|
|
151
|
+
order?: Array<string> | undefined;
|
|
152
152
|
};
|
|
153
153
|
|
|
154
154
|
/**
|
|
@@ -160,62 +160,62 @@ type Value = {
|
|
|
160
160
|
/**
|
|
161
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
162
|
*/
|
|
163
|
-
order?: Array<string
|
|
164
|
-
sortRemainingBy?: SortRemainingBy;
|
|
163
|
+
order?: Array<string> | undefined;
|
|
164
|
+
sortRemainingBy?: SortRemainingBy | undefined;
|
|
165
165
|
/**
|
|
166
166
|
* Hide facet values.
|
|
167
167
|
*/
|
|
168
|
-
hide?: Array<string
|
|
168
|
+
hide?: Array<string> | undefined;
|
|
169
169
|
};
|
|
170
170
|
|
|
171
171
|
/**
|
|
172
172
|
* Order of facet names and facet values in your UI.
|
|
173
173
|
*/
|
|
174
174
|
type FacetOrdering = {
|
|
175
|
-
facets?: Facets;
|
|
175
|
+
facets?: Facets | undefined;
|
|
176
176
|
/**
|
|
177
177
|
* Order of facet values. One object for each facet.
|
|
178
178
|
*/
|
|
179
179
|
values?: {
|
|
180
180
|
[key: string]: Value;
|
|
181
|
-
};
|
|
181
|
+
} | undefined;
|
|
182
182
|
};
|
|
183
183
|
|
|
184
184
|
/**
|
|
185
185
|
* The redirect rule container.
|
|
186
186
|
*/
|
|
187
187
|
type RedirectURL = {
|
|
188
|
-
url?: string;
|
|
188
|
+
url?: string | undefined;
|
|
189
189
|
};
|
|
190
190
|
|
|
191
191
|
/**
|
|
192
192
|
* URL for an image to show inside a banner.
|
|
193
193
|
*/
|
|
194
194
|
type BannerImageUrl = {
|
|
195
|
-
url?: string;
|
|
195
|
+
url?: string | undefined;
|
|
196
196
|
};
|
|
197
197
|
|
|
198
198
|
/**
|
|
199
199
|
* Image to show inside a banner.
|
|
200
200
|
*/
|
|
201
201
|
type BannerImage = {
|
|
202
|
-
urls?: Array<BannerImageUrl
|
|
203
|
-
title?: string;
|
|
202
|
+
urls?: Array<BannerImageUrl> | undefined;
|
|
203
|
+
title?: string | undefined;
|
|
204
204
|
};
|
|
205
205
|
|
|
206
206
|
/**
|
|
207
207
|
* Link for a banner defined in the Merchandising Studio.
|
|
208
208
|
*/
|
|
209
209
|
type BannerLink = {
|
|
210
|
-
url?: string;
|
|
210
|
+
url?: string | undefined;
|
|
211
211
|
};
|
|
212
212
|
|
|
213
213
|
/**
|
|
214
214
|
* Banner with image and link to redirect users.
|
|
215
215
|
*/
|
|
216
216
|
type Banner = {
|
|
217
|
-
image?: BannerImage;
|
|
218
|
-
link?: BannerLink;
|
|
217
|
+
image?: BannerImage | undefined;
|
|
218
|
+
link?: BannerLink | undefined;
|
|
219
219
|
};
|
|
220
220
|
|
|
221
221
|
/**
|
|
@@ -225,52 +225,52 @@ type Widgets = {
|
|
|
225
225
|
/**
|
|
226
226
|
* Banners defined in the Merchandising Studio for a given search.
|
|
227
227
|
*/
|
|
228
|
-
banners?: Array<Banner
|
|
228
|
+
banners?: Array<Banner> | undefined;
|
|
229
229
|
};
|
|
230
230
|
|
|
231
231
|
/**
|
|
232
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
233
|
*/
|
|
234
234
|
type RenderingContent = {
|
|
235
|
-
facetOrdering?: FacetOrdering;
|
|
236
|
-
redirect?: RedirectURL;
|
|
237
|
-
widgets?: Widgets;
|
|
235
|
+
facetOrdering?: FacetOrdering | undefined;
|
|
236
|
+
redirect?: RedirectURL | undefined;
|
|
237
|
+
widgets?: Widgets | undefined;
|
|
238
238
|
};
|
|
239
239
|
|
|
240
240
|
type BaseSearchResponse = Record<string, any> & {
|
|
241
241
|
/**
|
|
242
242
|
* A/B test ID. This is only included in the response for indices that are part of an A/B test.
|
|
243
243
|
*/
|
|
244
|
-
abTestID?: number;
|
|
244
|
+
abTestID?: number | undefined;
|
|
245
245
|
/**
|
|
246
246
|
* Variant ID. This is only included in the response for indices that are part of an A/B test.
|
|
247
247
|
*/
|
|
248
|
-
abTestVariantID?: number;
|
|
248
|
+
abTestVariantID?: number | undefined;
|
|
249
249
|
/**
|
|
250
250
|
* Computed geographical location.
|
|
251
251
|
*/
|
|
252
|
-
aroundLatLng?: string;
|
|
252
|
+
aroundLatLng?: string | undefined;
|
|
253
253
|
/**
|
|
254
254
|
* Distance from a central coordinate provided by `aroundLatLng`.
|
|
255
255
|
*/
|
|
256
|
-
automaticRadius?: string;
|
|
257
|
-
exhaustive?: Exhaustive;
|
|
256
|
+
automaticRadius?: string | undefined;
|
|
257
|
+
exhaustive?: Exhaustive | undefined;
|
|
258
258
|
/**
|
|
259
259
|
* Rules applied to the query.
|
|
260
260
|
*/
|
|
261
|
-
appliedRules?: Array<Record<string, unknown
|
|
261
|
+
appliedRules?: Array<Record<string, unknown>> | undefined;
|
|
262
262
|
/**
|
|
263
263
|
* See the `facetsCount` field of the `exhaustive` object in the response.
|
|
264
264
|
*/
|
|
265
|
-
exhaustiveFacetsCount?: boolean;
|
|
265
|
+
exhaustiveFacetsCount?: boolean | undefined;
|
|
266
266
|
/**
|
|
267
267
|
* See the `nbHits` field of the `exhaustive` object in the response.
|
|
268
268
|
*/
|
|
269
|
-
exhaustiveNbHits?: boolean;
|
|
269
|
+
exhaustiveNbHits?: boolean | undefined;
|
|
270
270
|
/**
|
|
271
271
|
* See the `typo` field of the `exhaustive` object in the response.
|
|
272
272
|
*/
|
|
273
|
-
exhaustiveTypo?: boolean;
|
|
273
|
+
exhaustiveTypo?: boolean | undefined;
|
|
274
274
|
/**
|
|
275
275
|
* Facet counts.
|
|
276
276
|
*/
|
|
@@ -278,67 +278,67 @@ type BaseSearchResponse = Record<string, any> & {
|
|
|
278
278
|
[key: string]: {
|
|
279
279
|
[key: string]: number;
|
|
280
280
|
};
|
|
281
|
-
};
|
|
281
|
+
} | undefined;
|
|
282
282
|
/**
|
|
283
283
|
* Statistics for numerical facets.
|
|
284
284
|
*/
|
|
285
285
|
facets_stats?: {
|
|
286
286
|
[key: string]: FacetStats;
|
|
287
|
-
};
|
|
287
|
+
} | undefined;
|
|
288
288
|
/**
|
|
289
289
|
* Index name used for the query.
|
|
290
290
|
*/
|
|
291
|
-
index?: string;
|
|
291
|
+
index?: string | undefined;
|
|
292
292
|
/**
|
|
293
293
|
* Index name used for the query. During A/B testing, the targeted index isn\'t always the index used by the query.
|
|
294
294
|
*/
|
|
295
|
-
indexUsed?: string;
|
|
295
|
+
indexUsed?: string | undefined;
|
|
296
296
|
/**
|
|
297
297
|
* Warnings about the query.
|
|
298
298
|
*/
|
|
299
|
-
message?: string;
|
|
299
|
+
message?: string | undefined;
|
|
300
300
|
/**
|
|
301
301
|
* Number of hits selected and sorted by the relevant sort algorithm.
|
|
302
302
|
*/
|
|
303
|
-
nbSortedHits?: number;
|
|
303
|
+
nbSortedHits?: number | undefined;
|
|
304
304
|
/**
|
|
305
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
306
|
*/
|
|
307
|
-
parsedQuery?: string;
|
|
307
|
+
parsedQuery?: string | undefined;
|
|
308
308
|
/**
|
|
309
309
|
* Time the server took to process the request, in milliseconds.
|
|
310
310
|
*/
|
|
311
|
-
processingTimeMS
|
|
311
|
+
processingTimeMS?: number | undefined;
|
|
312
312
|
/**
|
|
313
313
|
* Experimental. List of processing steps and their times, in milliseconds. You can use this list to investigate performance issues.
|
|
314
314
|
*/
|
|
315
|
-
processingTimingsMS?: Record<string, unknown
|
|
315
|
+
processingTimingsMS?: Record<string, unknown> | undefined;
|
|
316
316
|
/**
|
|
317
317
|
* Markup text indicating which parts of the original query have been removed to retrieve a non-empty result set.
|
|
318
318
|
*/
|
|
319
|
-
queryAfterRemoval?: string;
|
|
320
|
-
redirect?: Redirect;
|
|
321
|
-
renderingContent?: RenderingContent;
|
|
319
|
+
queryAfterRemoval?: string | undefined;
|
|
320
|
+
redirect?: Redirect | undefined;
|
|
321
|
+
renderingContent?: RenderingContent | undefined;
|
|
322
322
|
/**
|
|
323
323
|
* Time the server took to process the request, in milliseconds.
|
|
324
324
|
*/
|
|
325
|
-
serverTimeMS?: number;
|
|
325
|
+
serverTimeMS?: number | undefined;
|
|
326
326
|
/**
|
|
327
327
|
* Host name of the server that processed the request.
|
|
328
328
|
*/
|
|
329
|
-
serverUsed?: string;
|
|
329
|
+
serverUsed?: string | undefined;
|
|
330
330
|
/**
|
|
331
331
|
* An object with custom data. You can store up to 32kB as custom data.
|
|
332
332
|
*/
|
|
333
|
-
userData?: any | null;
|
|
333
|
+
userData?: any | null | undefined;
|
|
334
334
|
/**
|
|
335
335
|
* Unique identifier for the query. This is used for [click analytics](https://www.algolia.com/doc/guides/analytics/click-analytics/).
|
|
336
336
|
*/
|
|
337
|
-
queryID?: string;
|
|
337
|
+
queryID?: string | undefined;
|
|
338
338
|
/**
|
|
339
339
|
* Whether automatic events collection is enabled for the application.
|
|
340
340
|
*/
|
|
341
|
-
_automaticInsights?: boolean;
|
|
341
|
+
_automaticInsights?: boolean | undefined;
|
|
342
342
|
};
|
|
343
343
|
|
|
344
344
|
type ResultsInjectedItemAppliedRulesInfoResponse = {
|
|
@@ -350,7 +350,7 @@ type ResultsInjectedItemAppliedRulesInfoResponse = {
|
|
|
350
350
|
|
|
351
351
|
type ResultsInjectedItemInfoResponse = Record<string, any> & {
|
|
352
352
|
key: string;
|
|
353
|
-
appliedRules?: Array<ResultsInjectedItemAppliedRulesInfoResponse
|
|
353
|
+
appliedRules?: Array<ResultsInjectedItemAppliedRulesInfoResponse> | undefined;
|
|
354
354
|
};
|
|
355
355
|
|
|
356
356
|
type ResultsCompositionInfoResponse = {
|
|
@@ -384,7 +384,7 @@ type HighlightResultOption = {
|
|
|
384
384
|
/**
|
|
385
385
|
* Whether the entire attribute value is highlighted.
|
|
386
386
|
*/
|
|
387
|
-
fullyHighlighted?: boolean;
|
|
387
|
+
fullyHighlighted?: boolean | undefined;
|
|
388
388
|
};
|
|
389
389
|
|
|
390
390
|
type HighlightResult = HighlightResultOption | {
|
|
@@ -399,37 +399,37 @@ type CompositionIdRankingInfo = {
|
|
|
399
399
|
type CompositionRankingInfo = {
|
|
400
400
|
composed?: {
|
|
401
401
|
[key: string]: CompositionIdRankingInfo;
|
|
402
|
-
};
|
|
402
|
+
} | undefined;
|
|
403
403
|
};
|
|
404
404
|
|
|
405
405
|
type MatchedGeoLocation = {
|
|
406
406
|
/**
|
|
407
407
|
* Latitude of the matched location.
|
|
408
408
|
*/
|
|
409
|
-
lat?: number;
|
|
409
|
+
lat?: number | undefined;
|
|
410
410
|
/**
|
|
411
411
|
* Longitude of the matched location.
|
|
412
412
|
*/
|
|
413
|
-
lng?: number;
|
|
413
|
+
lng?: number | undefined;
|
|
414
414
|
/**
|
|
415
415
|
* Distance between the matched location and the search location (in meters).
|
|
416
416
|
*/
|
|
417
|
-
distance?: number;
|
|
417
|
+
distance?: number | undefined;
|
|
418
418
|
};
|
|
419
419
|
|
|
420
420
|
type Personalization = {
|
|
421
421
|
/**
|
|
422
422
|
* The score of the filters.
|
|
423
423
|
*/
|
|
424
|
-
filtersScore?: number;
|
|
424
|
+
filtersScore?: number | undefined;
|
|
425
425
|
/**
|
|
426
426
|
* The score of the ranking.
|
|
427
427
|
*/
|
|
428
|
-
rankingScore?: number;
|
|
428
|
+
rankingScore?: number | undefined;
|
|
429
429
|
/**
|
|
430
430
|
* The score of the event.
|
|
431
431
|
*/
|
|
432
|
-
score?: number;
|
|
432
|
+
score?: number | undefined;
|
|
433
433
|
};
|
|
434
434
|
|
|
435
435
|
/**
|
|
@@ -439,7 +439,7 @@ type RankingInfo = {
|
|
|
439
439
|
/**
|
|
440
440
|
* Whether a filter matched the query.
|
|
441
441
|
*/
|
|
442
|
-
filters?: number;
|
|
442
|
+
filters?: number | undefined;
|
|
443
443
|
/**
|
|
444
444
|
* Position of the first matched word in the best matching attribute of the record.
|
|
445
445
|
*/
|
|
@@ -451,9 +451,9 @@ type RankingInfo = {
|
|
|
451
451
|
/**
|
|
452
452
|
* Precision used when computing the geo distance, in meters.
|
|
453
453
|
*/
|
|
454
|
-
geoPrecision?: number;
|
|
455
|
-
matchedGeoLocation?: MatchedGeoLocation;
|
|
456
|
-
personalization?: Personalization;
|
|
454
|
+
geoPrecision?: number | undefined;
|
|
455
|
+
matchedGeoLocation?: MatchedGeoLocation | undefined;
|
|
456
|
+
personalization?: Personalization | undefined;
|
|
457
457
|
/**
|
|
458
458
|
* Number of exactly matched words.
|
|
459
459
|
*/
|
|
@@ -465,11 +465,11 @@ type RankingInfo = {
|
|
|
465
465
|
/**
|
|
466
466
|
* Whether the record was promoted by a rule.
|
|
467
467
|
*/
|
|
468
|
-
promoted?: boolean;
|
|
468
|
+
promoted?: boolean | undefined;
|
|
469
469
|
/**
|
|
470
470
|
* Number of words between multiple matches in the query plus 1. For single word queries, `proximityDistance` is 0.
|
|
471
471
|
*/
|
|
472
|
-
proximityDistance?: number;
|
|
472
|
+
proximityDistance?: number | undefined;
|
|
473
473
|
/**
|
|
474
474
|
* Overall ranking of the record, expressed as a single integer. This attribute is internal.
|
|
475
475
|
*/
|
|
@@ -477,11 +477,11 @@ type RankingInfo = {
|
|
|
477
477
|
/**
|
|
478
478
|
* Number of matched words.
|
|
479
479
|
*/
|
|
480
|
-
words?: number;
|
|
480
|
+
words?: number | undefined;
|
|
481
481
|
/**
|
|
482
482
|
* Whether the record is re-ranked.
|
|
483
483
|
*/
|
|
484
|
-
promotedByReRanking?: boolean;
|
|
484
|
+
promotedByReRanking?: boolean | undefined;
|
|
485
485
|
};
|
|
486
486
|
|
|
487
487
|
type HitRankingInfo = RankingInfo & CompositionRankingInfo;
|
|
@@ -514,15 +514,15 @@ type Hit<T = Record<string, unknown>> = T & {
|
|
|
514
514
|
*/
|
|
515
515
|
_highlightResult?: {
|
|
516
516
|
[key: string]: HighlightResult;
|
|
517
|
-
};
|
|
517
|
+
} | undefined;
|
|
518
518
|
/**
|
|
519
519
|
* Snippets that show the context around a matching search query.
|
|
520
520
|
*/
|
|
521
521
|
_snippetResult?: {
|
|
522
522
|
[key: string]: SnippetResult;
|
|
523
|
-
};
|
|
524
|
-
_rankingInfo?: HitRankingInfo;
|
|
525
|
-
_distinctSeqID?: number;
|
|
523
|
+
} | undefined;
|
|
524
|
+
_rankingInfo?: HitRankingInfo | undefined;
|
|
525
|
+
_distinctSeqID?: number | undefined;
|
|
526
526
|
};
|
|
527
527
|
|
|
528
528
|
type SearchHits<T = Record<string, unknown>> = Record<string, any> & {
|
|
@@ -577,11 +577,11 @@ type Range = {
|
|
|
577
577
|
/**
|
|
578
578
|
* Lower boundary of a range in meters. The Geo ranking criterion considers all records within the range to be equal.
|
|
579
579
|
*/
|
|
580
|
-
from?: number;
|
|
580
|
+
from?: number | undefined;
|
|
581
581
|
/**
|
|
582
582
|
* Upper boundary of a range in meters. The Geo ranking criterion considers all records within the range to be equal.
|
|
583
583
|
*/
|
|
584
|
-
value?: number;
|
|
584
|
+
value?: number | undefined;
|
|
585
585
|
};
|
|
586
586
|
|
|
587
587
|
/**
|
|
@@ -625,106 +625,106 @@ type Params = {
|
|
|
625
625
|
/**
|
|
626
626
|
* Search query.
|
|
627
627
|
*/
|
|
628
|
-
query?: string;
|
|
628
|
+
query?: string | undefined;
|
|
629
629
|
/**
|
|
630
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
631
|
*/
|
|
632
|
-
filters?: string;
|
|
632
|
+
filters?: string | undefined;
|
|
633
633
|
/**
|
|
634
634
|
* Page of search results to retrieve.
|
|
635
635
|
*/
|
|
636
|
-
page?: number;
|
|
636
|
+
page?: number | undefined;
|
|
637
637
|
/**
|
|
638
638
|
* Whether the search response should include detailed ranking information.
|
|
639
639
|
*/
|
|
640
|
-
getRankingInfo?: boolean;
|
|
641
|
-
relevancyStrictness?: number;
|
|
642
|
-
facetFilters?: FacetFilters;
|
|
643
|
-
optionalFilters?: OptionalFilters;
|
|
644
|
-
numericFilters?: NumericFilters;
|
|
640
|
+
getRankingInfo?: boolean | undefined;
|
|
641
|
+
relevancyStrictness?: number | undefined;
|
|
642
|
+
facetFilters?: FacetFilters | undefined;
|
|
643
|
+
optionalFilters?: OptionalFilters | undefined;
|
|
644
|
+
numericFilters?: NumericFilters | undefined;
|
|
645
645
|
/**
|
|
646
646
|
* Number of hits per page.
|
|
647
647
|
*/
|
|
648
|
-
hitsPerPage?: number;
|
|
648
|
+
hitsPerPage?: number | undefined;
|
|
649
649
|
/**
|
|
650
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
651
|
*/
|
|
652
|
-
aroundLatLng?: string;
|
|
652
|
+
aroundLatLng?: string | undefined;
|
|
653
653
|
/**
|
|
654
654
|
* Whether to obtain the coordinates from the request\'s IP address.
|
|
655
655
|
*/
|
|
656
|
-
aroundLatLngViaIP?: boolean;
|
|
657
|
-
aroundRadius?: AroundRadius;
|
|
658
|
-
aroundPrecision?: AroundPrecision;
|
|
656
|
+
aroundLatLngViaIP?: boolean | undefined;
|
|
657
|
+
aroundRadius?: AroundRadius | undefined;
|
|
658
|
+
aroundPrecision?: AroundPrecision | undefined;
|
|
659
659
|
/**
|
|
660
660
|
* Minimum radius (in meters) for a search around a location when `aroundRadius` isn\'t set.
|
|
661
661
|
*/
|
|
662
|
-
minimumAroundRadius?: number;
|
|
663
|
-
insideBoundingBox?: InsideBoundingBox | null;
|
|
662
|
+
minimumAroundRadius?: number | undefined;
|
|
663
|
+
insideBoundingBox?: InsideBoundingBox | null | undefined;
|
|
664
664
|
/**
|
|
665
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
666
|
*/
|
|
667
|
-
insidePolygon?: Array<Array<number
|
|
667
|
+
insidePolygon?: Array<Array<number>> | undefined;
|
|
668
668
|
/**
|
|
669
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
670
|
*/
|
|
671
|
-
queryLanguages?: Array<SupportedLanguage
|
|
671
|
+
queryLanguages?: Array<SupportedLanguage> | undefined;
|
|
672
672
|
/**
|
|
673
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
674
|
*/
|
|
675
|
-
naturalLanguages?: Array<SupportedLanguage
|
|
675
|
+
naturalLanguages?: Array<SupportedLanguage> | undefined;
|
|
676
676
|
/**
|
|
677
677
|
* Whether to enable rules.
|
|
678
678
|
*/
|
|
679
|
-
enableRules?: boolean;
|
|
679
|
+
enableRules?: boolean | undefined;
|
|
680
680
|
/**
|
|
681
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
682
|
*/
|
|
683
|
-
ruleContexts?: Array<string
|
|
683
|
+
ruleContexts?: Array<string> | undefined;
|
|
684
684
|
/**
|
|
685
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
686
|
*/
|
|
687
|
-
userToken?: string;
|
|
687
|
+
userToken?: string | undefined;
|
|
688
688
|
/**
|
|
689
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
690
|
*/
|
|
691
|
-
clickAnalytics?: boolean;
|
|
691
|
+
clickAnalytics?: boolean | undefined;
|
|
692
692
|
/**
|
|
693
693
|
* Whether this search will be included in Analytics.
|
|
694
694
|
*/
|
|
695
|
-
analytics?: boolean;
|
|
695
|
+
analytics?: boolean | undefined;
|
|
696
696
|
/**
|
|
697
697
|
* Tags to apply to the query for [segmenting analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).
|
|
698
698
|
*/
|
|
699
|
-
analyticsTags?: Array<string
|
|
699
|
+
analyticsTags?: Array<string> | undefined;
|
|
700
700
|
/**
|
|
701
701
|
* Whether to enable A/B testing for this search.
|
|
702
702
|
*/
|
|
703
|
-
enableABTest?: boolean;
|
|
703
|
+
enableABTest?: boolean | undefined;
|
|
704
704
|
/**
|
|
705
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
706
|
*/
|
|
707
|
-
enableReRanking?: boolean;
|
|
707
|
+
enableReRanking?: boolean | undefined;
|
|
708
708
|
};
|
|
709
709
|
|
|
710
710
|
type RequestBody = {
|
|
711
|
-
params?: Params;
|
|
711
|
+
params?: Params | undefined;
|
|
712
712
|
};
|
|
713
713
|
|
|
714
714
|
type SearchForFacetValuesParams = {
|
|
715
715
|
/**
|
|
716
716
|
* Search query.
|
|
717
717
|
*/
|
|
718
|
-
query?: string;
|
|
718
|
+
query?: string | undefined;
|
|
719
719
|
/**
|
|
720
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
721
|
*/
|
|
722
|
-
maxFacetHits?: number;
|
|
723
|
-
searchQuery?: Params;
|
|
722
|
+
maxFacetHits?: number | undefined;
|
|
723
|
+
searchQuery?: Params | undefined;
|
|
724
724
|
};
|
|
725
725
|
|
|
726
726
|
type SearchForFacetValuesRequest = {
|
|
727
|
-
params?: SearchForFacetValuesParams;
|
|
727
|
+
params?: SearchForFacetValuesParams | undefined;
|
|
728
728
|
};
|
|
729
729
|
|
|
730
730
|
/**
|
|
@@ -749,10 +749,10 @@ type SearchForFacetValuesProps = {
|
|
|
749
749
|
* Facet attribute in which to search for values. This attribute must be included in the `attributesForFaceting` index setting with the `searchable()` modifier.
|
|
750
750
|
*/
|
|
751
751
|
facetName: string;
|
|
752
|
-
searchForFacetValuesRequest?: SearchForFacetValuesRequest;
|
|
752
|
+
searchForFacetValuesRequest?: SearchForFacetValuesRequest | undefined;
|
|
753
753
|
};
|
|
754
754
|
|
|
755
|
-
declare const apiClientVersion = "1.
|
|
755
|
+
declare const apiClientVersion = "1.4.0";
|
|
756
756
|
declare function createCompositionClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, ...options }: CreateClientOptions): {
|
|
757
757
|
transporter: _algolia_client_common.Transporter;
|
|
758
758
|
/**
|
|
@@ -777,7 +777,7 @@ declare function createCompositionClient({ appId: appIdOption, apiKey: apiKeyOpt
|
|
|
777
777
|
* @param segment - The algolia agent (user-agent) segment to add.
|
|
778
778
|
* @param version - The version of the agent.
|
|
779
779
|
*/
|
|
780
|
-
addAlgoliaAgent(segment: string, version?: string): void;
|
|
780
|
+
addAlgoliaAgent(segment: string, version?: string | undefined): void;
|
|
781
781
|
/**
|
|
782
782
|
* Helper method to switch the API key used to authenticate the requests.
|
|
783
783
|
*
|
|
@@ -816,11 +816,11 @@ declare function createCompositionClient({ appId: appIdOption, apiKey: apiKeyOpt
|
|
|
816
816
|
* Error.
|
|
817
817
|
*/
|
|
818
818
|
type ErrorBase = Record<string, any> & {
|
|
819
|
-
message?: string;
|
|
819
|
+
message?: string | undefined;
|
|
820
820
|
};
|
|
821
821
|
|
|
822
822
|
type CompositionClient = ReturnType<typeof createCompositionClient>;
|
|
823
823
|
|
|
824
|
-
declare function compositionClient(appId: string, apiKey: string, options?: ClientOptions): CompositionClient;
|
|
824
|
+
declare function compositionClient(appId: string, apiKey: string, options?: ClientOptions | undefined): CompositionClient;
|
|
825
825
|
|
|
826
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 };
|