@graphcommerce/algolia-recommend 9.0.0-canary.84
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/CHANGELOG.md +7 -0
- package/Config.graphqls +44 -0
- package/README.md +10 -0
- package/algolia-recommend-spec.yaml +2720 -0
- package/mesh/createProductMapper.ts +19 -0
- package/mesh/createValueFacetMapper.ts +13 -0
- package/mesh/getRecommendationArgs.ts +49 -0
- package/mesh/getRecommendations.ts +81 -0
- package/mesh/resolvers.ts +239 -0
- package/package.json +29 -0
- package/plugins/meshConfigAlgoliaRecommend.ts +63 -0
- package/schema/AlgoliaProductRecommendations.graphqls +137 -0
- package/schema/AlgoliaTrending.graphqls +74 -0
- package/scripts/generate-recommend-spec.mts +131 -0
- package/tsconfig.json +5 -0
|
@@ -0,0 +1,2720 @@
|
|
|
1
|
+
openapi: 3.0.2
|
|
2
|
+
info:
|
|
3
|
+
title: Recommend API
|
|
4
|
+
description: >
|
|
5
|
+
The Recommend API lets you retrieve recommendations from one of Algolia's AI recommendation models that you previously trained on your data.
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
## Client libraries
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
Use Algolia's API clients and libraries to reliably integrate Algolia's APIs with your apps.
|
|
12
|
+
|
|
13
|
+
The official API clients are covered by Algolia's [Service Level Agreement](https://www.algolia.com/policies/sla/).
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
See: [Algolia's ecosystem](https://www.algolia.com/doc/guides/getting-started/how-algolia-works/in-depth/ecosystem/)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
## Base URLs
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
The base URLs for requests to the Recommend API are:
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
- `https://{APPLICATION_ID}.algolia.net`
|
|
26
|
+
|
|
27
|
+
- `https://{APPLICATION_ID}-dsn.algolia.net`.
|
|
28
|
+
If your subscription includes a [Distributed Search Network](https://dashboard.algolia.com/infra),
|
|
29
|
+
this ensures that requests are sent to servers closest to users.
|
|
30
|
+
|
|
31
|
+
Both URLs provide high availability by distributing requests with load balancing.
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
**All requests must use HTTPS.**
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
## Retry strategy
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
To guarantee a high availability, implement a retry strategy for all API requests using the URLs of your servers as fallbacks:
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
- `https://{APPLICATION_ID}-1.algolianet.com`
|
|
44
|
+
|
|
45
|
+
- `https://{APPLICATION_ID}-2.algolianet.com`
|
|
46
|
+
|
|
47
|
+
- `https://{APPLICATION_ID}-3.algolianet.com`
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
These URLs use a different DNS provider than the primary URLs.
|
|
51
|
+
|
|
52
|
+
You should randomize this list to ensure an even load across the three servers.
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
All Algolia API clients implement this retry strategy.
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
## Authentication
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
To authenticate your API requests, add these headers:
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
- `x-algolia-application-id`. Your Algolia application ID.
|
|
65
|
+
|
|
66
|
+
- `x-algolia-api-key`. An API key with the necessary permissions to make the request.
|
|
67
|
+
The required access control list (ACL) to make a request is listed in each endpoint's reference.
|
|
68
|
+
|
|
69
|
+
You can find your application ID and API key in the [Algolia dashboard](https://dashboard.algolia.com/account).
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
## Request format
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
Request bodies must be JSON objects.
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
## Response status and errors
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
The Recommend API returns JSON responses.
|
|
82
|
+
|
|
83
|
+
Since JSON doesn't guarantee any specific ordering, don't rely on the order of attributes in the API response.
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
Successful responses return a `2xx` status. Client errors return a `4xx` status. Server errors are indicated by a `5xx` status.
|
|
87
|
+
|
|
88
|
+
Error responses have a `message` property with more information.
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
## Version
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
The current version of the Recommend API is version 1, as indicated by the `/1/` in each endpoint's URL.
|
|
95
|
+
|
|
96
|
+
version: 1.0.0
|
|
97
|
+
paths:
|
|
98
|
+
/1/indexes/*/recommendations:
|
|
99
|
+
post:
|
|
100
|
+
tags:
|
|
101
|
+
- recommend
|
|
102
|
+
operationId: getRecommendations
|
|
103
|
+
x-use-read-transporter: true
|
|
104
|
+
x-cacheable: true
|
|
105
|
+
x-acl:
|
|
106
|
+
- search
|
|
107
|
+
x-legacy-signature-recommend: true
|
|
108
|
+
summary: Retrieve recommendations
|
|
109
|
+
description: |
|
|
110
|
+
Retrieves recommendations from selected AI models.
|
|
111
|
+
requestBody:
|
|
112
|
+
required: true
|
|
113
|
+
content:
|
|
114
|
+
application/json:
|
|
115
|
+
schema:
|
|
116
|
+
title: getRecommendationsParams
|
|
117
|
+
description: Recommend request body.
|
|
118
|
+
type: object
|
|
119
|
+
additionalProperties: false
|
|
120
|
+
properties:
|
|
121
|
+
requests:
|
|
122
|
+
type: array
|
|
123
|
+
description: >-
|
|
124
|
+
Recommendation request with parameters depending on the requested model.
|
|
125
|
+
|
|
126
|
+
items:
|
|
127
|
+
$ref: '#/components/schemas/recommendationsRequest'
|
|
128
|
+
required:
|
|
129
|
+
- requests
|
|
130
|
+
responses:
|
|
131
|
+
'200':
|
|
132
|
+
description: OK
|
|
133
|
+
content:
|
|
134
|
+
application/json:
|
|
135
|
+
schema:
|
|
136
|
+
title: getRecommendationsResponse
|
|
137
|
+
type: object
|
|
138
|
+
additionalProperties: false
|
|
139
|
+
properties:
|
|
140
|
+
results:
|
|
141
|
+
type: array
|
|
142
|
+
items:
|
|
143
|
+
$ref: '#/components/schemas/recommendationsResults'
|
|
144
|
+
required:
|
|
145
|
+
- results
|
|
146
|
+
'400':
|
|
147
|
+
$ref: '#/components/responses/BadRequest'
|
|
148
|
+
'402':
|
|
149
|
+
$ref: '#/components/responses/FeatureNotEnabled'
|
|
150
|
+
'403':
|
|
151
|
+
$ref: '#/components/responses/MethodNotAllowed'
|
|
152
|
+
'404':
|
|
153
|
+
$ref: '#/components/responses/IndexNotFound'
|
|
154
|
+
components:
|
|
155
|
+
securitySchemes:
|
|
156
|
+
appId:
|
|
157
|
+
type: apiKey
|
|
158
|
+
in: header
|
|
159
|
+
name: x-algolia-application-id
|
|
160
|
+
description: Your Algolia application ID.
|
|
161
|
+
apiKey:
|
|
162
|
+
type: apiKey
|
|
163
|
+
in: header
|
|
164
|
+
name: x-algolia-api-key
|
|
165
|
+
description: >
|
|
166
|
+
Your Algolia API key with the necessary permissions to make the request.
|
|
167
|
+
|
|
168
|
+
Permissions are controlled through access control lists (ACL) and access restrictions.
|
|
169
|
+
|
|
170
|
+
The required ACL to make a request is listed in each endpoint's reference.
|
|
171
|
+
|
|
172
|
+
parameters:
|
|
173
|
+
PathInPath:
|
|
174
|
+
name: path
|
|
175
|
+
in: path
|
|
176
|
+
description: Path of the endpoint, anything after "/1" must be specified.
|
|
177
|
+
required: true
|
|
178
|
+
schema:
|
|
179
|
+
type: string
|
|
180
|
+
example: /keys
|
|
181
|
+
Parameters:
|
|
182
|
+
name: parameters
|
|
183
|
+
in: query
|
|
184
|
+
description: Query parameters to apply to the current query.
|
|
185
|
+
schema:
|
|
186
|
+
type: object
|
|
187
|
+
additionalProperties: true
|
|
188
|
+
IndexName:
|
|
189
|
+
name: indexName
|
|
190
|
+
in: path
|
|
191
|
+
description: Name of the index on which to perform the operation.
|
|
192
|
+
required: true
|
|
193
|
+
schema:
|
|
194
|
+
type: string
|
|
195
|
+
example: YourIndexName
|
|
196
|
+
Models:
|
|
197
|
+
in: path
|
|
198
|
+
name: model
|
|
199
|
+
required: true
|
|
200
|
+
description: >
|
|
201
|
+
[Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
|
|
202
|
+
|
|
203
|
+
schema:
|
|
204
|
+
$ref: '#/components/schemas/recommendModels'
|
|
205
|
+
ObjectID:
|
|
206
|
+
name: objectID
|
|
207
|
+
in: path
|
|
208
|
+
description: Unique record identifier.
|
|
209
|
+
required: true
|
|
210
|
+
schema:
|
|
211
|
+
$ref: '#/components/schemas/objectID'
|
|
212
|
+
schemas:
|
|
213
|
+
ErrorBase:
|
|
214
|
+
description: Error.
|
|
215
|
+
type: object
|
|
216
|
+
x-keep-model: true
|
|
217
|
+
additionalProperties: true
|
|
218
|
+
properties:
|
|
219
|
+
message:
|
|
220
|
+
type: string
|
|
221
|
+
example: Invalid Application-Id or API-Key
|
|
222
|
+
indexName:
|
|
223
|
+
type: string
|
|
224
|
+
example: products
|
|
225
|
+
description: Index name (case-sensitive).
|
|
226
|
+
query:
|
|
227
|
+
type: string
|
|
228
|
+
description: Search query.
|
|
229
|
+
x-categories:
|
|
230
|
+
- Search
|
|
231
|
+
searchParamsQuery:
|
|
232
|
+
type: object
|
|
233
|
+
additionalProperties: false
|
|
234
|
+
properties:
|
|
235
|
+
query:
|
|
236
|
+
$ref: '#/components/schemas/query'
|
|
237
|
+
filters:
|
|
238
|
+
type: string
|
|
239
|
+
description: >
|
|
240
|
+
Filter expression to only include items that match the filter criteria in the response.
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
You can use these filter expressions:
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
- **Numeric filters.** `<facet> <op> <number>`, where `<op>` is one of `<`, `<=`, `=`, `!=`, `>`, `>=`.
|
|
247
|
+
|
|
248
|
+
- **Ranges.** `<facet>:<lower> TO <upper>` where `<lower>` and `<upper>` are the lower and upper limits of the range (inclusive).
|
|
249
|
+
|
|
250
|
+
- **Facet filters.** `<facet>:<value>` where `<facet>` is a facet attribute (case-sensitive) and `<value>` a facet value.
|
|
251
|
+
|
|
252
|
+
- **Tag filters.** `_tags:<value>` or just `<value>` (case-sensitive).
|
|
253
|
+
|
|
254
|
+
- **Boolean filters.** `<facet>: true | false`.
|
|
255
|
+
|
|
256
|
+
|
|
257
|
+
You can combine filters with `AND`, `OR`, and `NOT` operators with the following restrictions:
|
|
258
|
+
|
|
259
|
+
|
|
260
|
+
- You can only combine filters of the same type with `OR`.
|
|
261
|
+
**Not supported:** `facet:value OR num > 3`.
|
|
262
|
+
- You can't use `NOT` with combinations of filters.
|
|
263
|
+
**Not supported:** `NOT(facet:value OR facet:value)`
|
|
264
|
+
- You can't combine conjunctions (`AND`) with `OR`.
|
|
265
|
+
**Not supported:** `facet:value OR (facet:value AND facet:value)`
|
|
266
|
+
|
|
267
|
+
Use quotes around your filters, if the facet attribute name or facet value has spaces, keywords (`OR`, `AND`, `NOT`), or quotes.
|
|
268
|
+
|
|
269
|
+
If a facet attribute is an array, the filter matches if it matches at least one element of the array.
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+
For more information, see [Filters](https://www.algolia.com/doc/guides/managing-results/refine-results/filtering/).
|
|
273
|
+
|
|
274
|
+
example: (category:Book OR category:Ebook) AND _tags:published
|
|
275
|
+
x-categories:
|
|
276
|
+
- Filtering
|
|
277
|
+
facetFilters:
|
|
278
|
+
description: >
|
|
279
|
+
Filter the search by facet values, so that only records with the same facet values are retrieved.
|
|
280
|
+
|
|
281
|
+
|
|
282
|
+
**Prefer using the `filters` parameter, which supports all filter types and combinations with boolean operators.**
|
|
283
|
+
|
|
284
|
+
|
|
285
|
+
- `[filter1, filter2]` is interpreted as `filter1 AND filter2`.
|
|
286
|
+
|
|
287
|
+
- `[[filter1, filter2], filter3]` is interpreted as `filter1 OR filter2 AND filter3`.
|
|
288
|
+
|
|
289
|
+
- `facet:-value` is interpreted as `NOT facet:value`.
|
|
290
|
+
|
|
291
|
+
|
|
292
|
+
While it's best to avoid attributes that start with a `-`, you can still filter them by escaping with a backslash:
|
|
293
|
+
|
|
294
|
+
`facet:\-value`.
|
|
295
|
+
|
|
296
|
+
x-categories:
|
|
297
|
+
- Filtering
|
|
298
|
+
type: object
|
|
299
|
+
optionalFilters:
|
|
300
|
+
description: >
|
|
301
|
+
Filters to promote or demote records in the search results.
|
|
302
|
+
|
|
303
|
+
|
|
304
|
+
Optional filters work like facet filters, but they don't exclude records from the search results.
|
|
305
|
+
|
|
306
|
+
Records that match the optional filter rank before records that don't match.
|
|
307
|
+
|
|
308
|
+
If you're using a negative filter `facet:-value`, matching records rank after records that don't match.
|
|
309
|
+
|
|
310
|
+
|
|
311
|
+
- Optional filters don't work on virtual replicas.
|
|
312
|
+
|
|
313
|
+
- Optional filters are applied _after_ sort-by attributes.
|
|
314
|
+
|
|
315
|
+
- Optional filters don't work with numeric attributes.
|
|
316
|
+
|
|
317
|
+
example:
|
|
318
|
+
- category:Book
|
|
319
|
+
- author:John Doe
|
|
320
|
+
oneOf:
|
|
321
|
+
- type: array
|
|
322
|
+
items:
|
|
323
|
+
$ref: '#/components/schemas/optionalFilters'
|
|
324
|
+
- type: string
|
|
325
|
+
x-categories:
|
|
326
|
+
- Filtering
|
|
327
|
+
numericFilters:
|
|
328
|
+
description: >
|
|
329
|
+
Filter by numeric facets.
|
|
330
|
+
|
|
331
|
+
|
|
332
|
+
**Prefer using the `filters` parameter, which supports all filter types and combinations with boolean operators.**
|
|
333
|
+
|
|
334
|
+
|
|
335
|
+
You can use numeric comparison operators: `<`, `<=`, `=`, `!=`, `>`, `>=`. Comparsions are precise up to 3 decimals.
|
|
336
|
+
|
|
337
|
+
You can also provide ranges: `facet:<lower> TO <upper>`. The range includes the lower and upper boundaries.
|
|
338
|
+
|
|
339
|
+
The same combination rules apply as for `facetFilters`.
|
|
340
|
+
|
|
341
|
+
example:
|
|
342
|
+
- - inStock = 1
|
|
343
|
+
- deliveryDate < 1441755506
|
|
344
|
+
- price < 1000
|
|
345
|
+
oneOf:
|
|
346
|
+
- type: array
|
|
347
|
+
items:
|
|
348
|
+
$ref: '#/components/schemas/numericFilters'
|
|
349
|
+
- type: string
|
|
350
|
+
x-categories:
|
|
351
|
+
- Filtering
|
|
352
|
+
tagFilters:
|
|
353
|
+
description: >
|
|
354
|
+
Filter the search by values of the special `_tags` attribute.
|
|
355
|
+
|
|
356
|
+
|
|
357
|
+
**Prefer using the `filters` parameter, which supports all filter types and combinations with boolean operators.**
|
|
358
|
+
|
|
359
|
+
|
|
360
|
+
Different from regular facets, `_tags` can only be used for filtering (including or excluding records).
|
|
361
|
+
|
|
362
|
+
You won't get a facet count.
|
|
363
|
+
|
|
364
|
+
The same combination and escaping rules apply as for `facetFilters`.
|
|
365
|
+
|
|
366
|
+
example:
|
|
367
|
+
- - Book
|
|
368
|
+
- Movie
|
|
369
|
+
- SciFi
|
|
370
|
+
oneOf:
|
|
371
|
+
- type: array
|
|
372
|
+
items:
|
|
373
|
+
$ref: '#/components/schemas/tagFilters'
|
|
374
|
+
- type: string
|
|
375
|
+
x-categories:
|
|
376
|
+
- Filtering
|
|
377
|
+
page:
|
|
378
|
+
type: integer
|
|
379
|
+
description: Page of search results to retrieve.
|
|
380
|
+
minimum: 0
|
|
381
|
+
x-categories:
|
|
382
|
+
- Pagination
|
|
383
|
+
aroundLatLng:
|
|
384
|
+
type: string
|
|
385
|
+
description: >
|
|
386
|
+
Coordinates for the center of a circle, expressed as a comma-separated string of latitude and longitude.
|
|
387
|
+
|
|
388
|
+
|
|
389
|
+
Only records included within circle around this central location are included in the results.
|
|
390
|
+
|
|
391
|
+
The radius of the circle is determined by the `aroundRadius` and `minimumAroundRadius` settings.
|
|
392
|
+
|
|
393
|
+
This parameter is ignored if you also specify `insidePolygon` or `insideBoundingBox`.
|
|
394
|
+
|
|
395
|
+
example: 40.71,-74.01
|
|
396
|
+
x-categories:
|
|
397
|
+
- Geo-Search
|
|
398
|
+
aroundLatLngViaIP:
|
|
399
|
+
type: boolean
|
|
400
|
+
description: Whether to obtain the coordinates from the request's IP address.
|
|
401
|
+
x-categories:
|
|
402
|
+
- Geo-Search
|
|
403
|
+
aroundRadiusAll:
|
|
404
|
+
title: all
|
|
405
|
+
type: string
|
|
406
|
+
description: >-
|
|
407
|
+
Return all records with a valid `_geoloc` attribute. Don't filter by distance.
|
|
408
|
+
|
|
409
|
+
enum:
|
|
410
|
+
- all
|
|
411
|
+
aroundRadius:
|
|
412
|
+
description: >
|
|
413
|
+
Maximum radius for a search around a central location.
|
|
414
|
+
|
|
415
|
+
|
|
416
|
+
This parameter works in combination with the `aroundLatLng` and `aroundLatLngViaIP` parameters.
|
|
417
|
+
|
|
418
|
+
By default, the search radius is determined automatically from the density of hits around the central location.
|
|
419
|
+
|
|
420
|
+
The search radius is small if there are many hits close to the central coordinates.
|
|
421
|
+
|
|
422
|
+
oneOf:
|
|
423
|
+
- type: integer
|
|
424
|
+
minimum: 1
|
|
425
|
+
description: Maximum search radius around a central location in meters.
|
|
426
|
+
- $ref: '#/components/schemas/aroundRadiusAll'
|
|
427
|
+
x-categories:
|
|
428
|
+
- Geo-Search
|
|
429
|
+
aroundPrecisionFromValue:
|
|
430
|
+
title: range objects
|
|
431
|
+
type: array
|
|
432
|
+
items:
|
|
433
|
+
title: range
|
|
434
|
+
type: object
|
|
435
|
+
description: >-
|
|
436
|
+
Range object with lower and upper values in meters to define custom ranges.
|
|
437
|
+
|
|
438
|
+
properties:
|
|
439
|
+
from:
|
|
440
|
+
type: integer
|
|
441
|
+
description: >-
|
|
442
|
+
Lower boundary of a range in meters. The Geo ranking criterion considers all records within the range to be equal.
|
|
443
|
+
|
|
444
|
+
example: 20
|
|
445
|
+
value:
|
|
446
|
+
type: integer
|
|
447
|
+
description: >-
|
|
448
|
+
Upper boundary of a range in meters. The Geo ranking criterion considers all records within the range to be equal.
|
|
449
|
+
|
|
450
|
+
aroundPrecision:
|
|
451
|
+
description: >
|
|
452
|
+
Precision of a coordinate-based search in meters to group results with similar distances.
|
|
453
|
+
|
|
454
|
+
|
|
455
|
+
The Geo ranking criterion considers all matches within the same range of distances to be equal.
|
|
456
|
+
|
|
457
|
+
oneOf:
|
|
458
|
+
- type: integer
|
|
459
|
+
default: 10
|
|
460
|
+
description: >
|
|
461
|
+
Distance in meters to group results by similar distances.
|
|
462
|
+
|
|
463
|
+
|
|
464
|
+
For example, if you set `aroundPrecision` to 100, records wihin 100 meters to the central coordinate are considered to have the same distance,
|
|
465
|
+
|
|
466
|
+
as are records between 100 and 199 meters.
|
|
467
|
+
|
|
468
|
+
- $ref: '#/components/schemas/aroundPrecisionFromValue'
|
|
469
|
+
x-categories:
|
|
470
|
+
- Geo-Search
|
|
471
|
+
insideBoundingBox:
|
|
472
|
+
type: array
|
|
473
|
+
items:
|
|
474
|
+
type: array
|
|
475
|
+
minItems: 4
|
|
476
|
+
maxItems: 4
|
|
477
|
+
items:
|
|
478
|
+
type: number
|
|
479
|
+
format: double
|
|
480
|
+
description: >
|
|
481
|
+
Coordinates for a rectangular area in which to search.
|
|
482
|
+
|
|
483
|
+
|
|
484
|
+
Each bounding box is defined by the two opposite points of its diagonal, and expressed as latitude and longitude pair:
|
|
485
|
+
|
|
486
|
+
`[p1 lat, p1 long, p2 lat, p2 long]`.
|
|
487
|
+
|
|
488
|
+
Provide multiple bounding boxes as nested arrays.
|
|
489
|
+
|
|
490
|
+
For more information, see [rectangular area](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filtering-inside-rectangular-or-polygonal-areas).
|
|
491
|
+
|
|
492
|
+
example:
|
|
493
|
+
- - 47.3165
|
|
494
|
+
- 4.9665
|
|
495
|
+
- 47.3424
|
|
496
|
+
- 5.0201
|
|
497
|
+
- - 40.9234
|
|
498
|
+
- 2.1185
|
|
499
|
+
- 38.643
|
|
500
|
+
- 1.9916
|
|
501
|
+
x-categories:
|
|
502
|
+
- Geo-Search
|
|
503
|
+
insidePolygon:
|
|
504
|
+
type: array
|
|
505
|
+
items:
|
|
506
|
+
type: array
|
|
507
|
+
minItems: 6
|
|
508
|
+
maxItems: 20000
|
|
509
|
+
items:
|
|
510
|
+
type: number
|
|
511
|
+
format: double
|
|
512
|
+
description: >
|
|
513
|
+
Coordinates of a polygon in which to search.
|
|
514
|
+
|
|
515
|
+
|
|
516
|
+
Polygons are defined by 3 to 10,000 points. Each point is represented by its latitude and longitude.
|
|
517
|
+
|
|
518
|
+
Provide multiple polygons as nested arrays.
|
|
519
|
+
|
|
520
|
+
For more information, see [filtering inside polygons](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filtering-inside-rectangular-or-polygonal-areas).
|
|
521
|
+
|
|
522
|
+
This parameter is ignored if you also specify `insideBoundingBox`.
|
|
523
|
+
|
|
524
|
+
example:
|
|
525
|
+
- - 47.3165
|
|
526
|
+
- 4.9665
|
|
527
|
+
- 47.3424
|
|
528
|
+
- 5.0201
|
|
529
|
+
- 47.32
|
|
530
|
+
- 4.9
|
|
531
|
+
- - 40.9234
|
|
532
|
+
- 2.1185
|
|
533
|
+
- 38.643
|
|
534
|
+
- 1.9916
|
|
535
|
+
- 39.2587
|
|
536
|
+
- 2.0104
|
|
537
|
+
x-categories:
|
|
538
|
+
- Geo-Search
|
|
539
|
+
supportedLanguage:
|
|
540
|
+
type: string
|
|
541
|
+
description: ISO code for a supported language.
|
|
542
|
+
enum:
|
|
543
|
+
- af
|
|
544
|
+
- ar
|
|
545
|
+
- az
|
|
546
|
+
- bg
|
|
547
|
+
- bn
|
|
548
|
+
- ca
|
|
549
|
+
- cs
|
|
550
|
+
- cy
|
|
551
|
+
- da
|
|
552
|
+
- de
|
|
553
|
+
- el
|
|
554
|
+
- en
|
|
555
|
+
- eo
|
|
556
|
+
- es
|
|
557
|
+
- et
|
|
558
|
+
- eu
|
|
559
|
+
- fa
|
|
560
|
+
- fi
|
|
561
|
+
- fo
|
|
562
|
+
- fr
|
|
563
|
+
- ga
|
|
564
|
+
- gl
|
|
565
|
+
- he
|
|
566
|
+
- hi
|
|
567
|
+
- hu
|
|
568
|
+
- hy
|
|
569
|
+
- id
|
|
570
|
+
- is
|
|
571
|
+
- it
|
|
572
|
+
- ja
|
|
573
|
+
- ka
|
|
574
|
+
- kk
|
|
575
|
+
- ko
|
|
576
|
+
- ku
|
|
577
|
+
- ky
|
|
578
|
+
- lt
|
|
579
|
+
- lv
|
|
580
|
+
- mi
|
|
581
|
+
- mn
|
|
582
|
+
- mr
|
|
583
|
+
- ms
|
|
584
|
+
- mt
|
|
585
|
+
- nb
|
|
586
|
+
- nl
|
|
587
|
+
- 'no'
|
|
588
|
+
- ns
|
|
589
|
+
- pl
|
|
590
|
+
- ps
|
|
591
|
+
- pt
|
|
592
|
+
- pt-br
|
|
593
|
+
- qu
|
|
594
|
+
- ro
|
|
595
|
+
- ru
|
|
596
|
+
- sk
|
|
597
|
+
- sq
|
|
598
|
+
- sv
|
|
599
|
+
- sw
|
|
600
|
+
- ta
|
|
601
|
+
- te
|
|
602
|
+
- th
|
|
603
|
+
- tl
|
|
604
|
+
- tn
|
|
605
|
+
- tr
|
|
606
|
+
- tt
|
|
607
|
+
- uk
|
|
608
|
+
- ur
|
|
609
|
+
- uz
|
|
610
|
+
- zh
|
|
611
|
+
userToken:
|
|
612
|
+
type: string
|
|
613
|
+
description: >
|
|
614
|
+
Unique pseudonymous or anonymous user identifier.
|
|
615
|
+
|
|
616
|
+
|
|
617
|
+
This helps with analytics and click and conversion events.
|
|
618
|
+
|
|
619
|
+
For more information, see [user token](https://www.algolia.com/doc/guides/sending-events/concepts/usertoken/).
|
|
620
|
+
|
|
621
|
+
example: test-user-123
|
|
622
|
+
x-categories:
|
|
623
|
+
- Personalization
|
|
624
|
+
baseSearchParamsWithoutQuery:
|
|
625
|
+
type: object
|
|
626
|
+
additionalProperties: false
|
|
627
|
+
properties:
|
|
628
|
+
similarQuery:
|
|
629
|
+
type: string
|
|
630
|
+
description: >
|
|
631
|
+
Keywords to be used instead of the search query to conduct a more broader search.
|
|
632
|
+
|
|
633
|
+
|
|
634
|
+
Using the `similarQuery` parameter changes other settings:
|
|
635
|
+
|
|
636
|
+
|
|
637
|
+
- `queryType` is set to `prefixNone`.
|
|
638
|
+
|
|
639
|
+
- `removeStopWords` is set to true.
|
|
640
|
+
|
|
641
|
+
- `words` is set as the first ranking criterion.
|
|
642
|
+
|
|
643
|
+
- All remaining words are treated as `optionalWords`.
|
|
644
|
+
|
|
645
|
+
|
|
646
|
+
Since the `similarQuery` is supposed to do a broad search, they usually return many results.
|
|
647
|
+
|
|
648
|
+
Combine it with `filters` to narrow down the list of results.
|
|
649
|
+
|
|
650
|
+
example: comedy drama crime Macy Buscemi
|
|
651
|
+
x-categories:
|
|
652
|
+
- Search
|
|
653
|
+
filters:
|
|
654
|
+
$ref: '#/components/schemas/filters'
|
|
655
|
+
facetFilters:
|
|
656
|
+
$ref: '#/components/schemas/facetFilters'
|
|
657
|
+
optionalFilters:
|
|
658
|
+
$ref: '#/components/schemas/optionalFilters'
|
|
659
|
+
numericFilters:
|
|
660
|
+
$ref: '#/components/schemas/numericFilters'
|
|
661
|
+
tagFilters:
|
|
662
|
+
$ref: '#/components/schemas/tagFilters'
|
|
663
|
+
sumOrFiltersScores:
|
|
664
|
+
type: boolean
|
|
665
|
+
description: >
|
|
666
|
+
Whether to sum all filter scores.
|
|
667
|
+
|
|
668
|
+
|
|
669
|
+
If true, all filter scores are summed.
|
|
670
|
+
|
|
671
|
+
Otherwise, the maximum filter score is kept.
|
|
672
|
+
|
|
673
|
+
For more information, see [filter scores](https://www.algolia.com/doc/guides/managing-results/refine-results/filtering/in-depth/filter-scoring/#accumulating-scores-with-sumorfiltersscores).
|
|
674
|
+
|
|
675
|
+
x-categories:
|
|
676
|
+
- Filtering
|
|
677
|
+
restrictSearchableAttributes:
|
|
678
|
+
type: array
|
|
679
|
+
items:
|
|
680
|
+
type: string
|
|
681
|
+
example:
|
|
682
|
+
- title
|
|
683
|
+
- author
|
|
684
|
+
description: |
|
|
685
|
+
Restricts a search to a subset of your searchable attributes.
|
|
686
|
+
Attribute names are case-sensitive.
|
|
687
|
+
x-categories:
|
|
688
|
+
- Filtering
|
|
689
|
+
facets:
|
|
690
|
+
type: array
|
|
691
|
+
items:
|
|
692
|
+
type: string
|
|
693
|
+
description: >
|
|
694
|
+
Facets for which to retrieve facet values that match the search criteria and the number of matching facet values.
|
|
695
|
+
|
|
696
|
+
|
|
697
|
+
To retrieve all facets, use the wildcard character `*`.
|
|
698
|
+
|
|
699
|
+
For more information, see [facets](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#contextual-facet-values-and-counts).
|
|
700
|
+
|
|
701
|
+
default: []
|
|
702
|
+
x-categories:
|
|
703
|
+
- Faceting
|
|
704
|
+
facetingAfterDistinct:
|
|
705
|
+
type: boolean
|
|
706
|
+
description: >
|
|
707
|
+
Whether faceting should be applied after deduplication with `distinct`.
|
|
708
|
+
|
|
709
|
+
|
|
710
|
+
This leads to accurate facet counts when using faceting in combination with `distinct`.
|
|
711
|
+
|
|
712
|
+
It's usually better to use `afterDistinct` modifiers in the `attributesForFaceting` setting,
|
|
713
|
+
|
|
714
|
+
as `facetingAfterDistinct` only computes correct facet counts if all records have the same facet values for the `attributeForDistinct`.
|
|
715
|
+
|
|
716
|
+
x-categories:
|
|
717
|
+
- Faceting
|
|
718
|
+
page:
|
|
719
|
+
$ref: '#/components/schemas/page'
|
|
720
|
+
offset:
|
|
721
|
+
type: integer
|
|
722
|
+
description: Position of the first hit to retrieve.
|
|
723
|
+
x-categories:
|
|
724
|
+
- Pagination
|
|
725
|
+
length:
|
|
726
|
+
type: integer
|
|
727
|
+
description: Number of hits to retrieve (used in combination with `offset`).
|
|
728
|
+
minimum: 0
|
|
729
|
+
maximum: 1000
|
|
730
|
+
x-categories:
|
|
731
|
+
- Pagination
|
|
732
|
+
aroundLatLng:
|
|
733
|
+
$ref: '#/components/schemas/aroundLatLng'
|
|
734
|
+
aroundLatLngViaIP:
|
|
735
|
+
$ref: '#/components/schemas/aroundLatLngViaIP'
|
|
736
|
+
aroundRadius:
|
|
737
|
+
$ref: '#/components/schemas/aroundRadius'
|
|
738
|
+
aroundPrecision:
|
|
739
|
+
$ref: '#/components/schemas/aroundPrecision'
|
|
740
|
+
minimumAroundRadius:
|
|
741
|
+
type: integer
|
|
742
|
+
description: >-
|
|
743
|
+
Minimum radius (in meters) for a search around a location when `aroundRadius` isn't set.
|
|
744
|
+
|
|
745
|
+
minimum: 1
|
|
746
|
+
x-categories:
|
|
747
|
+
- Geo-Search
|
|
748
|
+
insideBoundingBox:
|
|
749
|
+
$ref: '#/components/schemas/insideBoundingBox'
|
|
750
|
+
insidePolygon:
|
|
751
|
+
$ref: '#/components/schemas/insidePolygon'
|
|
752
|
+
naturalLanguages:
|
|
753
|
+
type: array
|
|
754
|
+
items:
|
|
755
|
+
$ref: '#/components/schemas/supportedLanguage'
|
|
756
|
+
description: >
|
|
757
|
+
ISO language codes that adjust settings that are useful for processing natural language queries (as opposed to keyword searches):
|
|
758
|
+
|
|
759
|
+
|
|
760
|
+
- Sets `removeStopWords` and `ignorePlurals` to the list of provided languages.
|
|
761
|
+
|
|
762
|
+
- Sets `removeWordsIfNoResults` to `allOptional`.
|
|
763
|
+
|
|
764
|
+
- Adds a `natural_language` attribute to `ruleContexts` and `analyticsTags`.
|
|
765
|
+
|
|
766
|
+
x-categories:
|
|
767
|
+
- Languages
|
|
768
|
+
ruleContexts:
|
|
769
|
+
type: array
|
|
770
|
+
items:
|
|
771
|
+
type: string
|
|
772
|
+
description: >
|
|
773
|
+
Assigns a rule context to the search query.
|
|
774
|
+
|
|
775
|
+
|
|
776
|
+
[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.
|
|
777
|
+
|
|
778
|
+
example:
|
|
779
|
+
- mobile
|
|
780
|
+
x-categories:
|
|
781
|
+
- Rules
|
|
782
|
+
personalizationImpact:
|
|
783
|
+
type: integer
|
|
784
|
+
description: >
|
|
785
|
+
Impact that Personalization should have on this search.
|
|
786
|
+
|
|
787
|
+
|
|
788
|
+
The higher this value is, the more Personalization determines the ranking compared to other factors.
|
|
789
|
+
|
|
790
|
+
For more information, see [Understanding Personalization impact](https://www.algolia.com/doc/guides/personalization/personalizing-results/in-depth/configuring-personalization/#understanding-personalization-impact).
|
|
791
|
+
|
|
792
|
+
minimum: 0
|
|
793
|
+
maximum: 100
|
|
794
|
+
x-categories:
|
|
795
|
+
- Personalization
|
|
796
|
+
userToken:
|
|
797
|
+
$ref: '#/components/schemas/userToken'
|
|
798
|
+
getRankingInfo:
|
|
799
|
+
type: boolean
|
|
800
|
+
description: >-
|
|
801
|
+
Whether the search response should include detailed ranking information.
|
|
802
|
+
|
|
803
|
+
x-categories:
|
|
804
|
+
- Advanced
|
|
805
|
+
synonyms:
|
|
806
|
+
type: boolean
|
|
807
|
+
description: Whether to take into account an index's synonyms for this search.
|
|
808
|
+
x-categories:
|
|
809
|
+
- Advanced
|
|
810
|
+
clickAnalytics:
|
|
811
|
+
type: boolean
|
|
812
|
+
description: >
|
|
813
|
+
Whether to include a `queryID` attribute in the response.
|
|
814
|
+
|
|
815
|
+
|
|
816
|
+
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/).
|
|
817
|
+
|
|
818
|
+
x-categories:
|
|
819
|
+
- Analytics
|
|
820
|
+
analytics:
|
|
821
|
+
type: boolean
|
|
822
|
+
description: Whether this search will be included in Analytics.
|
|
823
|
+
x-categories:
|
|
824
|
+
- Analytics
|
|
825
|
+
analyticsTags:
|
|
826
|
+
type: array
|
|
827
|
+
items:
|
|
828
|
+
type: string
|
|
829
|
+
description: >-
|
|
830
|
+
Tags to apply to the query for [segmenting analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).
|
|
831
|
+
|
|
832
|
+
x-categories:
|
|
833
|
+
- Analytics
|
|
834
|
+
percentileComputation:
|
|
835
|
+
type: boolean
|
|
836
|
+
description: >-
|
|
837
|
+
Whether to include this search when calculating processing-time percentiles.
|
|
838
|
+
|
|
839
|
+
x-categories:
|
|
840
|
+
- Advanced
|
|
841
|
+
enableABTest:
|
|
842
|
+
type: boolean
|
|
843
|
+
description: Whether to enable A/B testing for this search.
|
|
844
|
+
x-categories:
|
|
845
|
+
- Advanced
|
|
846
|
+
baseSearchParams:
|
|
847
|
+
allOf:
|
|
848
|
+
- $ref: '#/components/schemas/searchParamsQuery'
|
|
849
|
+
- $ref: '#/components/schemas/baseSearchParamsWithoutQuery'
|
|
850
|
+
hitsPerPage:
|
|
851
|
+
type: integer
|
|
852
|
+
description: Number of hits per page.
|
|
853
|
+
minimum: 1
|
|
854
|
+
maximum: 1000
|
|
855
|
+
x-categories:
|
|
856
|
+
- Pagination
|
|
857
|
+
typoToleranceEnum:
|
|
858
|
+
type: string
|
|
859
|
+
title: typo tolerance
|
|
860
|
+
description: |
|
|
861
|
+
- `min`. Return matches with the lowest number of typos.
|
|
862
|
+
For example, if you have matches without typos, only include those.
|
|
863
|
+
But if there are no matches without typos (with 1 typo), include matches with 1 typo (2 typos).
|
|
864
|
+
- `strict`. Return matches with the two lowest numbers of typos.
|
|
865
|
+
With `strict`, the Typo ranking criterion is applied first in the `ranking` setting.
|
|
866
|
+
enum:
|
|
867
|
+
- min
|
|
868
|
+
- strict
|
|
869
|
+
typoTolerance:
|
|
870
|
+
description: >
|
|
871
|
+
Whether [typo tolerance](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/typo-tolerance/) is enabled and how it is applied.
|
|
872
|
+
|
|
873
|
+
|
|
874
|
+
If typo tolerance is true, `min`, or `strict`, [word splitting and concetenation](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/splitting-and-concatenation/) is also active.
|
|
875
|
+
|
|
876
|
+
oneOf:
|
|
877
|
+
- type: boolean
|
|
878
|
+
default: true
|
|
879
|
+
description: >-
|
|
880
|
+
Whether typo tolerance is active. If true, matches with typos are included in the search results and rank after exact matches.
|
|
881
|
+
|
|
882
|
+
- $ref: '#/components/schemas/typoToleranceEnum'
|
|
883
|
+
x-categories:
|
|
884
|
+
- Typos
|
|
885
|
+
booleanString:
|
|
886
|
+
type: string
|
|
887
|
+
enum:
|
|
888
|
+
- 'true'
|
|
889
|
+
- 'false'
|
|
890
|
+
ignorePlurals:
|
|
891
|
+
description: |
|
|
892
|
+
Treat singular, plurals, and other forms of declensions as equivalent.
|
|
893
|
+
You should only use this feature for the languages used in your index.
|
|
894
|
+
example:
|
|
895
|
+
- ca
|
|
896
|
+
- es
|
|
897
|
+
oneOf:
|
|
898
|
+
- type: array
|
|
899
|
+
description: |
|
|
900
|
+
ISO code for languages for which this feature should be active.
|
|
901
|
+
This overrides languages you set with `queryLanguages`.
|
|
902
|
+
items:
|
|
903
|
+
$ref: '#/components/schemas/supportedLanguage'
|
|
904
|
+
- $ref: '#/components/schemas/booleanString'
|
|
905
|
+
- type: boolean
|
|
906
|
+
description: >
|
|
907
|
+
If true, `ignorePlurals` is active for all languages included in `queryLanguages`, or for all supported languages, if `queryLanguges` is empty.
|
|
908
|
+
|
|
909
|
+
If false, singulars, plurals, and other declensions won't be considered equivalent.
|
|
910
|
+
|
|
911
|
+
default: false
|
|
912
|
+
x-categories:
|
|
913
|
+
- Languages
|
|
914
|
+
removeStopWords:
|
|
915
|
+
description: >
|
|
916
|
+
Removes stop words from the search query.
|
|
917
|
+
|
|
918
|
+
|
|
919
|
+
Stop words are common words like articles, conjunctions, prepositions, or pronouns that have little or no meaning on their own.
|
|
920
|
+
|
|
921
|
+
In English, "the", "a", or "and" are stop words.
|
|
922
|
+
|
|
923
|
+
|
|
924
|
+
You should only use this feature for the languages used in your index.
|
|
925
|
+
|
|
926
|
+
example:
|
|
927
|
+
- ca
|
|
928
|
+
- es
|
|
929
|
+
oneOf:
|
|
930
|
+
- type: array
|
|
931
|
+
description: >-
|
|
932
|
+
ISO code for languages for which stop words should be removed. This overrides languages you set in `queryLanguges`.
|
|
933
|
+
|
|
934
|
+
items:
|
|
935
|
+
$ref: '#/components/schemas/supportedLanguage'
|
|
936
|
+
- type: boolean
|
|
937
|
+
default: false
|
|
938
|
+
description: >
|
|
939
|
+
If true, stop words are removed for all languages you included in `queryLanguages`, or for all supported languages, if `queryLanguages` is empty.
|
|
940
|
+
|
|
941
|
+
If false, stop words are not removed.
|
|
942
|
+
|
|
943
|
+
x-categories:
|
|
944
|
+
- Languages
|
|
945
|
+
queryType:
|
|
946
|
+
type: string
|
|
947
|
+
enum:
|
|
948
|
+
- prefixLast
|
|
949
|
+
- prefixAll
|
|
950
|
+
- prefixNone
|
|
951
|
+
description: >
|
|
952
|
+
Determines if and how query words are interpreted as prefixes.
|
|
953
|
+
|
|
954
|
+
|
|
955
|
+
By default, only the last query word is treated as prefix (`prefixLast`).
|
|
956
|
+
|
|
957
|
+
To turn off prefix search, use `prefixNone`.
|
|
958
|
+
|
|
959
|
+
Avoid `prefixAll`, which treats all query words as prefixes.
|
|
960
|
+
|
|
961
|
+
This might lead to counterintuitive results and makes your search slower.
|
|
962
|
+
|
|
963
|
+
|
|
964
|
+
For more information, see [Prefix searching](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/override-search-engine-defaults/in-depth/prefix-searching/).
|
|
965
|
+
|
|
966
|
+
x-categories:
|
|
967
|
+
- Query strategy
|
|
968
|
+
removeWordsIfNoResults:
|
|
969
|
+
type: string
|
|
970
|
+
enum:
|
|
971
|
+
- none
|
|
972
|
+
- lastWords
|
|
973
|
+
- firstWords
|
|
974
|
+
- allOptional
|
|
975
|
+
example: firstWords
|
|
976
|
+
description: >
|
|
977
|
+
Strategy for removing words from the query when it doesn't return any results.
|
|
978
|
+
|
|
979
|
+
This helps to avoid returning empty search results.
|
|
980
|
+
|
|
981
|
+
|
|
982
|
+
- `none`.
|
|
983
|
+
No words are removed when a query doesn't return results.
|
|
984
|
+
|
|
985
|
+
- `lastWords`.
|
|
986
|
+
Treat the last (then second to last, then third to last) word as optional,
|
|
987
|
+
until there are results or at most 5 words have been removed.
|
|
988
|
+
|
|
989
|
+
- `firstWords`.
|
|
990
|
+
Treat the first (then second, then third) word as optional,
|
|
991
|
+
until there are results or at most 5 words have been removed.
|
|
992
|
+
|
|
993
|
+
- `allOptional`.
|
|
994
|
+
Treat all words as optional.
|
|
995
|
+
|
|
996
|
+
For more information, see [Remove words to improve results](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/empty-or-insufficient-results/in-depth/why-use-remove-words-if-no-results/).
|
|
997
|
+
|
|
998
|
+
x-categories:
|
|
999
|
+
- Query strategy
|
|
1000
|
+
mode:
|
|
1001
|
+
type: string
|
|
1002
|
+
enum:
|
|
1003
|
+
- neuralSearch
|
|
1004
|
+
- keywordSearch
|
|
1005
|
+
description: >
|
|
1006
|
+
Search mode the index will use to query for results.
|
|
1007
|
+
|
|
1008
|
+
|
|
1009
|
+
This setting only applies to indices, for which Algolia enabled NeuralSearch for you.
|
|
1010
|
+
|
|
1011
|
+
x-categories:
|
|
1012
|
+
- Query strategy
|
|
1013
|
+
semanticSearch:
|
|
1014
|
+
type: object
|
|
1015
|
+
description: |
|
|
1016
|
+
Settings for the semantic search part of NeuralSearch.
|
|
1017
|
+
Only used when `mode` is `neuralSearch`.
|
|
1018
|
+
properties:
|
|
1019
|
+
eventSources:
|
|
1020
|
+
oneOf:
|
|
1021
|
+
- type: array
|
|
1022
|
+
description: |
|
|
1023
|
+
Indices from which to collect click and conversion events.
|
|
1024
|
+
|
|
1025
|
+
If null, the current index and all its replicas are used.
|
|
1026
|
+
items:
|
|
1027
|
+
type: string
|
|
1028
|
+
- type: 'null'
|
|
1029
|
+
exactOnSingleWordQuery:
|
|
1030
|
+
type: string
|
|
1031
|
+
enum:
|
|
1032
|
+
- attribute
|
|
1033
|
+
- none
|
|
1034
|
+
- word
|
|
1035
|
+
description: >
|
|
1036
|
+
Determines how the [Exact ranking criterion](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/override-search-engine-defaults/in-depth/adjust-exact-settings/#turn-off-exact-for-some-attributes) is computed when the search query has only one word.
|
|
1037
|
+
|
|
1038
|
+
|
|
1039
|
+
- `attribute`.
|
|
1040
|
+
The Exact ranking criterion is 1 if the query word and attribute value are the same.
|
|
1041
|
+
For example, a search for "road" will match the value "road", but not "road trip".
|
|
1042
|
+
|
|
1043
|
+
- `none`.
|
|
1044
|
+
The Exact ranking criterion is ignored on single-word searches.
|
|
1045
|
+
|
|
1046
|
+
- `word`.
|
|
1047
|
+
The Exact ranking criterion is 1 if the query word is found in the attribute value.
|
|
1048
|
+
The query word must have at least 3 characters and must not be a stop word.
|
|
1049
|
+
Only exact matches will be highlighted,
|
|
1050
|
+
partial and prefix matches won't.
|
|
1051
|
+
|
|
1052
|
+
x-categories:
|
|
1053
|
+
- Query strategy
|
|
1054
|
+
alternativesAsExact:
|
|
1055
|
+
type: string
|
|
1056
|
+
enum:
|
|
1057
|
+
- ignorePlurals
|
|
1058
|
+
- singleWordSynonym
|
|
1059
|
+
- multiWordsSynonym
|
|
1060
|
+
x-categories:
|
|
1061
|
+
- Query strategy
|
|
1062
|
+
advancedSyntaxFeatures:
|
|
1063
|
+
type: string
|
|
1064
|
+
enum:
|
|
1065
|
+
- exactPhrase
|
|
1066
|
+
- excludeWords
|
|
1067
|
+
x-categories:
|
|
1068
|
+
- Query strategy
|
|
1069
|
+
distinct:
|
|
1070
|
+
description: >
|
|
1071
|
+
Determines how many records of a group are included in the search results.
|
|
1072
|
+
|
|
1073
|
+
|
|
1074
|
+
Records with the same value for the `attributeForDistinct` attribute are considered a group.
|
|
1075
|
+
|
|
1076
|
+
The `distinct` setting controls how many members of the group are returned.
|
|
1077
|
+
|
|
1078
|
+
This is useful for [deduplication and grouping](https://www.algolia.com/doc/guides/managing-results/refine-results/grouping/#introducing-algolias-distinct-feature).
|
|
1079
|
+
|
|
1080
|
+
|
|
1081
|
+
The `distinct` setting is ignored if `attributeForDistinct` is not set.
|
|
1082
|
+
|
|
1083
|
+
example: 1
|
|
1084
|
+
oneOf:
|
|
1085
|
+
- type: boolean
|
|
1086
|
+
description: >-
|
|
1087
|
+
Whether deduplication is turned on. If true, only one member of a group is shown in the search results.
|
|
1088
|
+
|
|
1089
|
+
- type: integer
|
|
1090
|
+
description: >
|
|
1091
|
+
Number of members of a group of records to include in the search results.
|
|
1092
|
+
|
|
1093
|
+
|
|
1094
|
+
- Don't use `distinct > 1` for records that might be [promoted by rules](https://www.algolia.com/doc/guides/managing-results/rules/merchandising-and-promoting/how-to/promote-hits/).
|
|
1095
|
+
The number of hits won't be correct and faceting won't work as expected.
|
|
1096
|
+
- With `distinct > 1`, the `hitsPerPage` parameter controls the number of returned groups.
|
|
1097
|
+
For example, with `hitsPerPage: 10` and `distinct: 2`, up to 20 records are returned.
|
|
1098
|
+
Likewise, the `nbHits` response attribute contains the number of returned groups.
|
|
1099
|
+
|
|
1100
|
+
minimum: 0
|
|
1101
|
+
maximum: 4
|
|
1102
|
+
default: 0
|
|
1103
|
+
x-categories:
|
|
1104
|
+
- Advanced
|
|
1105
|
+
maxFacetHits:
|
|
1106
|
+
type: integer
|
|
1107
|
+
description: >-
|
|
1108
|
+
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).
|
|
1109
|
+
|
|
1110
|
+
maximum: 100
|
|
1111
|
+
x-categories:
|
|
1112
|
+
- Advanced
|
|
1113
|
+
order:
|
|
1114
|
+
description: >
|
|
1115
|
+
Explicit order of facets or facet values.
|
|
1116
|
+
|
|
1117
|
+
|
|
1118
|
+
This setting lets you always show specific facets or facet values at the top of the list.
|
|
1119
|
+
|
|
1120
|
+
type: array
|
|
1121
|
+
items:
|
|
1122
|
+
type: string
|
|
1123
|
+
facets:
|
|
1124
|
+
description: Order of facet names.
|
|
1125
|
+
type: object
|
|
1126
|
+
additionalProperties: false
|
|
1127
|
+
properties:
|
|
1128
|
+
order:
|
|
1129
|
+
$ref: '#/components/schemas/order'
|
|
1130
|
+
sortRemainingBy:
|
|
1131
|
+
description: >
|
|
1132
|
+
Order of facet values that aren't explicitly positioned with the `order` setting.
|
|
1133
|
+
|
|
1134
|
+
|
|
1135
|
+
- `count`.
|
|
1136
|
+
Order remaining facet values by decreasing count.
|
|
1137
|
+
The count is the number of matching records containing this facet value.
|
|
1138
|
+
|
|
1139
|
+
- `alpha`.
|
|
1140
|
+
Sort facet values alphabetically.
|
|
1141
|
+
|
|
1142
|
+
- `hidden`.
|
|
1143
|
+
Don't show facet values that aren't explicitly positioned.
|
|
1144
|
+
|
|
1145
|
+
type: string
|
|
1146
|
+
enum:
|
|
1147
|
+
- count
|
|
1148
|
+
- alpha
|
|
1149
|
+
- hidden
|
|
1150
|
+
hide:
|
|
1151
|
+
description: Hide facet values.
|
|
1152
|
+
type: array
|
|
1153
|
+
items:
|
|
1154
|
+
type: string
|
|
1155
|
+
value:
|
|
1156
|
+
type: object
|
|
1157
|
+
additionalProperties: false
|
|
1158
|
+
properties:
|
|
1159
|
+
order:
|
|
1160
|
+
$ref: '#/components/schemas/order'
|
|
1161
|
+
sortRemainingBy:
|
|
1162
|
+
$ref: '#/components/schemas/sortRemainingBy'
|
|
1163
|
+
hide:
|
|
1164
|
+
$ref: '#/components/schemas/hide'
|
|
1165
|
+
values:
|
|
1166
|
+
description: Order of facet values. One object for each facet.
|
|
1167
|
+
type: object
|
|
1168
|
+
additionalProperties:
|
|
1169
|
+
x-additionalPropertiesName: facet
|
|
1170
|
+
$ref: '#/components/schemas/value'
|
|
1171
|
+
facetOrdering:
|
|
1172
|
+
description: Order of facet names and facet values in your UI.
|
|
1173
|
+
type: object
|
|
1174
|
+
additionalProperties: false
|
|
1175
|
+
properties:
|
|
1176
|
+
facets:
|
|
1177
|
+
$ref: '#/components/schemas/facets'
|
|
1178
|
+
values:
|
|
1179
|
+
$ref: '#/components/schemas/values'
|
|
1180
|
+
redirectURL:
|
|
1181
|
+
description: The redirect rule container.
|
|
1182
|
+
type: object
|
|
1183
|
+
additionalProperties: false
|
|
1184
|
+
properties:
|
|
1185
|
+
url:
|
|
1186
|
+
type: string
|
|
1187
|
+
renderingContent:
|
|
1188
|
+
description: >
|
|
1189
|
+
Extra data that can be used in the search UI.
|
|
1190
|
+
|
|
1191
|
+
|
|
1192
|
+
You can use this to control aspects of your search UI, such as, the order of facet names and values
|
|
1193
|
+
|
|
1194
|
+
without changing your frontend code.
|
|
1195
|
+
|
|
1196
|
+
type: object
|
|
1197
|
+
additionalProperties: false
|
|
1198
|
+
properties:
|
|
1199
|
+
facetOrdering:
|
|
1200
|
+
$ref: '#/components/schemas/facetOrdering'
|
|
1201
|
+
redirect:
|
|
1202
|
+
$ref: '#/components/schemas/redirectURL'
|
|
1203
|
+
x-categories:
|
|
1204
|
+
- Advanced
|
|
1205
|
+
reRankingApplyFilter:
|
|
1206
|
+
description: >
|
|
1207
|
+
Restrict [Dynamic Re-Ranking](https://www.algolia.com/doc/guides/algolia-ai/re-ranking/) to records that match these filters.
|
|
1208
|
+
|
|
1209
|
+
oneOf:
|
|
1210
|
+
- type: array
|
|
1211
|
+
items:
|
|
1212
|
+
$ref: '#/components/schemas/reRankingApplyFilter'
|
|
1213
|
+
- type: string
|
|
1214
|
+
x-categories:
|
|
1215
|
+
- Filtering
|
|
1216
|
+
indexSettingsAsSearchParams:
|
|
1217
|
+
type: object
|
|
1218
|
+
additionalProperties: false
|
|
1219
|
+
properties:
|
|
1220
|
+
attributesToRetrieve:
|
|
1221
|
+
type: array
|
|
1222
|
+
items:
|
|
1223
|
+
type: string
|
|
1224
|
+
example:
|
|
1225
|
+
- author
|
|
1226
|
+
- title
|
|
1227
|
+
- content
|
|
1228
|
+
description: >
|
|
1229
|
+
Attributes to include in the API response.
|
|
1230
|
+
|
|
1231
|
+
|
|
1232
|
+
To reduce the size of your response, you can retrieve only some of the attributes.
|
|
1233
|
+
|
|
1234
|
+
Attribute names are case-sensitive.
|
|
1235
|
+
|
|
1236
|
+
|
|
1237
|
+
- `*` retrieves all attributes, except attributes included in the `customRanking` and `unretrievableAttributes` settings.
|
|
1238
|
+
|
|
1239
|
+
- To retrieve all attributes except a specific one, prefix the attribute with a dash and combine it with the `*`: `["*", "-ATTRIBUTE"]`.
|
|
1240
|
+
|
|
1241
|
+
- The `objectID` attribute is always included.
|
|
1242
|
+
|
|
1243
|
+
x-categories:
|
|
1244
|
+
- Attributes
|
|
1245
|
+
ranking:
|
|
1246
|
+
type: array
|
|
1247
|
+
items:
|
|
1248
|
+
type: string
|
|
1249
|
+
description: >
|
|
1250
|
+
Determines the order in which Algolia returns your results.
|
|
1251
|
+
|
|
1252
|
+
|
|
1253
|
+
By default, each entry corresponds to a [ranking criteria](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/).
|
|
1254
|
+
|
|
1255
|
+
The tie-breaking algorithm sequentially applies each criterion in the order they're specified.
|
|
1256
|
+
|
|
1257
|
+
If you configure a replica index for [sorting by an attribute](https://www.algolia.com/doc/guides/managing-results/refine-results/sorting/how-to/sort-by-attribute/),
|
|
1258
|
+
|
|
1259
|
+
you put the sorting attribute at the top of the list.
|
|
1260
|
+
|
|
1261
|
+
|
|
1262
|
+
**Modifiers**
|
|
1263
|
+
|
|
1264
|
+
|
|
1265
|
+
- `asc("ATTRIBUTE")`.
|
|
1266
|
+
Sort the index by the values of an attribute, in ascending order.
|
|
1267
|
+
- `desc("ATTRIBUTE")`.
|
|
1268
|
+
Sort the index by the values of an attribute, in descending order.
|
|
1269
|
+
|
|
1270
|
+
Before you modify the default setting,
|
|
1271
|
+
|
|
1272
|
+
you should test your changes in the dashboard,
|
|
1273
|
+
|
|
1274
|
+
and by [A/B testing](https://www.algolia.com/doc/guides/ab-testing/what-is-ab-testing/).
|
|
1275
|
+
|
|
1276
|
+
x-categories:
|
|
1277
|
+
- Ranking
|
|
1278
|
+
customRanking:
|
|
1279
|
+
type: array
|
|
1280
|
+
items:
|
|
1281
|
+
type: string
|
|
1282
|
+
example:
|
|
1283
|
+
- desc(popularity)
|
|
1284
|
+
- asc(price)
|
|
1285
|
+
description: >
|
|
1286
|
+
Attributes to use as [custom ranking](https://www.algolia.com/doc/guides/managing-results/must-do/custom-ranking/).
|
|
1287
|
+
|
|
1288
|
+
Attribute names are case-sensitive.
|
|
1289
|
+
|
|
1290
|
+
|
|
1291
|
+
The custom ranking attributes decide which items are shown first if the other ranking criteria are equal.
|
|
1292
|
+
|
|
1293
|
+
|
|
1294
|
+
Records with missing values for your selected custom ranking attributes are always sorted last.
|
|
1295
|
+
|
|
1296
|
+
Boolean attributes are sorted based on their alphabetical order.
|
|
1297
|
+
|
|
1298
|
+
|
|
1299
|
+
**Modifiers**
|
|
1300
|
+
|
|
1301
|
+
|
|
1302
|
+
- `asc("ATTRIBUTE")`.
|
|
1303
|
+
Sort the index by the values of an attribute, in ascending order.
|
|
1304
|
+
|
|
1305
|
+
- `desc("ATTRIBUTE")`.
|
|
1306
|
+
Sort the index by the values of an attribute, in descending order.
|
|
1307
|
+
|
|
1308
|
+
If you use two or more custom ranking attributes,
|
|
1309
|
+
|
|
1310
|
+
[reduce the precision](https://www.algolia.com/doc/guides/managing-results/must-do/custom-ranking/how-to/controlling-custom-ranking-metrics-precision/) of your first attributes,
|
|
1311
|
+
|
|
1312
|
+
or the other attributes will never be applied.
|
|
1313
|
+
|
|
1314
|
+
x-categories:
|
|
1315
|
+
- Ranking
|
|
1316
|
+
relevancyStrictness:
|
|
1317
|
+
type: integer
|
|
1318
|
+
example: 90
|
|
1319
|
+
description: >
|
|
1320
|
+
Relevancy threshold below which less relevant results aren't included in the results.
|
|
1321
|
+
|
|
1322
|
+
|
|
1323
|
+
You can only set `relevancyStrictness` on [virtual replica indices](https://www.algolia.com/doc/guides/managing-results/refine-results/sorting/in-depth/replicas/#what-are-virtual-replicas).
|
|
1324
|
+
|
|
1325
|
+
Use this setting to strike a balance between the relevance and number of returned results.
|
|
1326
|
+
|
|
1327
|
+
x-categories:
|
|
1328
|
+
- Ranking
|
|
1329
|
+
attributesToHighlight:
|
|
1330
|
+
type: array
|
|
1331
|
+
items:
|
|
1332
|
+
type: string
|
|
1333
|
+
example:
|
|
1334
|
+
- author
|
|
1335
|
+
- title
|
|
1336
|
+
- conten
|
|
1337
|
+
- content
|
|
1338
|
+
description: >
|
|
1339
|
+
Attributes to highlight.
|
|
1340
|
+
|
|
1341
|
+
|
|
1342
|
+
By default, all searchable attributes are highlighted.
|
|
1343
|
+
|
|
1344
|
+
Use `*` to highlight all attributes or use an empty array `[]` to turn off highlighting.
|
|
1345
|
+
|
|
1346
|
+
Attribute names are case-sensitive.
|
|
1347
|
+
|
|
1348
|
+
|
|
1349
|
+
With highlighting, strings that match the search query are surrounded by HTML tags defined by `highlightPreTag` and `highlightPostTag`.
|
|
1350
|
+
|
|
1351
|
+
You can use this to visually highlight matching parts of a search query in your UI.
|
|
1352
|
+
|
|
1353
|
+
|
|
1354
|
+
For more information, see [Highlighting and snippeting](https://www.algolia.com/doc/guides/building-search-ui/ui-and-ux-patterns/highlighting-snippeting/js/).
|
|
1355
|
+
|
|
1356
|
+
x-categories:
|
|
1357
|
+
- Highlighting and Snippeting
|
|
1358
|
+
attributesToSnippet:
|
|
1359
|
+
type: array
|
|
1360
|
+
items:
|
|
1361
|
+
type: string
|
|
1362
|
+
example:
|
|
1363
|
+
- content:80
|
|
1364
|
+
- description
|
|
1365
|
+
description: >
|
|
1366
|
+
Attributes for which to enable snippets.
|
|
1367
|
+
|
|
1368
|
+
Attribute names are case-sensitive.
|
|
1369
|
+
|
|
1370
|
+
|
|
1371
|
+
Snippets provide additional context to matched words.
|
|
1372
|
+
|
|
1373
|
+
If you enable snippets, they include 10 words, including the matched word.
|
|
1374
|
+
|
|
1375
|
+
The matched word will also be wrapped by HTML tags for highlighting.
|
|
1376
|
+
|
|
1377
|
+
You can adjust the number of words with the following notation: `ATTRIBUTE:NUMBER`,
|
|
1378
|
+
|
|
1379
|
+
where `NUMBER` is the number of words to be extracted.
|
|
1380
|
+
|
|
1381
|
+
x-categories:
|
|
1382
|
+
- Highlighting and Snippeting
|
|
1383
|
+
highlightPreTag:
|
|
1384
|
+
type: string
|
|
1385
|
+
description: >-
|
|
1386
|
+
HTML tag to insert before the highlighted parts in all highlighted results and snippets.
|
|
1387
|
+
|
|
1388
|
+
x-categories:
|
|
1389
|
+
- Highlighting and Snippeting
|
|
1390
|
+
highlightPostTag:
|
|
1391
|
+
type: string
|
|
1392
|
+
description: >-
|
|
1393
|
+
HTML tag to insert after the highlighted parts in all highlighted results and snippets.
|
|
1394
|
+
|
|
1395
|
+
x-categories:
|
|
1396
|
+
- Highlighting and Snippeting
|
|
1397
|
+
snippetEllipsisText:
|
|
1398
|
+
type: string
|
|
1399
|
+
description: String used as an ellipsis indicator when a snippet is truncated.
|
|
1400
|
+
x-categories:
|
|
1401
|
+
- Highlighting and Snippeting
|
|
1402
|
+
restrictHighlightAndSnippetArrays:
|
|
1403
|
+
type: boolean
|
|
1404
|
+
description: >
|
|
1405
|
+
Whether to restrict highlighting and snippeting to items that at least partially matched the search query.
|
|
1406
|
+
|
|
1407
|
+
By default, all items are highlighted and snippeted.
|
|
1408
|
+
|
|
1409
|
+
x-categories:
|
|
1410
|
+
- Highlighting and Snippeting
|
|
1411
|
+
hitsPerPage:
|
|
1412
|
+
$ref: '#/components/schemas/hitsPerPage'
|
|
1413
|
+
minWordSizefor1Typo:
|
|
1414
|
+
type: integer
|
|
1415
|
+
description: >-
|
|
1416
|
+
Minimum number of characters a word in the search query must contain to accept matches with [one typo](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/typo-tolerance/in-depth/configuring-typo-tolerance/#configuring-word-length-for-typos).
|
|
1417
|
+
|
|
1418
|
+
x-categories:
|
|
1419
|
+
- Typos
|
|
1420
|
+
minWordSizefor2Typos:
|
|
1421
|
+
type: integer
|
|
1422
|
+
description: >-
|
|
1423
|
+
Minimum number of characters a word in the search query must contain to accept matches with [two typos](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/typo-tolerance/in-depth/configuring-typo-tolerance/#configuring-word-length-for-typos).
|
|
1424
|
+
|
|
1425
|
+
x-categories:
|
|
1426
|
+
- Typos
|
|
1427
|
+
typoTolerance:
|
|
1428
|
+
$ref: '#/components/schemas/typoTolerance'
|
|
1429
|
+
allowTyposOnNumericTokens:
|
|
1430
|
+
type: boolean
|
|
1431
|
+
description: |
|
|
1432
|
+
Whether to allow typos on numbers in the search query.
|
|
1433
|
+
|
|
1434
|
+
Turn off this setting to reduce the number of irrelevant matches
|
|
1435
|
+
when searching in large sets of similar numbers.
|
|
1436
|
+
x-categories:
|
|
1437
|
+
- Typos
|
|
1438
|
+
disableTypoToleranceOnAttributes:
|
|
1439
|
+
type: array
|
|
1440
|
+
items:
|
|
1441
|
+
type: string
|
|
1442
|
+
example:
|
|
1443
|
+
- sku
|
|
1444
|
+
description: >
|
|
1445
|
+
Attributes for which you want to turn off [typo tolerance](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/typo-tolerance/).
|
|
1446
|
+
|
|
1447
|
+
Attribute names are case-sensitive.
|
|
1448
|
+
|
|
1449
|
+
|
|
1450
|
+
Returning only exact matches can help when:
|
|
1451
|
+
|
|
1452
|
+
|
|
1453
|
+
- [Searching in hyphenated attributes](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/typo-tolerance/how-to/how-to-search-in-hyphenated-attributes/).
|
|
1454
|
+
|
|
1455
|
+
- Reducing the number of matches when you have too many.
|
|
1456
|
+
This can happen with attributes that are long blocks of text, such as product descriptions.
|
|
1457
|
+
|
|
1458
|
+
Consider alternatives such as `disableTypoToleranceOnWords` or adding synonyms if your attributes have intentional unusual spellings that might look like typos.
|
|
1459
|
+
|
|
1460
|
+
x-categories:
|
|
1461
|
+
- Typos
|
|
1462
|
+
ignorePlurals:
|
|
1463
|
+
$ref: '#/components/schemas/ignorePlurals'
|
|
1464
|
+
removeStopWords:
|
|
1465
|
+
$ref: '#/components/schemas/removeStopWords'
|
|
1466
|
+
keepDiacriticsOnCharacters:
|
|
1467
|
+
type: string
|
|
1468
|
+
example: øé
|
|
1469
|
+
description: |
|
|
1470
|
+
Characters for which diacritics should be preserved.
|
|
1471
|
+
|
|
1472
|
+
By default, Algolia removes diacritics from letters.
|
|
1473
|
+
For example, `é` becomes `e`. If this causes issues in your search,
|
|
1474
|
+
you can specify characters that should keep their diacritics.
|
|
1475
|
+
x-categories:
|
|
1476
|
+
- Languages
|
|
1477
|
+
queryLanguages:
|
|
1478
|
+
type: array
|
|
1479
|
+
items:
|
|
1480
|
+
$ref: '#/components/schemas/supportedLanguage'
|
|
1481
|
+
example:
|
|
1482
|
+
- es
|
|
1483
|
+
description: >
|
|
1484
|
+
Languages for language-specific query processing steps such as plurals, stop-word removal, and word-detection dictionaries.
|
|
1485
|
+
|
|
1486
|
+
|
|
1487
|
+
This setting sets a default list of languages used by the `removeStopWords` and `ignorePlurals` settings.
|
|
1488
|
+
|
|
1489
|
+
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.
|
|
1490
|
+
|
|
1491
|
+
To support this, you must place the CJK language **first**.
|
|
1492
|
+
|
|
1493
|
+
|
|
1494
|
+
**You should always specify a query language.**
|
|
1495
|
+
|
|
1496
|
+
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/),
|
|
1497
|
+
|
|
1498
|
+
or the languages you specified with the `ignorePlurals` or `removeStopWords` parameters.
|
|
1499
|
+
|
|
1500
|
+
This can lead to unexpected search results.
|
|
1501
|
+
|
|
1502
|
+
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/).
|
|
1503
|
+
|
|
1504
|
+
x-categories:
|
|
1505
|
+
- Languages
|
|
1506
|
+
decompoundQuery:
|
|
1507
|
+
type: boolean
|
|
1508
|
+
description: >
|
|
1509
|
+
Whether to split compound words in the query into their building blocks.
|
|
1510
|
+
|
|
1511
|
+
|
|
1512
|
+
For more information, see [Word segmentation](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/language-specific-configurations/#splitting-compound-words).
|
|
1513
|
+
|
|
1514
|
+
Word segmentation is supported for these languages: German, Dutch, Finnish, Swedish, and Norwegian.
|
|
1515
|
+
|
|
1516
|
+
Decompounding doesn't work for words with [non-spacing mark Unicode characters](https://www.charactercodes.net/category/non-spacing_mark).
|
|
1517
|
+
|
|
1518
|
+
For example, `Gartenstühle` won't be decompounded if the `ü` consists of `u` (U+0075) and `◌̈` (U+0308).
|
|
1519
|
+
|
|
1520
|
+
x-categories:
|
|
1521
|
+
- Languages
|
|
1522
|
+
enableRules:
|
|
1523
|
+
type: boolean
|
|
1524
|
+
description: Whether to enable rules.
|
|
1525
|
+
x-categories:
|
|
1526
|
+
- Rules
|
|
1527
|
+
enablePersonalization:
|
|
1528
|
+
type: boolean
|
|
1529
|
+
description: Whether to enable Personalization.
|
|
1530
|
+
x-categories:
|
|
1531
|
+
- Personalization
|
|
1532
|
+
queryType:
|
|
1533
|
+
$ref: '#/components/schemas/queryType'
|
|
1534
|
+
removeWordsIfNoResults:
|
|
1535
|
+
$ref: '#/components/schemas/removeWordsIfNoResults'
|
|
1536
|
+
mode:
|
|
1537
|
+
$ref: '#/components/schemas/mode'
|
|
1538
|
+
semanticSearch:
|
|
1539
|
+
$ref: '#/components/schemas/semanticSearch'
|
|
1540
|
+
advancedSyntax:
|
|
1541
|
+
type: boolean
|
|
1542
|
+
description: >
|
|
1543
|
+
Whether to support phrase matching and excluding words from search queries.
|
|
1544
|
+
|
|
1545
|
+
|
|
1546
|
+
Use the `advancedSyntaxFeatures` parameter to control which feature is supported.
|
|
1547
|
+
|
|
1548
|
+
x-categories:
|
|
1549
|
+
- Query strategy
|
|
1550
|
+
optionalWords:
|
|
1551
|
+
type: array
|
|
1552
|
+
items:
|
|
1553
|
+
type: string
|
|
1554
|
+
example:
|
|
1555
|
+
- blue
|
|
1556
|
+
- iphone case
|
|
1557
|
+
description: >
|
|
1558
|
+
Words that should be considered optional when found in the query.
|
|
1559
|
+
|
|
1560
|
+
|
|
1561
|
+
By default, records must match all words in the search query to be included in the search results.
|
|
1562
|
+
|
|
1563
|
+
Adding optional words can help to increase the number of search results by running an additional search query that doesn't include the optional words.
|
|
1564
|
+
|
|
1565
|
+
For example, if the search query is "action video" and "video" is an optional word,
|
|
1566
|
+
|
|
1567
|
+
the search engine runs two queries. One for "action video" and one for "action".
|
|
1568
|
+
|
|
1569
|
+
Records that match all words are ranked higher.
|
|
1570
|
+
|
|
1571
|
+
|
|
1572
|
+
For a search query with 4 or more words **and** all its words are optional,
|
|
1573
|
+
|
|
1574
|
+
the number of matched words required for a record to be included in the search results increases for every 1,000 records:
|
|
1575
|
+
|
|
1576
|
+
|
|
1577
|
+
- If `optionalWords` has less than 10 words, the required number of matched words increases by 1:
|
|
1578
|
+
results 1 to 1,000 require 1 matched word, results 1,001 to 2000 need 2 matched words.
|
|
1579
|
+
- If `optionalWords` has 10 or more words, the number of required matched words increases by the number of optional words dividied by 5 (rounded down).
|
|
1580
|
+
For example, with 18 optional words: results 1 to 1,000 require 1 matched word, results 1,001 to 2000 need 4 matched words.
|
|
1581
|
+
|
|
1582
|
+
For more information, see [Optional words](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/empty-or-insufficient-results/#creating-a-list-of-optional-words).
|
|
1583
|
+
|
|
1584
|
+
x-categories:
|
|
1585
|
+
- Query strategy
|
|
1586
|
+
disableExactOnAttributes:
|
|
1587
|
+
type: array
|
|
1588
|
+
items:
|
|
1589
|
+
type: string
|
|
1590
|
+
example:
|
|
1591
|
+
- description
|
|
1592
|
+
description: >
|
|
1593
|
+
Searchable attributes for which you want to [turn off the Exact ranking criterion](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/override-search-engine-defaults/in-depth/adjust-exact-settings/#turn-off-exact-for-some-attributes).
|
|
1594
|
+
|
|
1595
|
+
Attribute names are case-sensitive.
|
|
1596
|
+
|
|
1597
|
+
|
|
1598
|
+
This can be useful for attributes with long values, where the likelyhood of an exact match is high,
|
|
1599
|
+
|
|
1600
|
+
such as product descriptions.
|
|
1601
|
+
|
|
1602
|
+
Turning off the Exact ranking criterion for these attributes favors exact matching on other attributes.
|
|
1603
|
+
|
|
1604
|
+
This reduces the impact of individual attributes with a lot of content on ranking.
|
|
1605
|
+
|
|
1606
|
+
x-categories:
|
|
1607
|
+
- Query strategy
|
|
1608
|
+
exactOnSingleWordQuery:
|
|
1609
|
+
$ref: '#/components/schemas/exactOnSingleWordQuery'
|
|
1610
|
+
alternativesAsExact:
|
|
1611
|
+
type: array
|
|
1612
|
+
items:
|
|
1613
|
+
$ref: '#/components/schemas/alternativesAsExact'
|
|
1614
|
+
description: >
|
|
1615
|
+
Alternatives of query words that should be considered as exact matches by the Exact ranking criterion.
|
|
1616
|
+
|
|
1617
|
+
|
|
1618
|
+
- `ignorePlurals`.
|
|
1619
|
+
Plurals and similar declensions added by the `ignorePlurals` setting are considered exact matches.
|
|
1620
|
+
|
|
1621
|
+
- `singleWordSynonym`.
|
|
1622
|
+
Single-word synonyms, such as "NY/NYC" are considered exact matches.
|
|
1623
|
+
|
|
1624
|
+
- `multiWordsSynonym`.
|
|
1625
|
+
Multi-word synonyms, such as "NY/New York" are considered exact matches.
|
|
1626
|
+
|
|
1627
|
+
x-categories:
|
|
1628
|
+
- Query strategy
|
|
1629
|
+
advancedSyntaxFeatures:
|
|
1630
|
+
type: array
|
|
1631
|
+
items:
|
|
1632
|
+
$ref: '#/components/schemas/advancedSyntaxFeatures'
|
|
1633
|
+
description: |
|
|
1634
|
+
Advanced search syntax features you want to support.
|
|
1635
|
+
|
|
1636
|
+
- `exactPhrase`.
|
|
1637
|
+
Phrases in quotes must match exactly.
|
|
1638
|
+
For example, `sparkly blue "iPhone case"` only returns records with the exact string "iPhone case".
|
|
1639
|
+
|
|
1640
|
+
- `excludeWords`.
|
|
1641
|
+
Query words prefixed with a `-` must not occur in a record.
|
|
1642
|
+
For example, `search -engine` matches records that contain "search" but not "engine".
|
|
1643
|
+
|
|
1644
|
+
This setting only has an effect if `advancedSyntax` is true.
|
|
1645
|
+
x-categories:
|
|
1646
|
+
- Query strategy
|
|
1647
|
+
distinct:
|
|
1648
|
+
$ref: '#/components/schemas/distinct'
|
|
1649
|
+
replaceSynonymsInHighlight:
|
|
1650
|
+
type: boolean
|
|
1651
|
+
description: >
|
|
1652
|
+
Whether to replace a highlighted word with the matched synonym.
|
|
1653
|
+
|
|
1654
|
+
|
|
1655
|
+
By default, the original words are highlighted even if a synonym matches.
|
|
1656
|
+
|
|
1657
|
+
For example, with `home` as a synonym for `house` and a search for `home`,
|
|
1658
|
+
|
|
1659
|
+
records matching either "home" or "house" are included in the search results,
|
|
1660
|
+
|
|
1661
|
+
and either "home" or "house" are highlighted.
|
|
1662
|
+
|
|
1663
|
+
|
|
1664
|
+
With `replaceSynonymsInHighlight` set to `true`, a search for `home` still matches the same records,
|
|
1665
|
+
|
|
1666
|
+
but all occurences of "house" are replaced by "home" in the highlighted response.
|
|
1667
|
+
|
|
1668
|
+
x-categories:
|
|
1669
|
+
- Highlighting and Snippeting
|
|
1670
|
+
minProximity:
|
|
1671
|
+
type: integer
|
|
1672
|
+
minimum: 1
|
|
1673
|
+
maximum: 7
|
|
1674
|
+
description: >
|
|
1675
|
+
Minimum proximity score for two matching words.
|
|
1676
|
+
|
|
1677
|
+
|
|
1678
|
+
This adjusts the [Proximity ranking criterion](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/#proximity)
|
|
1679
|
+
|
|
1680
|
+
by equally scoring matches that are farther apart.
|
|
1681
|
+
|
|
1682
|
+
|
|
1683
|
+
For example, if `minProximity` is 2, neighboring matches and matches with one word between them would have the same score.
|
|
1684
|
+
|
|
1685
|
+
x-categories:
|
|
1686
|
+
- Advanced
|
|
1687
|
+
responseFields:
|
|
1688
|
+
type: array
|
|
1689
|
+
items:
|
|
1690
|
+
type: string
|
|
1691
|
+
description: >
|
|
1692
|
+
Properties to include in the API response of `search` and `browse` requests.
|
|
1693
|
+
|
|
1694
|
+
|
|
1695
|
+
By default, all response properties are included.
|
|
1696
|
+
|
|
1697
|
+
To reduce the response size, you can select, which attributes should be included.
|
|
1698
|
+
|
|
1699
|
+
|
|
1700
|
+
You can't exclude these properties:
|
|
1701
|
+
|
|
1702
|
+
`message`, `warning`, `cursor`, `serverUsed`, `indexUsed`,
|
|
1703
|
+
|
|
1704
|
+
`abTestVariantID`, `parsedQuery`, or any property triggered by the `getRankingInfo` parameter.
|
|
1705
|
+
|
|
1706
|
+
|
|
1707
|
+
Don't exclude properties that you might need in your search UI.
|
|
1708
|
+
|
|
1709
|
+
x-categories:
|
|
1710
|
+
- Advanced
|
|
1711
|
+
maxFacetHits:
|
|
1712
|
+
$ref: '#/components/schemas/maxFacetHits'
|
|
1713
|
+
maxValuesPerFacet:
|
|
1714
|
+
type: integer
|
|
1715
|
+
description: Maximum number of facet values to return for each facet.
|
|
1716
|
+
maximum: 1000
|
|
1717
|
+
x-categories:
|
|
1718
|
+
- Faceting
|
|
1719
|
+
sortFacetValuesBy:
|
|
1720
|
+
type: string
|
|
1721
|
+
description: >
|
|
1722
|
+
Order in which to retrieve facet values.
|
|
1723
|
+
|
|
1724
|
+
|
|
1725
|
+
- `count`.
|
|
1726
|
+
Facet values are retrieved by decreasing count.
|
|
1727
|
+
The count is the number of matching records containing this facet value.
|
|
1728
|
+
|
|
1729
|
+
- `alpha`.
|
|
1730
|
+
Retrieve facet values alphabetically.
|
|
1731
|
+
|
|
1732
|
+
This setting doesn't influence how facet values are displayed in your UI (see `renderingContent`).
|
|
1733
|
+
|
|
1734
|
+
For more information, see [facet value display](https://www.algolia.com/doc/guides/building-search-ui/ui-and-ux-patterns/facet-display/js/).
|
|
1735
|
+
|
|
1736
|
+
x-categories:
|
|
1737
|
+
- Faceting
|
|
1738
|
+
attributeCriteriaComputedByMinProximity:
|
|
1739
|
+
type: boolean
|
|
1740
|
+
description: >
|
|
1741
|
+
Whether the best matching attribute should be determined by minimum proximity.
|
|
1742
|
+
|
|
1743
|
+
|
|
1744
|
+
This setting only affects ranking if the Attribute ranking criterion comes before Proximity in the `ranking` setting.
|
|
1745
|
+
|
|
1746
|
+
If true, the best matching attribute is selected based on the minimum proximity of multiple matches.
|
|
1747
|
+
|
|
1748
|
+
Otherwise, the best matching attribute is determined by the order in the `searchableAttributes` setting.
|
|
1749
|
+
|
|
1750
|
+
x-categories:
|
|
1751
|
+
- Advanced
|
|
1752
|
+
renderingContent:
|
|
1753
|
+
$ref: '#/components/schemas/renderingContent'
|
|
1754
|
+
enableReRanking:
|
|
1755
|
+
type: boolean
|
|
1756
|
+
description: >
|
|
1757
|
+
Whether this search will use [Dynamic Re-Ranking](https://www.algolia.com/doc/guides/algolia-ai/re-ranking/).
|
|
1758
|
+
|
|
1759
|
+
|
|
1760
|
+
This setting only has an effect if you activated Dynamic Re-Ranking for this index in the Algolia dashboard.
|
|
1761
|
+
|
|
1762
|
+
x-categories:
|
|
1763
|
+
- Filtering
|
|
1764
|
+
reRankingApplyFilter:
|
|
1765
|
+
oneOf:
|
|
1766
|
+
- $ref: '#/components/schemas/reRankingApplyFilter'
|
|
1767
|
+
- type: 'null'
|
|
1768
|
+
searchParamsObject:
|
|
1769
|
+
title: Search parameters as object
|
|
1770
|
+
description: >-
|
|
1771
|
+
Each parameter value, including the `query` must not be larger than 512 bytes.
|
|
1772
|
+
|
|
1773
|
+
allOf:
|
|
1774
|
+
- $ref: '#/components/schemas/baseSearchParams'
|
|
1775
|
+
- $ref: '#/components/schemas/indexSettingsAsSearchParams'
|
|
1776
|
+
searchParams:
|
|
1777
|
+
title: queryParameters
|
|
1778
|
+
allOf:
|
|
1779
|
+
- $ref: '#/components/schemas/searchParamsObject'
|
|
1780
|
+
baseRecommendRequest:
|
|
1781
|
+
type: object
|
|
1782
|
+
additionalProperties: false
|
|
1783
|
+
properties:
|
|
1784
|
+
indexName:
|
|
1785
|
+
$ref: '#/components/schemas/indexName'
|
|
1786
|
+
threshold:
|
|
1787
|
+
type: number
|
|
1788
|
+
format: double
|
|
1789
|
+
minimum: 0
|
|
1790
|
+
maximum: 100
|
|
1791
|
+
description: >-
|
|
1792
|
+
Minimum score a recommendation must have to be included in the response.
|
|
1793
|
+
|
|
1794
|
+
maxRecommendations:
|
|
1795
|
+
type: integer
|
|
1796
|
+
minimum: 1
|
|
1797
|
+
maximum: 1000
|
|
1798
|
+
description: >
|
|
1799
|
+
Maximum number of recommendations to retrieve.
|
|
1800
|
+
|
|
1801
|
+
By default, all recommendations are returned and no fallback request is made.
|
|
1802
|
+
|
|
1803
|
+
Depending on the available recommendations and the other request parameters,
|
|
1804
|
+
|
|
1805
|
+
the actual number of recommendations may be lower than this value.
|
|
1806
|
+
|
|
1807
|
+
queryParameters:
|
|
1808
|
+
$ref: '#/components/schemas/searchParamsObject'
|
|
1809
|
+
required:
|
|
1810
|
+
- indexName
|
|
1811
|
+
- threshold
|
|
1812
|
+
fbtModel:
|
|
1813
|
+
type: string
|
|
1814
|
+
description: >
|
|
1815
|
+
Frequently bought together model.
|
|
1816
|
+
|
|
1817
|
+
|
|
1818
|
+
This model recommends items that have been purchased within 1 day with the item with the ID `objectID`.
|
|
1819
|
+
|
|
1820
|
+
enum:
|
|
1821
|
+
- bought-together
|
|
1822
|
+
objectID:
|
|
1823
|
+
type: string
|
|
1824
|
+
description: Unique record identifier.
|
|
1825
|
+
example: test-record-123
|
|
1826
|
+
frequentlyBoughtTogether:
|
|
1827
|
+
type: object
|
|
1828
|
+
properties:
|
|
1829
|
+
model:
|
|
1830
|
+
$ref: '#/components/schemas/fbtModel'
|
|
1831
|
+
objectID:
|
|
1832
|
+
$ref: '#/components/schemas/objectID'
|
|
1833
|
+
required:
|
|
1834
|
+
- model
|
|
1835
|
+
- objectID
|
|
1836
|
+
boughtTogetherQuery:
|
|
1837
|
+
title: Frequently bought together
|
|
1838
|
+
allOf:
|
|
1839
|
+
- $ref: '#/components/schemas/baseRecommendRequest'
|
|
1840
|
+
- $ref: '#/components/schemas/frequentlyBoughtTogether'
|
|
1841
|
+
relatedModel:
|
|
1842
|
+
type: string
|
|
1843
|
+
description: >
|
|
1844
|
+
Related products or similar content model.
|
|
1845
|
+
|
|
1846
|
+
|
|
1847
|
+
This model recommends items that are similar to the item with the ID `objectID`.
|
|
1848
|
+
|
|
1849
|
+
Similarity is determined from the user interactions and attributes.
|
|
1850
|
+
|
|
1851
|
+
enum:
|
|
1852
|
+
- related-products
|
|
1853
|
+
fallbackParams:
|
|
1854
|
+
title: fallbackParameters
|
|
1855
|
+
allOf:
|
|
1856
|
+
- $ref: '#/components/schemas/searchParamsObject'
|
|
1857
|
+
relatedProducts:
|
|
1858
|
+
type: object
|
|
1859
|
+
properties:
|
|
1860
|
+
model:
|
|
1861
|
+
$ref: '#/components/schemas/relatedModel'
|
|
1862
|
+
objectID:
|
|
1863
|
+
$ref: '#/components/schemas/objectID'
|
|
1864
|
+
fallbackParameters:
|
|
1865
|
+
$ref: '#/components/schemas/searchParamsObject'
|
|
1866
|
+
required:
|
|
1867
|
+
- model
|
|
1868
|
+
- objectID
|
|
1869
|
+
relatedQuery:
|
|
1870
|
+
title: Related products
|
|
1871
|
+
allOf:
|
|
1872
|
+
- $ref: '#/components/schemas/baseRecommendRequest'
|
|
1873
|
+
- $ref: '#/components/schemas/relatedProducts'
|
|
1874
|
+
facetName:
|
|
1875
|
+
type: string
|
|
1876
|
+
description: >
|
|
1877
|
+
Facet attribute. To be used in combination with `facetValue`.
|
|
1878
|
+
|
|
1879
|
+
If specified, only recommendations matching the facet filter will be returned.
|
|
1880
|
+
|
|
1881
|
+
facetValue:
|
|
1882
|
+
type: string
|
|
1883
|
+
description: >
|
|
1884
|
+
Facet value. To be used in combination with `facetName`.
|
|
1885
|
+
|
|
1886
|
+
If specified, only recommendations matching the facet filter will be returned.
|
|
1887
|
+
|
|
1888
|
+
trendingItemsModel:
|
|
1889
|
+
description: >
|
|
1890
|
+
Trending items model.
|
|
1891
|
+
|
|
1892
|
+
|
|
1893
|
+
Trending items are determined from the number of conversion events collected on them.
|
|
1894
|
+
|
|
1895
|
+
type: string
|
|
1896
|
+
enum:
|
|
1897
|
+
- trending-items
|
|
1898
|
+
trendingItems:
|
|
1899
|
+
type: object
|
|
1900
|
+
properties:
|
|
1901
|
+
facetName:
|
|
1902
|
+
$ref: '#/components/schemas/facetName'
|
|
1903
|
+
facetValue:
|
|
1904
|
+
$ref: '#/components/schemas/facetValue'
|
|
1905
|
+
model:
|
|
1906
|
+
$ref: '#/components/schemas/trendingItemsModel'
|
|
1907
|
+
fallbackParameters:
|
|
1908
|
+
$ref: '#/components/schemas/searchParamsObject'
|
|
1909
|
+
required:
|
|
1910
|
+
- model
|
|
1911
|
+
trendingItemsQuery:
|
|
1912
|
+
title: Trending items
|
|
1913
|
+
allOf:
|
|
1914
|
+
- $ref: '#/components/schemas/baseRecommendRequest'
|
|
1915
|
+
- $ref: '#/components/schemas/trendingItems'
|
|
1916
|
+
trendingFacetsModel:
|
|
1917
|
+
type: string
|
|
1918
|
+
description: >
|
|
1919
|
+
Trending facet values model.
|
|
1920
|
+
|
|
1921
|
+
|
|
1922
|
+
This model recommends trending facet values for the specified facet attribute.
|
|
1923
|
+
|
|
1924
|
+
enum:
|
|
1925
|
+
- trending-facets
|
|
1926
|
+
trendingFacets:
|
|
1927
|
+
type: object
|
|
1928
|
+
properties:
|
|
1929
|
+
facetName:
|
|
1930
|
+
description: Facet attribute for which to retrieve trending facet values.
|
|
1931
|
+
model:
|
|
1932
|
+
$ref: '#/components/schemas/trendingFacetsModel'
|
|
1933
|
+
fallbackParameters:
|
|
1934
|
+
$ref: '#/components/schemas/searchParamsObject'
|
|
1935
|
+
required:
|
|
1936
|
+
- facetName
|
|
1937
|
+
- model
|
|
1938
|
+
trendingFacetsQuery:
|
|
1939
|
+
title: Trending facet values
|
|
1940
|
+
allOf:
|
|
1941
|
+
- $ref: '#/components/schemas/baseRecommendRequest'
|
|
1942
|
+
- $ref: '#/components/schemas/trendingFacets'
|
|
1943
|
+
lookingSimilarModel:
|
|
1944
|
+
type: string
|
|
1945
|
+
description: >
|
|
1946
|
+
Looking similar model.
|
|
1947
|
+
|
|
1948
|
+
|
|
1949
|
+
This model recommends items that look similar to the item with the ID `objectID` based on image attributes in your index.
|
|
1950
|
+
|
|
1951
|
+
enum:
|
|
1952
|
+
- looking-similar
|
|
1953
|
+
lookingSimilar:
|
|
1954
|
+
type: object
|
|
1955
|
+
properties:
|
|
1956
|
+
model:
|
|
1957
|
+
$ref: '#/components/schemas/lookingSimilarModel'
|
|
1958
|
+
objectID:
|
|
1959
|
+
$ref: '#/components/schemas/objectID'
|
|
1960
|
+
fallbackParameters:
|
|
1961
|
+
$ref: '#/components/schemas/searchParamsObject'
|
|
1962
|
+
required:
|
|
1963
|
+
- model
|
|
1964
|
+
- objectID
|
|
1965
|
+
lookingSimilarQuery:
|
|
1966
|
+
title: Looking similar
|
|
1967
|
+
allOf:
|
|
1968
|
+
- $ref: '#/components/schemas/baseRecommendRequest'
|
|
1969
|
+
- $ref: '#/components/schemas/lookingSimilar'
|
|
1970
|
+
recommendedForYouModel:
|
|
1971
|
+
type: string
|
|
1972
|
+
description: |
|
|
1973
|
+
"Recommened for you" model.
|
|
1974
|
+
enum:
|
|
1975
|
+
- recommended-for-you
|
|
1976
|
+
recommendedForYou:
|
|
1977
|
+
type: object
|
|
1978
|
+
properties:
|
|
1979
|
+
model:
|
|
1980
|
+
$ref: '#/components/schemas/recommendedForYouModel'
|
|
1981
|
+
fallbackParameters:
|
|
1982
|
+
$ref: '#/components/schemas/searchParamsObject'
|
|
1983
|
+
required:
|
|
1984
|
+
- model
|
|
1985
|
+
recommendedForYouQuery:
|
|
1986
|
+
title: Recommended for you
|
|
1987
|
+
allOf:
|
|
1988
|
+
- $ref: '#/components/schemas/baseRecommendRequest'
|
|
1989
|
+
- $ref: '#/components/schemas/recommendedForYou'
|
|
1990
|
+
recommendationsRequest:
|
|
1991
|
+
oneOf:
|
|
1992
|
+
- $ref: '#/components/schemas/boughtTogetherQuery'
|
|
1993
|
+
- $ref: '#/components/schemas/relatedQuery'
|
|
1994
|
+
- $ref: '#/components/schemas/trendingItemsQuery'
|
|
1995
|
+
- $ref: '#/components/schemas/trendingFacetsQuery'
|
|
1996
|
+
- $ref: '#/components/schemas/lookingSimilarQuery'
|
|
1997
|
+
- $ref: '#/components/schemas/recommendedForYouQuery'
|
|
1998
|
+
processingTimeMS:
|
|
1999
|
+
type: integer
|
|
2000
|
+
description: Time the server took to process the request, in milliseconds.
|
|
2001
|
+
example: 20
|
|
2002
|
+
RedirectRuleIndexMetadata:
|
|
2003
|
+
type: object
|
|
2004
|
+
properties:
|
|
2005
|
+
source:
|
|
2006
|
+
type: string
|
|
2007
|
+
description: Source index for the redirect rule.
|
|
2008
|
+
dest:
|
|
2009
|
+
type: string
|
|
2010
|
+
description: Destination index for the redirect rule.
|
|
2011
|
+
reason:
|
|
2012
|
+
type: string
|
|
2013
|
+
description: Reason for the redirect rule.
|
|
2014
|
+
succeed:
|
|
2015
|
+
type: boolean
|
|
2016
|
+
description: Redirect rule status.
|
|
2017
|
+
data:
|
|
2018
|
+
title: redirectRuleIndexData
|
|
2019
|
+
type: object
|
|
2020
|
+
description: Redirect rule data.
|
|
2021
|
+
required:
|
|
2022
|
+
- ruleObjectID
|
|
2023
|
+
properties:
|
|
2024
|
+
ruleObjectID:
|
|
2025
|
+
type: string
|
|
2026
|
+
required:
|
|
2027
|
+
- data
|
|
2028
|
+
- succeed
|
|
2029
|
+
- reason
|
|
2030
|
+
- dest
|
|
2031
|
+
- source
|
|
2032
|
+
userData:
|
|
2033
|
+
type: object
|
|
2034
|
+
example:
|
|
2035
|
+
settingID: f2a7b51e3503acc6a39b3784ffb84300
|
|
2036
|
+
pluginVersion: 1.6.0
|
|
2037
|
+
description: |
|
|
2038
|
+
An object with custom data.
|
|
2039
|
+
|
|
2040
|
+
You can store up to 32kB as custom data.
|
|
2041
|
+
x-categories:
|
|
2042
|
+
- Advanced
|
|
2043
|
+
baseSearchResponse:
|
|
2044
|
+
type: object
|
|
2045
|
+
additionalProperties: true
|
|
2046
|
+
required:
|
|
2047
|
+
- processingTimeMS
|
|
2048
|
+
properties:
|
|
2049
|
+
abTestID:
|
|
2050
|
+
type: integer
|
|
2051
|
+
description: >-
|
|
2052
|
+
A/B test ID. This is only included in the response for indices that are part of an A/B test.
|
|
2053
|
+
|
|
2054
|
+
abTestVariantID:
|
|
2055
|
+
type: integer
|
|
2056
|
+
minimum: 1
|
|
2057
|
+
description: >-
|
|
2058
|
+
Variant ID. This is only included in the response for indices that are part of an A/B test.
|
|
2059
|
+
|
|
2060
|
+
aroundLatLng:
|
|
2061
|
+
type: string
|
|
2062
|
+
description: Computed geographical location.
|
|
2063
|
+
example: 40.71,-74.01
|
|
2064
|
+
pattern: ^(-?\d+(\.\d+)?),\s*(-?\d+(\.\d+)?)$
|
|
2065
|
+
automaticRadius:
|
|
2066
|
+
type: string
|
|
2067
|
+
description: Distance from a central coordinate provided by `aroundLatLng`.
|
|
2068
|
+
exhaustive:
|
|
2069
|
+
title: exhaustive
|
|
2070
|
+
type: object
|
|
2071
|
+
description: >-
|
|
2072
|
+
Whether certain properties of the search response are calculated exhaustive (exact) or approximated.
|
|
2073
|
+
|
|
2074
|
+
properties:
|
|
2075
|
+
facetsCount:
|
|
2076
|
+
type: boolean
|
|
2077
|
+
title: facetsCount
|
|
2078
|
+
description: >-
|
|
2079
|
+
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-).
|
|
2080
|
+
|
|
2081
|
+
facetValues:
|
|
2082
|
+
type: boolean
|
|
2083
|
+
title: facetValues
|
|
2084
|
+
description: The value is `false` if not all facet values are retrieved.
|
|
2085
|
+
nbHits:
|
|
2086
|
+
type: boolean
|
|
2087
|
+
title: nbHits
|
|
2088
|
+
description: >-
|
|
2089
|
+
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.
|
|
2090
|
+
|
|
2091
|
+
rulesMatch:
|
|
2092
|
+
type: boolean
|
|
2093
|
+
title: rulesMatch
|
|
2094
|
+
description: >-
|
|
2095
|
+
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.
|
|
2096
|
+
|
|
2097
|
+
typo:
|
|
2098
|
+
type: boolean
|
|
2099
|
+
title: typo
|
|
2100
|
+
description: >-
|
|
2101
|
+
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.
|
|
2102
|
+
|
|
2103
|
+
exhaustiveFacetsCount:
|
|
2104
|
+
type: boolean
|
|
2105
|
+
description: >-
|
|
2106
|
+
See the `facetsCount` field of the `exhaustive` object in the response.
|
|
2107
|
+
|
|
2108
|
+
deprecated: true
|
|
2109
|
+
exhaustiveNbHits:
|
|
2110
|
+
type: boolean
|
|
2111
|
+
description: See the `nbHits` field of the `exhaustive` object in the response.
|
|
2112
|
+
deprecated: true
|
|
2113
|
+
exhaustiveTypo:
|
|
2114
|
+
type: boolean
|
|
2115
|
+
description: See the `typo` field of the `exhaustive` object in the response.
|
|
2116
|
+
deprecated: true
|
|
2117
|
+
facets:
|
|
2118
|
+
title: facets
|
|
2119
|
+
type: object
|
|
2120
|
+
additionalProperties:
|
|
2121
|
+
x-additionalPropertiesName: facet
|
|
2122
|
+
type: object
|
|
2123
|
+
additionalProperties:
|
|
2124
|
+
x-additionalPropertiesName: facet count
|
|
2125
|
+
type: integer
|
|
2126
|
+
description: Facet counts.
|
|
2127
|
+
facets_stats:
|
|
2128
|
+
type: object
|
|
2129
|
+
description: Statistics for numerical facets.
|
|
2130
|
+
additionalProperties:
|
|
2131
|
+
title: facetStats
|
|
2132
|
+
type: object
|
|
2133
|
+
properties:
|
|
2134
|
+
min:
|
|
2135
|
+
type: number
|
|
2136
|
+
format: double
|
|
2137
|
+
description: Minimum value in the results.
|
|
2138
|
+
max:
|
|
2139
|
+
type: number
|
|
2140
|
+
format: double
|
|
2141
|
+
description: Maximum value in the results.
|
|
2142
|
+
avg:
|
|
2143
|
+
type: number
|
|
2144
|
+
format: double
|
|
2145
|
+
description: Average facet value in the results.
|
|
2146
|
+
sum:
|
|
2147
|
+
type: number
|
|
2148
|
+
format: double
|
|
2149
|
+
description: Sum of all values in the results.
|
|
2150
|
+
index:
|
|
2151
|
+
type: string
|
|
2152
|
+
example: indexName
|
|
2153
|
+
description: Index name used for the query.
|
|
2154
|
+
indexUsed:
|
|
2155
|
+
type: string
|
|
2156
|
+
description: >-
|
|
2157
|
+
Index name used for the query. During A/B testing, the targeted index isn't always the index used by the query.
|
|
2158
|
+
|
|
2159
|
+
example: indexNameAlt
|
|
2160
|
+
message:
|
|
2161
|
+
type: string
|
|
2162
|
+
description: Warnings about the query.
|
|
2163
|
+
nbSortedHits:
|
|
2164
|
+
type: integer
|
|
2165
|
+
description: Number of hits selected and sorted by the relevant sort algorithm.
|
|
2166
|
+
example: 20
|
|
2167
|
+
parsedQuery:
|
|
2168
|
+
type: string
|
|
2169
|
+
description: >-
|
|
2170
|
+
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.
|
|
2171
|
+
|
|
2172
|
+
example: george clo
|
|
2173
|
+
processingTimeMS:
|
|
2174
|
+
$ref: '#/components/schemas/processingTimeMS'
|
|
2175
|
+
processingTimingsMS:
|
|
2176
|
+
type: object
|
|
2177
|
+
description: >-
|
|
2178
|
+
Experimental. List of processing steps and their times, in milliseconds. You can use this list to investigate performance issues.
|
|
2179
|
+
|
|
2180
|
+
queryAfterRemoval:
|
|
2181
|
+
type: string
|
|
2182
|
+
description: >-
|
|
2183
|
+
Markup text indicating which parts of the original query have been removed to retrieve a non-empty result set.
|
|
2184
|
+
|
|
2185
|
+
redirect:
|
|
2186
|
+
title: redirect
|
|
2187
|
+
type: object
|
|
2188
|
+
description: >
|
|
2189
|
+
[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.
|
|
2190
|
+
|
|
2191
|
+
properties:
|
|
2192
|
+
index:
|
|
2193
|
+
type: array
|
|
2194
|
+
items:
|
|
2195
|
+
$ref: '#/components/schemas/RedirectRuleIndexMetadata'
|
|
2196
|
+
renderingContent:
|
|
2197
|
+
$ref: '#/components/schemas/renderingContent'
|
|
2198
|
+
serverTimeMS:
|
|
2199
|
+
type: integer
|
|
2200
|
+
description: Time the server took to process the request, in milliseconds.
|
|
2201
|
+
example: 20
|
|
2202
|
+
serverUsed:
|
|
2203
|
+
type: string
|
|
2204
|
+
description: Host name of the server that processed the request.
|
|
2205
|
+
example: c2-uk-3.algolia.net
|
|
2206
|
+
userData:
|
|
2207
|
+
$ref: '#/components/schemas/userData'
|
|
2208
|
+
queryID:
|
|
2209
|
+
type: string
|
|
2210
|
+
description: >-
|
|
2211
|
+
Unique identifier for the query. This is used for [click analytics](https://www.algolia.com/doc/guides/analytics/click-analytics/).
|
|
2212
|
+
|
|
2213
|
+
example: a00dbc80a8d13c4565a442e7e2dca80a
|
|
2214
|
+
_automaticInsights:
|
|
2215
|
+
type: boolean
|
|
2216
|
+
description: Whether automatic events collection is enabled for the application.
|
|
2217
|
+
nbHits:
|
|
2218
|
+
type: integer
|
|
2219
|
+
description: Number of results (hits).
|
|
2220
|
+
example: 20
|
|
2221
|
+
nbPages:
|
|
2222
|
+
type: integer
|
|
2223
|
+
description: Number of pages of results.
|
|
2224
|
+
example: 1
|
|
2225
|
+
SearchPagination:
|
|
2226
|
+
type: object
|
|
2227
|
+
additionalProperties: false
|
|
2228
|
+
properties:
|
|
2229
|
+
page:
|
|
2230
|
+
$ref: '#/components/schemas/page'
|
|
2231
|
+
nbHits:
|
|
2232
|
+
$ref: '#/components/schemas/nbHits'
|
|
2233
|
+
nbPages:
|
|
2234
|
+
$ref: '#/components/schemas/nbPages'
|
|
2235
|
+
hitsPerPage:
|
|
2236
|
+
$ref: '#/components/schemas/hitsPerPage'
|
|
2237
|
+
required:
|
|
2238
|
+
- page
|
|
2239
|
+
- nbHits
|
|
2240
|
+
- nbPages
|
|
2241
|
+
- hitsPerPage
|
|
2242
|
+
highlightResultMap:
|
|
2243
|
+
type: object
|
|
2244
|
+
description: Surround words that match the query with HTML tags for highlighting.
|
|
2245
|
+
additionalProperties:
|
|
2246
|
+
x-additionalPropertiesName: attribute
|
|
2247
|
+
$ref: '#/components/schemas/highlightResult'
|
|
2248
|
+
highlightedValue:
|
|
2249
|
+
type: string
|
|
2250
|
+
description: Highlighted attribute value, including HTML tags.
|
|
2251
|
+
example: <em>George</em> <em>Clo</em>oney
|
|
2252
|
+
matchLevel:
|
|
2253
|
+
type: string
|
|
2254
|
+
description: Whether the whole query string matches or only a part.
|
|
2255
|
+
enum:
|
|
2256
|
+
- none
|
|
2257
|
+
- partial
|
|
2258
|
+
- full
|
|
2259
|
+
highlightResultOption:
|
|
2260
|
+
type: object
|
|
2261
|
+
description: Surround words that match the query with HTML tags for highlighting.
|
|
2262
|
+
additionalProperties: false
|
|
2263
|
+
properties:
|
|
2264
|
+
value:
|
|
2265
|
+
$ref: '#/components/schemas/highlightedValue'
|
|
2266
|
+
matchLevel:
|
|
2267
|
+
$ref: '#/components/schemas/matchLevel'
|
|
2268
|
+
matchedWords:
|
|
2269
|
+
type: array
|
|
2270
|
+
description: List of matched words from the search query.
|
|
2271
|
+
example:
|
|
2272
|
+
- action
|
|
2273
|
+
items:
|
|
2274
|
+
type: string
|
|
2275
|
+
fullyHighlighted:
|
|
2276
|
+
type: boolean
|
|
2277
|
+
description: Whether the entire attribute value is highlighted.
|
|
2278
|
+
required:
|
|
2279
|
+
- value
|
|
2280
|
+
- matchLevel
|
|
2281
|
+
- matchedWords
|
|
2282
|
+
x-discriminator-fields:
|
|
2283
|
+
- matchLevel
|
|
2284
|
+
- matchedWords
|
|
2285
|
+
highlightResultOptionMap:
|
|
2286
|
+
type: object
|
|
2287
|
+
description: Surround words that match the query with HTML tags for highlighting.
|
|
2288
|
+
additionalProperties:
|
|
2289
|
+
x-additionalPropertiesName: attribute
|
|
2290
|
+
$ref: '#/components/schemas/highlightResultOption'
|
|
2291
|
+
highlightResultOptionArray:
|
|
2292
|
+
type: array
|
|
2293
|
+
description: Surround words that match the query with HTML tags for highlighting.
|
|
2294
|
+
items:
|
|
2295
|
+
$ref: '#/components/schemas/highlightResultOption'
|
|
2296
|
+
highlightResult:
|
|
2297
|
+
oneOf:
|
|
2298
|
+
- $ref: '#/components/schemas/highlightResultMap'
|
|
2299
|
+
- $ref: '#/components/schemas/highlightResultOption'
|
|
2300
|
+
- $ref: '#/components/schemas/highlightResultOptionMap'
|
|
2301
|
+
- $ref: '#/components/schemas/highlightResultOptionArray'
|
|
2302
|
+
snippetResultMap:
|
|
2303
|
+
type: object
|
|
2304
|
+
description: Snippets that show the context around a matching search query.
|
|
2305
|
+
additionalProperties:
|
|
2306
|
+
x-additionalPropertiesName: attribute
|
|
2307
|
+
$ref: '#/components/schemas/snippetResult'
|
|
2308
|
+
snippetResultOption:
|
|
2309
|
+
type: object
|
|
2310
|
+
description: Snippets that show the context around a matching search query.
|
|
2311
|
+
additionalProperties: false
|
|
2312
|
+
properties:
|
|
2313
|
+
value:
|
|
2314
|
+
$ref: '#/components/schemas/highlightedValue'
|
|
2315
|
+
matchLevel:
|
|
2316
|
+
$ref: '#/components/schemas/matchLevel'
|
|
2317
|
+
required:
|
|
2318
|
+
- value
|
|
2319
|
+
- matchLevel
|
|
2320
|
+
x-discriminator-fields:
|
|
2321
|
+
- matchLevel
|
|
2322
|
+
snippetResultOptionMap:
|
|
2323
|
+
type: object
|
|
2324
|
+
description: Snippets that show the context around a matching search query.
|
|
2325
|
+
additionalProperties:
|
|
2326
|
+
x-additionalPropertiesName: attribute
|
|
2327
|
+
$ref: '#/components/schemas/snippetResultOption'
|
|
2328
|
+
snippetResultOptionArray:
|
|
2329
|
+
type: array
|
|
2330
|
+
description: Snippets that show the context around a matching search query.
|
|
2331
|
+
items:
|
|
2332
|
+
$ref: '#/components/schemas/snippetResultOption'
|
|
2333
|
+
snippetResult:
|
|
2334
|
+
oneOf:
|
|
2335
|
+
- $ref: '#/components/schemas/snippetResultMap'
|
|
2336
|
+
- $ref: '#/components/schemas/snippetResultOption'
|
|
2337
|
+
- $ref: '#/components/schemas/snippetResultOptionMap'
|
|
2338
|
+
- $ref: '#/components/schemas/snippetResultOptionArray'
|
|
2339
|
+
matchedGeoLocation:
|
|
2340
|
+
type: object
|
|
2341
|
+
properties:
|
|
2342
|
+
lat:
|
|
2343
|
+
type: number
|
|
2344
|
+
format: double
|
|
2345
|
+
description: Latitude of the matched location.
|
|
2346
|
+
lng:
|
|
2347
|
+
type: number
|
|
2348
|
+
format: double
|
|
2349
|
+
description: Longitude of the matched location.
|
|
2350
|
+
distance:
|
|
2351
|
+
type: integer
|
|
2352
|
+
description: >-
|
|
2353
|
+
Distance between the matched location and the search location (in meters).
|
|
2354
|
+
|
|
2355
|
+
personalization:
|
|
2356
|
+
type: object
|
|
2357
|
+
properties:
|
|
2358
|
+
filtersScore:
|
|
2359
|
+
type: integer
|
|
2360
|
+
description: The score of the filters.
|
|
2361
|
+
rankingScore:
|
|
2362
|
+
type: integer
|
|
2363
|
+
description: The score of the ranking.
|
|
2364
|
+
score:
|
|
2365
|
+
type: integer
|
|
2366
|
+
description: The score of the event.
|
|
2367
|
+
rankingInfo:
|
|
2368
|
+
type: object
|
|
2369
|
+
description: Object with detailed information about the record's ranking.
|
|
2370
|
+
additionalProperties: false
|
|
2371
|
+
properties:
|
|
2372
|
+
filters:
|
|
2373
|
+
type: integer
|
|
2374
|
+
minimum: 0
|
|
2375
|
+
description: Whether a filter matched the query.
|
|
2376
|
+
firstMatchedWord:
|
|
2377
|
+
type: integer
|
|
2378
|
+
minimum: 0
|
|
2379
|
+
description: >-
|
|
2380
|
+
Position of the first matched word in the best matching attribute of the record.
|
|
2381
|
+
|
|
2382
|
+
geoDistance:
|
|
2383
|
+
type: integer
|
|
2384
|
+
minimum: 0
|
|
2385
|
+
description: >-
|
|
2386
|
+
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).
|
|
2387
|
+
|
|
2388
|
+
geoPrecision:
|
|
2389
|
+
type: integer
|
|
2390
|
+
minimum: 1
|
|
2391
|
+
description: Precision used when computing the geo distance, in meters.
|
|
2392
|
+
matchedGeoLocation:
|
|
2393
|
+
$ref: '#/components/schemas/matchedGeoLocation'
|
|
2394
|
+
personalization:
|
|
2395
|
+
$ref: '#/components/schemas/personalization'
|
|
2396
|
+
nbExactWords:
|
|
2397
|
+
type: integer
|
|
2398
|
+
minimum: 0
|
|
2399
|
+
description: Number of exactly matched words.
|
|
2400
|
+
nbTypos:
|
|
2401
|
+
type: integer
|
|
2402
|
+
minimum: 0
|
|
2403
|
+
description: Number of typos encountered when matching the record.
|
|
2404
|
+
promoted:
|
|
2405
|
+
type: boolean
|
|
2406
|
+
description: Whether the record was promoted by a rule.
|
|
2407
|
+
proximityDistance:
|
|
2408
|
+
type: integer
|
|
2409
|
+
minimum: 0
|
|
2410
|
+
description: >-
|
|
2411
|
+
Number of words between multiple matches in the query plus 1. For single word queries, `proximityDistance` is 0.
|
|
2412
|
+
|
|
2413
|
+
userScore:
|
|
2414
|
+
type: integer
|
|
2415
|
+
description: >-
|
|
2416
|
+
Overall ranking of the record, expressed as a single integer. This attribute is internal.
|
|
2417
|
+
|
|
2418
|
+
words:
|
|
2419
|
+
type: integer
|
|
2420
|
+
minimum: 1
|
|
2421
|
+
description: Number of matched words.
|
|
2422
|
+
promotedByReRanking:
|
|
2423
|
+
type: boolean
|
|
2424
|
+
description: Whether the record is re-ranked.
|
|
2425
|
+
required:
|
|
2426
|
+
- nbTypos
|
|
2427
|
+
- firstMatchedWord
|
|
2428
|
+
- geoDistance
|
|
2429
|
+
- nbExactWords
|
|
2430
|
+
- userScore
|
|
2431
|
+
distinctSeqID:
|
|
2432
|
+
type: integer
|
|
2433
|
+
recommendScore:
|
|
2434
|
+
type: number
|
|
2435
|
+
format: double
|
|
2436
|
+
minimum: 0
|
|
2437
|
+
maximum: 100
|
|
2438
|
+
description: Recommendation score.
|
|
2439
|
+
recommendHit:
|
|
2440
|
+
type: object
|
|
2441
|
+
description: Recommend hit.
|
|
2442
|
+
additionalProperties: true
|
|
2443
|
+
required:
|
|
2444
|
+
- objectID
|
|
2445
|
+
- _score
|
|
2446
|
+
properties:
|
|
2447
|
+
objectID:
|
|
2448
|
+
$ref: '#/components/schemas/objectID'
|
|
2449
|
+
_highlightResult:
|
|
2450
|
+
$ref: '#/components/schemas/highlightResultMap'
|
|
2451
|
+
_snippetResult:
|
|
2452
|
+
$ref: '#/components/schemas/snippetResultMap'
|
|
2453
|
+
_rankingInfo:
|
|
2454
|
+
$ref: '#/components/schemas/rankingInfo'
|
|
2455
|
+
_distinctSeqID:
|
|
2456
|
+
$ref: '#/components/schemas/distinctSeqID'
|
|
2457
|
+
_score:
|
|
2458
|
+
$ref: '#/components/schemas/recommendScore'
|
|
2459
|
+
trendingFacetHit:
|
|
2460
|
+
type: object
|
|
2461
|
+
description: Trending facet hit.
|
|
2462
|
+
required:
|
|
2463
|
+
- _score
|
|
2464
|
+
- facetName
|
|
2465
|
+
- facetValue
|
|
2466
|
+
properties:
|
|
2467
|
+
_score:
|
|
2468
|
+
$ref: '#/components/schemas/recommendScore'
|
|
2469
|
+
facetName:
|
|
2470
|
+
$ref: '#/components/schemas/facetName'
|
|
2471
|
+
facetValue:
|
|
2472
|
+
$ref: '#/components/schemas/facetValue'
|
|
2473
|
+
recommendationsHit:
|
|
2474
|
+
oneOf:
|
|
2475
|
+
- $ref: '#/components/schemas/recommendHit'
|
|
2476
|
+
- $ref: '#/components/schemas/trendingFacetHit'
|
|
2477
|
+
recommendationsHits:
|
|
2478
|
+
type: object
|
|
2479
|
+
additionalProperties: false
|
|
2480
|
+
properties:
|
|
2481
|
+
hits:
|
|
2482
|
+
type: array
|
|
2483
|
+
items:
|
|
2484
|
+
$ref: '#/components/schemas/recommendationsHit'
|
|
2485
|
+
required:
|
|
2486
|
+
- hits
|
|
2487
|
+
recommendationsResults:
|
|
2488
|
+
allOf:
|
|
2489
|
+
- $ref: '#/components/schemas/baseSearchResponse'
|
|
2490
|
+
- $ref: '#/components/schemas/SearchPagination'
|
|
2491
|
+
- $ref: '#/components/schemas/recommendationsHits'
|
|
2492
|
+
recommendModels:
|
|
2493
|
+
type: string
|
|
2494
|
+
enum:
|
|
2495
|
+
- related-products
|
|
2496
|
+
- bought-together
|
|
2497
|
+
- trending-facets
|
|
2498
|
+
- trending-items
|
|
2499
|
+
updatedAt:
|
|
2500
|
+
type: string
|
|
2501
|
+
example: '2023-07-04T12:49:15Z'
|
|
2502
|
+
description: Date and time when the object was updated, in RFC 3339 format.
|
|
2503
|
+
ruleID:
|
|
2504
|
+
title: objectID
|
|
2505
|
+
type: string
|
|
2506
|
+
description: Unique identifier of a rule object.
|
|
2507
|
+
context:
|
|
2508
|
+
type: string
|
|
2509
|
+
pattern: '[A-Za-z0-9_-]+'
|
|
2510
|
+
description: >
|
|
2511
|
+
An additional restriction that only triggers the rule, when the search has the same value as `ruleContexts` parameter.
|
|
2512
|
+
|
|
2513
|
+
For example, if `context: mobile`, the rule is only triggered when the search request has a matching `ruleContexts: mobile`.
|
|
2514
|
+
|
|
2515
|
+
A rule context must only contain alphanumeric characters.
|
|
2516
|
+
|
|
2517
|
+
example: mobile
|
|
2518
|
+
Condition:
|
|
2519
|
+
type: object
|
|
2520
|
+
description: |
|
|
2521
|
+
Condition that triggers the rule.
|
|
2522
|
+
If not specified, the rule is triggered for all recommendations.
|
|
2523
|
+
properties:
|
|
2524
|
+
filters:
|
|
2525
|
+
$ref: '#/components/schemas/filters'
|
|
2526
|
+
context:
|
|
2527
|
+
$ref: '#/components/schemas/context'
|
|
2528
|
+
HideConsequenceObject:
|
|
2529
|
+
type: object
|
|
2530
|
+
description: Object ID of the recommendation you want to exclude.
|
|
2531
|
+
properties:
|
|
2532
|
+
objectID:
|
|
2533
|
+
$ref: '#/components/schemas/objectID'
|
|
2534
|
+
HideConsequence:
|
|
2535
|
+
type: array
|
|
2536
|
+
description: Exclude items from recommendations.
|
|
2537
|
+
minItems: 1
|
|
2538
|
+
items:
|
|
2539
|
+
$ref: '#/components/schemas/HideConsequenceObject'
|
|
2540
|
+
PromoteConsequenceObject:
|
|
2541
|
+
type: object
|
|
2542
|
+
description: Object ID and position of the recommendation you want to pin.
|
|
2543
|
+
properties:
|
|
2544
|
+
objectID:
|
|
2545
|
+
$ref: '#/components/schemas/objectID'
|
|
2546
|
+
position:
|
|
2547
|
+
type: integer
|
|
2548
|
+
description: Index in the list of recommendations where to place this item.
|
|
2549
|
+
minimum: 0
|
|
2550
|
+
PromoteConsequence:
|
|
2551
|
+
type: array
|
|
2552
|
+
description: Place items at specific positions in the list of recommendations.
|
|
2553
|
+
minItems: 1
|
|
2554
|
+
items:
|
|
2555
|
+
$ref: '#/components/schemas/PromoteConsequenceObject'
|
|
2556
|
+
AutoFacetFilter:
|
|
2557
|
+
type: object
|
|
2558
|
+
description: >-
|
|
2559
|
+
Facet attribute. Only recommendations with the same value (or only recommendations with a different value) as the original viewed item are included.
|
|
2560
|
+
|
|
2561
|
+
properties:
|
|
2562
|
+
facet:
|
|
2563
|
+
type: string
|
|
2564
|
+
description: Facet attribute.
|
|
2565
|
+
negative:
|
|
2566
|
+
type: boolean
|
|
2567
|
+
description: >
|
|
2568
|
+
Whether the filter is negative.
|
|
2569
|
+
|
|
2570
|
+
If true, recommendations must not have the same value for the `facet` attribute.
|
|
2571
|
+
|
|
2572
|
+
If false, recommendations must have the same value for the `facet` attribute.
|
|
2573
|
+
|
|
2574
|
+
ParamsConsequence:
|
|
2575
|
+
type: object
|
|
2576
|
+
description: Filter or boost recommendations matching a facet filter.
|
|
2577
|
+
properties:
|
|
2578
|
+
automaticFacetFilters:
|
|
2579
|
+
type: array
|
|
2580
|
+
description: >-
|
|
2581
|
+
Filter recommendations that match or don't match the same `facet:facet_value` combination as the viewed item.
|
|
2582
|
+
|
|
2583
|
+
items:
|
|
2584
|
+
$ref: '#/components/schemas/AutoFacetFilter'
|
|
2585
|
+
filters:
|
|
2586
|
+
$ref: '#/components/schemas/filters'
|
|
2587
|
+
optionalFilters:
|
|
2588
|
+
type: array
|
|
2589
|
+
description: >
|
|
2590
|
+
Filters to promote or demote records in the search results.
|
|
2591
|
+
|
|
2592
|
+
|
|
2593
|
+
Optional filters work like facet filters, but they don't exclude records from the search results.
|
|
2594
|
+
|
|
2595
|
+
Records that match the optional filter rank before records that don't match.
|
|
2596
|
+
|
|
2597
|
+
Matches with higher weights (`<score=N>`) rank before matches with lower weights.
|
|
2598
|
+
|
|
2599
|
+
If you're using a negative filter `facet:-value`, matching records rank after records that don't match.
|
|
2600
|
+
|
|
2601
|
+
items:
|
|
2602
|
+
type: string
|
|
2603
|
+
example:
|
|
2604
|
+
- category:books<score=1>
|
|
2605
|
+
- category:-movies<score=1>
|
|
2606
|
+
Consequence:
|
|
2607
|
+
type: object
|
|
2608
|
+
description: Effect of the rule.
|
|
2609
|
+
properties:
|
|
2610
|
+
hide:
|
|
2611
|
+
$ref: '#/components/schemas/HideConsequence'
|
|
2612
|
+
promote:
|
|
2613
|
+
$ref: '#/components/schemas/PromoteConsequence'
|
|
2614
|
+
params:
|
|
2615
|
+
$ref: '#/components/schemas/ParamsConsequence'
|
|
2616
|
+
RecommendRule:
|
|
2617
|
+
type: object
|
|
2618
|
+
description: Recommend rule.
|
|
2619
|
+
additionalProperties: false
|
|
2620
|
+
properties:
|
|
2621
|
+
_metadata:
|
|
2622
|
+
title: ruleMetadata
|
|
2623
|
+
type: object
|
|
2624
|
+
description: Rule metadata.
|
|
2625
|
+
properties:
|
|
2626
|
+
lastUpdate:
|
|
2627
|
+
$ref: '#/components/schemas/updatedAt'
|
|
2628
|
+
objectID:
|
|
2629
|
+
$ref: '#/components/schemas/ruleID'
|
|
2630
|
+
condition:
|
|
2631
|
+
$ref: '#/components/schemas/Condition'
|
|
2632
|
+
consequence:
|
|
2633
|
+
$ref: '#/components/schemas/Consequence'
|
|
2634
|
+
description:
|
|
2635
|
+
type: string
|
|
2636
|
+
description: >-
|
|
2637
|
+
Description of the rule's purpose. This can be helpful for display in the Algolia dashboard.
|
|
2638
|
+
|
|
2639
|
+
example: Display a promotional banner
|
|
2640
|
+
enabled:
|
|
2641
|
+
type: boolean
|
|
2642
|
+
description: >-
|
|
2643
|
+
Indicates whether to enable the rule. If it isn't enabled, it isn't applied at query time.
|
|
2644
|
+
|
|
2645
|
+
taskID:
|
|
2646
|
+
type: integer
|
|
2647
|
+
format: int64
|
|
2648
|
+
example: 1514562690001
|
|
2649
|
+
description: >
|
|
2650
|
+
Unique identifier of a task.
|
|
2651
|
+
|
|
2652
|
+
|
|
2653
|
+
A successful API response means that a task was added to a queue. It might not run immediately. You can check the task's progress with the [`task` operation](#tag/Indices/operation/getTask) and this `taskID`.
|
|
2654
|
+
|
|
2655
|
+
deletedAt:
|
|
2656
|
+
type: string
|
|
2657
|
+
example: '2023-06-27T14:42:38.831Z'
|
|
2658
|
+
description: Date and time when the object was deleted, in RFC 3339 format.
|
|
2659
|
+
taskStatus:
|
|
2660
|
+
type: string
|
|
2661
|
+
enum:
|
|
2662
|
+
- published
|
|
2663
|
+
- notPublished
|
|
2664
|
+
description: >-
|
|
2665
|
+
Task status, `published` if the task is completed, `notPublished` otherwise.
|
|
2666
|
+
|
|
2667
|
+
parameters_query:
|
|
2668
|
+
type: string
|
|
2669
|
+
description: Search query.
|
|
2670
|
+
parameters_page:
|
|
2671
|
+
type: integer
|
|
2672
|
+
minimum: 0
|
|
2673
|
+
description: Requested page of the API response.
|
|
2674
|
+
parameters_hitsPerPage:
|
|
2675
|
+
type: integer
|
|
2676
|
+
minimum: 1
|
|
2677
|
+
maximum: 1000
|
|
2678
|
+
description: Maximum number of hits per page.
|
|
2679
|
+
responses:
|
|
2680
|
+
BadRequest:
|
|
2681
|
+
description: Bad request or request arguments.
|
|
2682
|
+
content:
|
|
2683
|
+
application/json:
|
|
2684
|
+
schema:
|
|
2685
|
+
$ref: '#/components/schemas/ErrorBase'
|
|
2686
|
+
FeatureNotEnabled:
|
|
2687
|
+
description: This feature is not enabled on your Algolia account.
|
|
2688
|
+
content:
|
|
2689
|
+
application/json:
|
|
2690
|
+
schema:
|
|
2691
|
+
$ref: '#/components/schemas/ErrorBase'
|
|
2692
|
+
MethodNotAllowed:
|
|
2693
|
+
description: Method not allowed with this API key.
|
|
2694
|
+
content:
|
|
2695
|
+
application/json:
|
|
2696
|
+
schema:
|
|
2697
|
+
$ref: '#/components/schemas/ErrorBase'
|
|
2698
|
+
IndexNotFound:
|
|
2699
|
+
description: Index not found.
|
|
2700
|
+
content:
|
|
2701
|
+
application/json:
|
|
2702
|
+
schema:
|
|
2703
|
+
$ref: '#/components/schemas/ErrorBase'
|
|
2704
|
+
DeletedAt:
|
|
2705
|
+
description: OK
|
|
2706
|
+
content:
|
|
2707
|
+
application/json:
|
|
2708
|
+
schema:
|
|
2709
|
+
title: deletedAtResponse
|
|
2710
|
+
description: Response, taskID, and deletion timestamp.
|
|
2711
|
+
additionalProperties: false
|
|
2712
|
+
type: object
|
|
2713
|
+
required:
|
|
2714
|
+
- taskID
|
|
2715
|
+
- deletedAt
|
|
2716
|
+
properties:
|
|
2717
|
+
taskID:
|
|
2718
|
+
$ref: '#/components/schemas/taskID'
|
|
2719
|
+
deletedAt:
|
|
2720
|
+
$ref: '#/components/schemas/deletedAt'
|