@algolia/recommend 5.6.1 → 5.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/dist/browser.d.ts +165 -109
- package/dist/builds/browser.js +32 -1
- package/dist/builds/browser.js.map +1 -1
- package/dist/builds/browser.min.js +1 -1
- package/dist/builds/browser.min.js.map +1 -1
- package/dist/builds/browser.umd.js +2 -2
- package/dist/builds/fetch.js +32 -1
- package/dist/builds/fetch.js.map +1 -1
- package/dist/builds/node.cjs +32 -1
- package/dist/builds/node.cjs.map +1 -1
- package/dist/builds/node.js +32 -1
- package/dist/builds/node.js.map +1 -1
- package/dist/fetch.d.ts +165 -109
- package/dist/node.d.cts +165 -109
- package/dist/node.d.ts +165 -109
- package/dist/src/recommendClient.cjs +32 -1
- package/dist/src/recommendClient.cjs.map +1 -1
- package/dist/src/recommendClient.js +32 -1
- package/dist/src/recommendClient.js.map +1 -1
- package/model/clientMethodProps.ts +16 -0
- package/model/index.ts +2 -0
- package/model/recommendRule.ts +6 -0
- package/model/recommendUpdatedAtResponse.ts +16 -0
- package/model/timeRange.ts +13 -0
- package/package.json +7 -7
package/dist/fetch.d.ts
CHANGED
|
@@ -3,6 +3,137 @@ import { CreateClientOptions, RequestOptions, ClientOptions } from '@algolia/cli
|
|
|
3
3
|
|
|
4
4
|
type RecommendModels = 'bought-together' | 'related-products' | 'trending-facets' | 'trending-items';
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* Condition that triggers the rule. If not specified, the rule is triggered for all recommendations.
|
|
8
|
+
*/
|
|
9
|
+
type Condition = {
|
|
10
|
+
/**
|
|
11
|
+
* Filter expression to only include items that match the filter criteria in the response. You can use these filter expressions: - **Numeric filters.** `<facet> <op> <number>`, where `<op>` is one of `<`, `<=`, `=`, `!=`, `>`, `>=`. - **Ranges.** `<facet>:<lower> TO <upper>` where `<lower>` and `<upper>` are the lower and upper limits of the range (inclusive). - **Facet filters.** `<facet>:<value>` where `<facet>` is a facet attribute (case-sensitive) and `<value>` a facet value. - **Tag filters.** `_tags:<value>` or just `<value>` (case-sensitive). - **Boolean filters.** `<facet>: true | false`. You can combine filters with `AND`, `OR`, and `NOT` operators with the following restrictions: - You can only combine filters of the same type with `OR`. **Not supported:** `facet:value OR num > 3`. - You can\'t use `NOT` with combinations of filters. **Not supported:** `NOT(facet:value OR facet:value)` - You can\'t combine conjunctions (`AND`) with `OR`. **Not supported:** `facet:value OR (facet:value AND facet:value)` Use quotes around your filters, if the facet attribute name or facet value has spaces, keywords (`OR`, `AND`, `NOT`), or quotes. If a facet attribute is an array, the filter matches if it matches at least one element of the array. For more information, see [Filters](https://www.algolia.com/doc/guides/managing-results/refine-results/filtering/).
|
|
12
|
+
*/
|
|
13
|
+
filters?: string;
|
|
14
|
+
/**
|
|
15
|
+
* An additional restriction that only triggers the rule, when the search has the same value as `ruleContexts` parameter. For example, if `context: mobile`, the rule is only triggered when the search request has a matching `ruleContexts: mobile`. A rule context must only contain alphanumeric characters.
|
|
16
|
+
*/
|
|
17
|
+
context?: string;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Object ID of the recommendation you want to exclude.
|
|
22
|
+
*/
|
|
23
|
+
type HideConsequenceObject = {
|
|
24
|
+
/**
|
|
25
|
+
* Unique record identifier.
|
|
26
|
+
*/
|
|
27
|
+
objectID?: string;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Facet attribute. Only recommendations with the same value (or only recommendations with a different value) as the original viewed item are included.
|
|
32
|
+
*/
|
|
33
|
+
type AutoFacetFilter = {
|
|
34
|
+
/**
|
|
35
|
+
* Facet attribute.
|
|
36
|
+
*/
|
|
37
|
+
facet?: string;
|
|
38
|
+
/**
|
|
39
|
+
* Whether the filter is negative. If true, recommendations must not have the same value for the `facet` attribute. If false, recommendations must have the same value for the `facet` attribute.
|
|
40
|
+
*/
|
|
41
|
+
negative?: boolean;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Filter or boost recommendations matching a facet filter.
|
|
46
|
+
*/
|
|
47
|
+
type ParamsConsequence = {
|
|
48
|
+
/**
|
|
49
|
+
* Filter recommendations that match or don\'t match the same `facet:facet_value` combination as the viewed item.
|
|
50
|
+
*/
|
|
51
|
+
automaticFacetFilters?: AutoFacetFilter[];
|
|
52
|
+
/**
|
|
53
|
+
* Filter expression to only include items that match the filter criteria in the response. You can use these filter expressions: - **Numeric filters.** `<facet> <op> <number>`, where `<op>` is one of `<`, `<=`, `=`, `!=`, `>`, `>=`. - **Ranges.** `<facet>:<lower> TO <upper>` where `<lower>` and `<upper>` are the lower and upper limits of the range (inclusive). - **Facet filters.** `<facet>:<value>` where `<facet>` is a facet attribute (case-sensitive) and `<value>` a facet value. - **Tag filters.** `_tags:<value>` or just `<value>` (case-sensitive). - **Boolean filters.** `<facet>: true | false`. You can combine filters with `AND`, `OR`, and `NOT` operators with the following restrictions: - You can only combine filters of the same type with `OR`. **Not supported:** `facet:value OR num > 3`. - You can\'t use `NOT` with combinations of filters. **Not supported:** `NOT(facet:value OR facet:value)` - You can\'t combine conjunctions (`AND`) with `OR`. **Not supported:** `facet:value OR (facet:value AND facet:value)` Use quotes around your filters, if the facet attribute name or facet value has spaces, keywords (`OR`, `AND`, `NOT`), or quotes. If a facet attribute is an array, the filter matches if it matches at least one element of the array. For more information, see [Filters](https://www.algolia.com/doc/guides/managing-results/refine-results/filtering/).
|
|
54
|
+
*/
|
|
55
|
+
filters?: string;
|
|
56
|
+
/**
|
|
57
|
+
* Filters to promote or demote records in the search results. Optional filters work like facet filters, but they don\'t exclude records from the search results. Records that match the optional filter rank before records that don\'t match. Matches with higher weights (`<score=N>`) rank before matches with lower weights. If you\'re using a negative filter `facet:-value`, matching records rank after records that don\'t match.
|
|
58
|
+
*/
|
|
59
|
+
optionalFilters?: string[];
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Object ID and position of the recommendation you want to pin.
|
|
64
|
+
*/
|
|
65
|
+
type PromoteConsequenceObject = {
|
|
66
|
+
/**
|
|
67
|
+
* Unique record identifier.
|
|
68
|
+
*/
|
|
69
|
+
objectID?: string;
|
|
70
|
+
/**
|
|
71
|
+
* Index in the list of recommendations where to place this item.
|
|
72
|
+
*/
|
|
73
|
+
position?: number;
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Effect of the rule.
|
|
78
|
+
*/
|
|
79
|
+
type Consequence = {
|
|
80
|
+
/**
|
|
81
|
+
* Exclude items from recommendations.
|
|
82
|
+
*/
|
|
83
|
+
hide?: HideConsequenceObject[];
|
|
84
|
+
/**
|
|
85
|
+
* Place items at specific positions in the list of recommendations.
|
|
86
|
+
*/
|
|
87
|
+
promote?: PromoteConsequenceObject[];
|
|
88
|
+
params?: ParamsConsequence;
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Rule metadata.
|
|
93
|
+
*/
|
|
94
|
+
type RuleMetadata = {
|
|
95
|
+
/**
|
|
96
|
+
* Date and time when the object was updated, in RFC 3339 format.
|
|
97
|
+
*/
|
|
98
|
+
lastUpdate?: string;
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
type TimeRange = {
|
|
102
|
+
/**
|
|
103
|
+
* When the rule should start to be active, in Unix epoch time.
|
|
104
|
+
*/
|
|
105
|
+
from: number;
|
|
106
|
+
/**
|
|
107
|
+
* When the rule should stop to be active, in Unix epoch time.
|
|
108
|
+
*/
|
|
109
|
+
until: number;
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Recommend rule.
|
|
114
|
+
*/
|
|
115
|
+
type RecommendRule = {
|
|
116
|
+
_metadata?: RuleMetadata;
|
|
117
|
+
/**
|
|
118
|
+
* Unique identifier of a rule object.
|
|
119
|
+
*/
|
|
120
|
+
objectID?: string;
|
|
121
|
+
condition?: Condition;
|
|
122
|
+
consequence?: Consequence;
|
|
123
|
+
/**
|
|
124
|
+
* Description of the rule\'s purpose. This can be helpful for display in the Algolia dashboard.
|
|
125
|
+
*/
|
|
126
|
+
description?: string;
|
|
127
|
+
/**
|
|
128
|
+
* Indicates whether to enable the rule. If it isn\'t enabled, it isn\'t applied at query time.
|
|
129
|
+
*/
|
|
130
|
+
enabled?: boolean;
|
|
131
|
+
/**
|
|
132
|
+
* Time periods when the rule is active.
|
|
133
|
+
*/
|
|
134
|
+
validity?: TimeRange[];
|
|
135
|
+
};
|
|
136
|
+
|
|
6
137
|
/**
|
|
7
138
|
* Range object with lower and upper values in meters to define custom ranges.
|
|
8
139
|
*/
|
|
@@ -631,6 +762,20 @@ type SearchRecommendRulesParams = {
|
|
|
631
762
|
maxValuesPerFacet?: number;
|
|
632
763
|
};
|
|
633
764
|
|
|
765
|
+
/**
|
|
766
|
+
* Properties for the `batchRecommendRules` method.
|
|
767
|
+
*/
|
|
768
|
+
type BatchRecommendRulesProps = {
|
|
769
|
+
/**
|
|
770
|
+
* Name of the index on which to perform the operation.
|
|
771
|
+
*/
|
|
772
|
+
indexName: string;
|
|
773
|
+
/**
|
|
774
|
+
* [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
|
|
775
|
+
*/
|
|
776
|
+
model: RecommendModels;
|
|
777
|
+
recommendRule?: RecommendRule[];
|
|
778
|
+
};
|
|
634
779
|
/**
|
|
635
780
|
* Properties for the `customDelete` method.
|
|
636
781
|
*/
|
|
@@ -1168,119 +1313,17 @@ type GetRecommendationsResponse = {
|
|
|
1168
1313
|
};
|
|
1169
1314
|
|
|
1170
1315
|
/**
|
|
1171
|
-
*
|
|
1172
|
-
*/
|
|
1173
|
-
type Condition = {
|
|
1174
|
-
/**
|
|
1175
|
-
* Filter expression to only include items that match the filter criteria in the response. You can use these filter expressions: - **Numeric filters.** `<facet> <op> <number>`, where `<op>` is one of `<`, `<=`, `=`, `!=`, `>`, `>=`. - **Ranges.** `<facet>:<lower> TO <upper>` where `<lower>` and `<upper>` are the lower and upper limits of the range (inclusive). - **Facet filters.** `<facet>:<value>` where `<facet>` is a facet attribute (case-sensitive) and `<value>` a facet value. - **Tag filters.** `_tags:<value>` or just `<value>` (case-sensitive). - **Boolean filters.** `<facet>: true | false`. You can combine filters with `AND`, `OR`, and `NOT` operators with the following restrictions: - You can only combine filters of the same type with `OR`. **Not supported:** `facet:value OR num > 3`. - You can\'t use `NOT` with combinations of filters. **Not supported:** `NOT(facet:value OR facet:value)` - You can\'t combine conjunctions (`AND`) with `OR`. **Not supported:** `facet:value OR (facet:value AND facet:value)` Use quotes around your filters, if the facet attribute name or facet value has spaces, keywords (`OR`, `AND`, `NOT`), or quotes. If a facet attribute is an array, the filter matches if it matches at least one element of the array. For more information, see [Filters](https://www.algolia.com/doc/guides/managing-results/refine-results/filtering/).
|
|
1176
|
-
*/
|
|
1177
|
-
filters?: string;
|
|
1178
|
-
/**
|
|
1179
|
-
* An additional restriction that only triggers the rule, when the search has the same value as `ruleContexts` parameter. For example, if `context: mobile`, the rule is only triggered when the search request has a matching `ruleContexts: mobile`. A rule context must only contain alphanumeric characters.
|
|
1180
|
-
*/
|
|
1181
|
-
context?: string;
|
|
1182
|
-
};
|
|
1183
|
-
|
|
1184
|
-
/**
|
|
1185
|
-
* Object ID of the recommendation you want to exclude.
|
|
1316
|
+
* Response, taskID, and update timestamp.
|
|
1186
1317
|
*/
|
|
1187
|
-
type
|
|
1318
|
+
type RecommendUpdatedAtResponse = {
|
|
1188
1319
|
/**
|
|
1189
|
-
* Unique
|
|
1190
|
-
*/
|
|
1191
|
-
objectID?: string;
|
|
1192
|
-
};
|
|
1193
|
-
|
|
1194
|
-
/**
|
|
1195
|
-
* Facet attribute. Only recommendations with the same value (or only recommendations with a different value) as the original viewed item are included.
|
|
1196
|
-
*/
|
|
1197
|
-
type AutoFacetFilter = {
|
|
1198
|
-
/**
|
|
1199
|
-
* Facet attribute.
|
|
1200
|
-
*/
|
|
1201
|
-
facet?: string;
|
|
1202
|
-
/**
|
|
1203
|
-
* Whether the filter is negative. If true, recommendations must not have the same value for the `facet` attribute. If false, recommendations must have the same value for the `facet` attribute.
|
|
1204
|
-
*/
|
|
1205
|
-
negative?: boolean;
|
|
1206
|
-
};
|
|
1207
|
-
|
|
1208
|
-
/**
|
|
1209
|
-
* Filter or boost recommendations matching a facet filter.
|
|
1210
|
-
*/
|
|
1211
|
-
type ParamsConsequence = {
|
|
1212
|
-
/**
|
|
1213
|
-
* Filter recommendations that match or don\'t match the same `facet:facet_value` combination as the viewed item.
|
|
1214
|
-
*/
|
|
1215
|
-
automaticFacetFilters?: AutoFacetFilter[];
|
|
1216
|
-
/**
|
|
1217
|
-
* Filter expression to only include items that match the filter criteria in the response. You can use these filter expressions: - **Numeric filters.** `<facet> <op> <number>`, where `<op>` is one of `<`, `<=`, `=`, `!=`, `>`, `>=`. - **Ranges.** `<facet>:<lower> TO <upper>` where `<lower>` and `<upper>` are the lower and upper limits of the range (inclusive). - **Facet filters.** `<facet>:<value>` where `<facet>` is a facet attribute (case-sensitive) and `<value>` a facet value. - **Tag filters.** `_tags:<value>` or just `<value>` (case-sensitive). - **Boolean filters.** `<facet>: true | false`. You can combine filters with `AND`, `OR`, and `NOT` operators with the following restrictions: - You can only combine filters of the same type with `OR`. **Not supported:** `facet:value OR num > 3`. - You can\'t use `NOT` with combinations of filters. **Not supported:** `NOT(facet:value OR facet:value)` - You can\'t combine conjunctions (`AND`) with `OR`. **Not supported:** `facet:value OR (facet:value AND facet:value)` Use quotes around your filters, if the facet attribute name or facet value has spaces, keywords (`OR`, `AND`, `NOT`), or quotes. If a facet attribute is an array, the filter matches if it matches at least one element of the array. For more information, see [Filters](https://www.algolia.com/doc/guides/managing-results/refine-results/filtering/).
|
|
1218
|
-
*/
|
|
1219
|
-
filters?: string;
|
|
1220
|
-
/**
|
|
1221
|
-
* Filters to promote or demote records in the search results. Optional filters work like facet filters, but they don\'t exclude records from the search results. Records that match the optional filter rank before records that don\'t match. Matches with higher weights (`<score=N>`) rank before matches with lower weights. If you\'re using a negative filter `facet:-value`, matching records rank after records that don\'t match.
|
|
1222
|
-
*/
|
|
1223
|
-
optionalFilters?: string[];
|
|
1224
|
-
};
|
|
1225
|
-
|
|
1226
|
-
/**
|
|
1227
|
-
* Object ID and position of the recommendation you want to pin.
|
|
1228
|
-
*/
|
|
1229
|
-
type PromoteConsequenceObject = {
|
|
1230
|
-
/**
|
|
1231
|
-
* Unique record identifier.
|
|
1232
|
-
*/
|
|
1233
|
-
objectID?: string;
|
|
1234
|
-
/**
|
|
1235
|
-
* Index in the list of recommendations where to place this item.
|
|
1236
|
-
*/
|
|
1237
|
-
position?: number;
|
|
1238
|
-
};
|
|
1239
|
-
|
|
1240
|
-
/**
|
|
1241
|
-
* Effect of the rule.
|
|
1242
|
-
*/
|
|
1243
|
-
type Consequence = {
|
|
1244
|
-
/**
|
|
1245
|
-
* Exclude items from recommendations.
|
|
1246
|
-
*/
|
|
1247
|
-
hide?: HideConsequenceObject[];
|
|
1248
|
-
/**
|
|
1249
|
-
* Place items at specific positions in the list of recommendations.
|
|
1320
|
+
* Unique identifier of a task. 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`.
|
|
1250
1321
|
*/
|
|
1251
|
-
|
|
1252
|
-
params?: ParamsConsequence;
|
|
1253
|
-
};
|
|
1254
|
-
|
|
1255
|
-
/**
|
|
1256
|
-
* Rule metadata.
|
|
1257
|
-
*/
|
|
1258
|
-
type RuleMetadata = {
|
|
1322
|
+
taskID: number;
|
|
1259
1323
|
/**
|
|
1260
1324
|
* Date and time when the object was updated, in RFC 3339 format.
|
|
1261
1325
|
*/
|
|
1262
|
-
|
|
1263
|
-
};
|
|
1264
|
-
|
|
1265
|
-
/**
|
|
1266
|
-
* Recommend rule.
|
|
1267
|
-
*/
|
|
1268
|
-
type RecommendRule = {
|
|
1269
|
-
_metadata?: RuleMetadata;
|
|
1270
|
-
/**
|
|
1271
|
-
* Unique identifier of a rule object.
|
|
1272
|
-
*/
|
|
1273
|
-
objectID?: string;
|
|
1274
|
-
condition?: Condition;
|
|
1275
|
-
consequence?: Consequence;
|
|
1276
|
-
/**
|
|
1277
|
-
* Description of the rule\'s purpose. This can be helpful for display in the Algolia dashboard.
|
|
1278
|
-
*/
|
|
1279
|
-
description?: string;
|
|
1280
|
-
/**
|
|
1281
|
-
* Indicates whether to enable the rule. If it isn\'t enabled, it isn\'t applied at query time.
|
|
1282
|
-
*/
|
|
1283
|
-
enabled?: boolean;
|
|
1326
|
+
updatedAt: string;
|
|
1284
1327
|
};
|
|
1285
1328
|
|
|
1286
1329
|
type SearchRecommendRulesResponse = {
|
|
@@ -1302,7 +1345,7 @@ type SearchRecommendRulesResponse = {
|
|
|
1302
1345
|
nbPages: number;
|
|
1303
1346
|
};
|
|
1304
1347
|
|
|
1305
|
-
declare const apiClientVersion = "5.
|
|
1348
|
+
declare const apiClientVersion = "5.7.0";
|
|
1306
1349
|
declare function createRecommendClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, ...options }: CreateClientOptions): {
|
|
1307
1350
|
transporter: _algolia_client_common.Transporter;
|
|
1308
1351
|
/**
|
|
@@ -1333,6 +1376,19 @@ declare function createRecommendClient({ appId: appIdOption, apiKey: apiKeyOptio
|
|
|
1333
1376
|
setClientApiKey({ apiKey }: {
|
|
1334
1377
|
apiKey: string;
|
|
1335
1378
|
}): void;
|
|
1379
|
+
/**
|
|
1380
|
+
* Create or update a batch of Recommend Rules Each Recommend Rule is created or updated, depending on whether a Recommend Rule with the same `objectID` already exists. You may also specify `true` for `clearExistingRules`, in which case the batch will atomically replace all the existing Recommend Rules. Recommend Rules are similar to Search Rules, except that the conditions and consequences apply to a [source item](/doc/guides/algolia-recommend/overview/#recommend-models) instead of a query. The main differences are the following: - Conditions `pattern` and `anchoring` are unavailable. - Condition `filters` triggers if the source item matches the specified filters. - Condition `filters` accepts numeric filters. - Consequence `params` only covers filtering parameters. - Consequence `automaticFacetFilters` doesn\'t require a facet value placeholder (it tries to match the data source item\'s attributes instead).
|
|
1381
|
+
*
|
|
1382
|
+
* Required API Key ACLs:
|
|
1383
|
+
* - editSettings.
|
|
1384
|
+
*
|
|
1385
|
+
* @param batchRecommendRules - The batchRecommendRules object.
|
|
1386
|
+
* @param batchRecommendRules.indexName - Name of the index on which to perform the operation.
|
|
1387
|
+
* @param batchRecommendRules.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
|
|
1388
|
+
* @param batchRecommendRules.recommendRule - The recommendRule object.
|
|
1389
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1390
|
+
*/
|
|
1391
|
+
batchRecommendRules({ indexName, model, recommendRule }: BatchRecommendRulesProps, requestOptions?: RequestOptions): Promise<RecommendUpdatedAtResponse>;
|
|
1336
1392
|
/**
|
|
1337
1393
|
* This method allow you to send requests to the Algolia REST API.
|
|
1338
1394
|
*
|
|
@@ -1446,4 +1502,4 @@ type RecommendClient = ReturnType<typeof createRecommendClient>;
|
|
|
1446
1502
|
|
|
1447
1503
|
declare function recommendClient(appId: string, apiKey: string, options?: ClientOptions): RecommendClient;
|
|
1448
1504
|
|
|
1449
|
-
export { type AdvancedSyntaxFeatures, type AlternativesAsExact, type AroundPrecision, type AroundRadius, type AroundRadiusAll, type AutoFacetFilter, type BaseIndexSettings, type BaseRecommendIndexSettings, type BaseRecommendRequest, type BaseRecommendSearchParams, type BaseSearchResponse, type BooleanString, type BoughtTogetherQuery, type Condition, type Consequence, type CustomDeleteProps, type CustomGetProps, type CustomPostProps, type CustomPutProps, type DeleteRecommendRuleProps, type DeletedAtResponse, type Distinct, type ErrorBase, type ExactOnSingleWordQuery, type Exhaustive, type FacetFilters, type FacetOrdering, type FacetStats, type FallbackParams, type FbtModel, type FrequentlyBoughtTogether, type GetRecommendRuleProps, type GetRecommendStatusProps, type GetRecommendTaskResponse, type GetRecommendationsParams, type GetRecommendationsResponse, type HideConsequenceObject, type HighlightResult, type HighlightResultOption, type IgnorePlurals, type IndexSettingsFacets, type LegacyGetRecommendationsParams, type LookingSimilar, type LookingSimilarModel, type LookingSimilarQuery, type MatchLevel, type MatchedGeoLocation, type NumericFilters, type OptionalFilters, type ParamsConsequence, type Personalization, type PromoteConsequenceObject, type QueryType, type Range, type RankingInfo, type ReRankingApplyFilter, type RecommendClient, type RecommendHit, type RecommendIndexSettings, type RecommendModels, type RecommendRule, type RecommendSearchParams, type RecommendationsHit, type RecommendationsHits, type RecommendationsRequest, type RecommendationsResults, type RecommendedForYou, type RecommendedForYouModel, type RecommendedForYouQuery, type Redirect, type RedirectRuleIndexData, type RedirectRuleIndexMetadata, type RedirectURL, type RelatedModel, type RelatedProducts, type RelatedQuery, type RemoveStopWords, type RemoveWordsIfNoResults, type RenderingContent, type RuleMetadata, type SearchPagination, type SearchParamsQuery, type SearchRecommendRulesParams, type SearchRecommendRulesProps, type SearchRecommendRulesResponse, type SnippetResult, type SnippetResultOption, type SortRemainingBy, type SupportedLanguage, type TagFilters, type TaskStatus, type TrendingFacetHit, type TrendingFacets, type TrendingFacetsModel, type TrendingFacetsQuery, type TrendingItems, type TrendingItemsModel, type TrendingItemsQuery, type TypoTolerance, type TypoToleranceEnum, type Value, apiClientVersion, recommendClient };
|
|
1505
|
+
export { type AdvancedSyntaxFeatures, type AlternativesAsExact, type AroundPrecision, type AroundRadius, type AroundRadiusAll, type AutoFacetFilter, type BaseIndexSettings, type BaseRecommendIndexSettings, type BaseRecommendRequest, type BaseRecommendSearchParams, type BaseSearchResponse, type BatchRecommendRulesProps, type BooleanString, type BoughtTogetherQuery, type Condition, type Consequence, type CustomDeleteProps, type CustomGetProps, type CustomPostProps, type CustomPutProps, type DeleteRecommendRuleProps, type DeletedAtResponse, type Distinct, type ErrorBase, type ExactOnSingleWordQuery, type Exhaustive, type FacetFilters, type FacetOrdering, type FacetStats, type FallbackParams, type FbtModel, type FrequentlyBoughtTogether, type GetRecommendRuleProps, type GetRecommendStatusProps, type GetRecommendTaskResponse, type GetRecommendationsParams, type GetRecommendationsResponse, type HideConsequenceObject, type HighlightResult, type HighlightResultOption, type IgnorePlurals, type IndexSettingsFacets, type LegacyGetRecommendationsParams, type LookingSimilar, type LookingSimilarModel, type LookingSimilarQuery, type MatchLevel, type MatchedGeoLocation, type NumericFilters, type OptionalFilters, type ParamsConsequence, type Personalization, type PromoteConsequenceObject, type QueryType, type Range, type RankingInfo, type ReRankingApplyFilter, type RecommendClient, type RecommendHit, type RecommendIndexSettings, type RecommendModels, type RecommendRule, type RecommendSearchParams, type RecommendUpdatedAtResponse, type RecommendationsHit, type RecommendationsHits, type RecommendationsRequest, type RecommendationsResults, type RecommendedForYou, type RecommendedForYouModel, type RecommendedForYouQuery, type Redirect, type RedirectRuleIndexData, type RedirectRuleIndexMetadata, type RedirectURL, type RelatedModel, type RelatedProducts, type RelatedQuery, type RemoveStopWords, type RemoveWordsIfNoResults, type RenderingContent, type RuleMetadata, type SearchPagination, type SearchParamsQuery, type SearchRecommendRulesParams, type SearchRecommendRulesProps, type SearchRecommendRulesResponse, type SnippetResult, type SnippetResultOption, type SortRemainingBy, type SupportedLanguage, type TagFilters, type TaskStatus, type TimeRange, type TrendingFacetHit, type TrendingFacets, type TrendingFacetsModel, type TrendingFacetsQuery, type TrendingItems, type TrendingItemsModel, type TrendingItemsQuery, type TypoTolerance, type TypoToleranceEnum, type Value, apiClientVersion, recommendClient };
|
package/dist/node.d.cts
CHANGED
|
@@ -3,6 +3,137 @@ import { CreateClientOptions, RequestOptions, ClientOptions } from '@algolia/cli
|
|
|
3
3
|
|
|
4
4
|
type RecommendModels = 'bought-together' | 'related-products' | 'trending-facets' | 'trending-items';
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* Condition that triggers the rule. If not specified, the rule is triggered for all recommendations.
|
|
8
|
+
*/
|
|
9
|
+
type Condition = {
|
|
10
|
+
/**
|
|
11
|
+
* Filter expression to only include items that match the filter criteria in the response. You can use these filter expressions: - **Numeric filters.** `<facet> <op> <number>`, where `<op>` is one of `<`, `<=`, `=`, `!=`, `>`, `>=`. - **Ranges.** `<facet>:<lower> TO <upper>` where `<lower>` and `<upper>` are the lower and upper limits of the range (inclusive). - **Facet filters.** `<facet>:<value>` where `<facet>` is a facet attribute (case-sensitive) and `<value>` a facet value. - **Tag filters.** `_tags:<value>` or just `<value>` (case-sensitive). - **Boolean filters.** `<facet>: true | false`. You can combine filters with `AND`, `OR`, and `NOT` operators with the following restrictions: - You can only combine filters of the same type with `OR`. **Not supported:** `facet:value OR num > 3`. - You can\'t use `NOT` with combinations of filters. **Not supported:** `NOT(facet:value OR facet:value)` - You can\'t combine conjunctions (`AND`) with `OR`. **Not supported:** `facet:value OR (facet:value AND facet:value)` Use quotes around your filters, if the facet attribute name or facet value has spaces, keywords (`OR`, `AND`, `NOT`), or quotes. If a facet attribute is an array, the filter matches if it matches at least one element of the array. For more information, see [Filters](https://www.algolia.com/doc/guides/managing-results/refine-results/filtering/).
|
|
12
|
+
*/
|
|
13
|
+
filters?: string;
|
|
14
|
+
/**
|
|
15
|
+
* An additional restriction that only triggers the rule, when the search has the same value as `ruleContexts` parameter. For example, if `context: mobile`, the rule is only triggered when the search request has a matching `ruleContexts: mobile`. A rule context must only contain alphanumeric characters.
|
|
16
|
+
*/
|
|
17
|
+
context?: string;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Object ID of the recommendation you want to exclude.
|
|
22
|
+
*/
|
|
23
|
+
type HideConsequenceObject = {
|
|
24
|
+
/**
|
|
25
|
+
* Unique record identifier.
|
|
26
|
+
*/
|
|
27
|
+
objectID?: string;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Facet attribute. Only recommendations with the same value (or only recommendations with a different value) as the original viewed item are included.
|
|
32
|
+
*/
|
|
33
|
+
type AutoFacetFilter = {
|
|
34
|
+
/**
|
|
35
|
+
* Facet attribute.
|
|
36
|
+
*/
|
|
37
|
+
facet?: string;
|
|
38
|
+
/**
|
|
39
|
+
* Whether the filter is negative. If true, recommendations must not have the same value for the `facet` attribute. If false, recommendations must have the same value for the `facet` attribute.
|
|
40
|
+
*/
|
|
41
|
+
negative?: boolean;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Filter or boost recommendations matching a facet filter.
|
|
46
|
+
*/
|
|
47
|
+
type ParamsConsequence = {
|
|
48
|
+
/**
|
|
49
|
+
* Filter recommendations that match or don\'t match the same `facet:facet_value` combination as the viewed item.
|
|
50
|
+
*/
|
|
51
|
+
automaticFacetFilters?: AutoFacetFilter[];
|
|
52
|
+
/**
|
|
53
|
+
* Filter expression to only include items that match the filter criteria in the response. You can use these filter expressions: - **Numeric filters.** `<facet> <op> <number>`, where `<op>` is one of `<`, `<=`, `=`, `!=`, `>`, `>=`. - **Ranges.** `<facet>:<lower> TO <upper>` where `<lower>` and `<upper>` are the lower and upper limits of the range (inclusive). - **Facet filters.** `<facet>:<value>` where `<facet>` is a facet attribute (case-sensitive) and `<value>` a facet value. - **Tag filters.** `_tags:<value>` or just `<value>` (case-sensitive). - **Boolean filters.** `<facet>: true | false`. You can combine filters with `AND`, `OR`, and `NOT` operators with the following restrictions: - You can only combine filters of the same type with `OR`. **Not supported:** `facet:value OR num > 3`. - You can\'t use `NOT` with combinations of filters. **Not supported:** `NOT(facet:value OR facet:value)` - You can\'t combine conjunctions (`AND`) with `OR`. **Not supported:** `facet:value OR (facet:value AND facet:value)` Use quotes around your filters, if the facet attribute name or facet value has spaces, keywords (`OR`, `AND`, `NOT`), or quotes. If a facet attribute is an array, the filter matches if it matches at least one element of the array. For more information, see [Filters](https://www.algolia.com/doc/guides/managing-results/refine-results/filtering/).
|
|
54
|
+
*/
|
|
55
|
+
filters?: string;
|
|
56
|
+
/**
|
|
57
|
+
* Filters to promote or demote records in the search results. Optional filters work like facet filters, but they don\'t exclude records from the search results. Records that match the optional filter rank before records that don\'t match. Matches with higher weights (`<score=N>`) rank before matches with lower weights. If you\'re using a negative filter `facet:-value`, matching records rank after records that don\'t match.
|
|
58
|
+
*/
|
|
59
|
+
optionalFilters?: string[];
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Object ID and position of the recommendation you want to pin.
|
|
64
|
+
*/
|
|
65
|
+
type PromoteConsequenceObject = {
|
|
66
|
+
/**
|
|
67
|
+
* Unique record identifier.
|
|
68
|
+
*/
|
|
69
|
+
objectID?: string;
|
|
70
|
+
/**
|
|
71
|
+
* Index in the list of recommendations where to place this item.
|
|
72
|
+
*/
|
|
73
|
+
position?: number;
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Effect of the rule.
|
|
78
|
+
*/
|
|
79
|
+
type Consequence = {
|
|
80
|
+
/**
|
|
81
|
+
* Exclude items from recommendations.
|
|
82
|
+
*/
|
|
83
|
+
hide?: HideConsequenceObject[];
|
|
84
|
+
/**
|
|
85
|
+
* Place items at specific positions in the list of recommendations.
|
|
86
|
+
*/
|
|
87
|
+
promote?: PromoteConsequenceObject[];
|
|
88
|
+
params?: ParamsConsequence;
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Rule metadata.
|
|
93
|
+
*/
|
|
94
|
+
type RuleMetadata = {
|
|
95
|
+
/**
|
|
96
|
+
* Date and time when the object was updated, in RFC 3339 format.
|
|
97
|
+
*/
|
|
98
|
+
lastUpdate?: string;
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
type TimeRange = {
|
|
102
|
+
/**
|
|
103
|
+
* When the rule should start to be active, in Unix epoch time.
|
|
104
|
+
*/
|
|
105
|
+
from: number;
|
|
106
|
+
/**
|
|
107
|
+
* When the rule should stop to be active, in Unix epoch time.
|
|
108
|
+
*/
|
|
109
|
+
until: number;
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Recommend rule.
|
|
114
|
+
*/
|
|
115
|
+
type RecommendRule = {
|
|
116
|
+
_metadata?: RuleMetadata;
|
|
117
|
+
/**
|
|
118
|
+
* Unique identifier of a rule object.
|
|
119
|
+
*/
|
|
120
|
+
objectID?: string;
|
|
121
|
+
condition?: Condition;
|
|
122
|
+
consequence?: Consequence;
|
|
123
|
+
/**
|
|
124
|
+
* Description of the rule\'s purpose. This can be helpful for display in the Algolia dashboard.
|
|
125
|
+
*/
|
|
126
|
+
description?: string;
|
|
127
|
+
/**
|
|
128
|
+
* Indicates whether to enable the rule. If it isn\'t enabled, it isn\'t applied at query time.
|
|
129
|
+
*/
|
|
130
|
+
enabled?: boolean;
|
|
131
|
+
/**
|
|
132
|
+
* Time periods when the rule is active.
|
|
133
|
+
*/
|
|
134
|
+
validity?: TimeRange[];
|
|
135
|
+
};
|
|
136
|
+
|
|
6
137
|
/**
|
|
7
138
|
* Range object with lower and upper values in meters to define custom ranges.
|
|
8
139
|
*/
|
|
@@ -631,6 +762,20 @@ type SearchRecommendRulesParams = {
|
|
|
631
762
|
maxValuesPerFacet?: number;
|
|
632
763
|
};
|
|
633
764
|
|
|
765
|
+
/**
|
|
766
|
+
* Properties for the `batchRecommendRules` method.
|
|
767
|
+
*/
|
|
768
|
+
type BatchRecommendRulesProps = {
|
|
769
|
+
/**
|
|
770
|
+
* Name of the index on which to perform the operation.
|
|
771
|
+
*/
|
|
772
|
+
indexName: string;
|
|
773
|
+
/**
|
|
774
|
+
* [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
|
|
775
|
+
*/
|
|
776
|
+
model: RecommendModels;
|
|
777
|
+
recommendRule?: RecommendRule[];
|
|
778
|
+
};
|
|
634
779
|
/**
|
|
635
780
|
* Properties for the `customDelete` method.
|
|
636
781
|
*/
|
|
@@ -1168,119 +1313,17 @@ type GetRecommendationsResponse = {
|
|
|
1168
1313
|
};
|
|
1169
1314
|
|
|
1170
1315
|
/**
|
|
1171
|
-
*
|
|
1172
|
-
*/
|
|
1173
|
-
type Condition = {
|
|
1174
|
-
/**
|
|
1175
|
-
* Filter expression to only include items that match the filter criteria in the response. You can use these filter expressions: - **Numeric filters.** `<facet> <op> <number>`, where `<op>` is one of `<`, `<=`, `=`, `!=`, `>`, `>=`. - **Ranges.** `<facet>:<lower> TO <upper>` where `<lower>` and `<upper>` are the lower and upper limits of the range (inclusive). - **Facet filters.** `<facet>:<value>` where `<facet>` is a facet attribute (case-sensitive) and `<value>` a facet value. - **Tag filters.** `_tags:<value>` or just `<value>` (case-sensitive). - **Boolean filters.** `<facet>: true | false`. You can combine filters with `AND`, `OR`, and `NOT` operators with the following restrictions: - You can only combine filters of the same type with `OR`. **Not supported:** `facet:value OR num > 3`. - You can\'t use `NOT` with combinations of filters. **Not supported:** `NOT(facet:value OR facet:value)` - You can\'t combine conjunctions (`AND`) with `OR`. **Not supported:** `facet:value OR (facet:value AND facet:value)` Use quotes around your filters, if the facet attribute name or facet value has spaces, keywords (`OR`, `AND`, `NOT`), or quotes. If a facet attribute is an array, the filter matches if it matches at least one element of the array. For more information, see [Filters](https://www.algolia.com/doc/guides/managing-results/refine-results/filtering/).
|
|
1176
|
-
*/
|
|
1177
|
-
filters?: string;
|
|
1178
|
-
/**
|
|
1179
|
-
* An additional restriction that only triggers the rule, when the search has the same value as `ruleContexts` parameter. For example, if `context: mobile`, the rule is only triggered when the search request has a matching `ruleContexts: mobile`. A rule context must only contain alphanumeric characters.
|
|
1180
|
-
*/
|
|
1181
|
-
context?: string;
|
|
1182
|
-
};
|
|
1183
|
-
|
|
1184
|
-
/**
|
|
1185
|
-
* Object ID of the recommendation you want to exclude.
|
|
1316
|
+
* Response, taskID, and update timestamp.
|
|
1186
1317
|
*/
|
|
1187
|
-
type
|
|
1318
|
+
type RecommendUpdatedAtResponse = {
|
|
1188
1319
|
/**
|
|
1189
|
-
* Unique
|
|
1190
|
-
*/
|
|
1191
|
-
objectID?: string;
|
|
1192
|
-
};
|
|
1193
|
-
|
|
1194
|
-
/**
|
|
1195
|
-
* Facet attribute. Only recommendations with the same value (or only recommendations with a different value) as the original viewed item are included.
|
|
1196
|
-
*/
|
|
1197
|
-
type AutoFacetFilter = {
|
|
1198
|
-
/**
|
|
1199
|
-
* Facet attribute.
|
|
1200
|
-
*/
|
|
1201
|
-
facet?: string;
|
|
1202
|
-
/**
|
|
1203
|
-
* Whether the filter is negative. If true, recommendations must not have the same value for the `facet` attribute. If false, recommendations must have the same value for the `facet` attribute.
|
|
1204
|
-
*/
|
|
1205
|
-
negative?: boolean;
|
|
1206
|
-
};
|
|
1207
|
-
|
|
1208
|
-
/**
|
|
1209
|
-
* Filter or boost recommendations matching a facet filter.
|
|
1210
|
-
*/
|
|
1211
|
-
type ParamsConsequence = {
|
|
1212
|
-
/**
|
|
1213
|
-
* Filter recommendations that match or don\'t match the same `facet:facet_value` combination as the viewed item.
|
|
1214
|
-
*/
|
|
1215
|
-
automaticFacetFilters?: AutoFacetFilter[];
|
|
1216
|
-
/**
|
|
1217
|
-
* Filter expression to only include items that match the filter criteria in the response. You can use these filter expressions: - **Numeric filters.** `<facet> <op> <number>`, where `<op>` is one of `<`, `<=`, `=`, `!=`, `>`, `>=`. - **Ranges.** `<facet>:<lower> TO <upper>` where `<lower>` and `<upper>` are the lower and upper limits of the range (inclusive). - **Facet filters.** `<facet>:<value>` where `<facet>` is a facet attribute (case-sensitive) and `<value>` a facet value. - **Tag filters.** `_tags:<value>` or just `<value>` (case-sensitive). - **Boolean filters.** `<facet>: true | false`. You can combine filters with `AND`, `OR`, and `NOT` operators with the following restrictions: - You can only combine filters of the same type with `OR`. **Not supported:** `facet:value OR num > 3`. - You can\'t use `NOT` with combinations of filters. **Not supported:** `NOT(facet:value OR facet:value)` - You can\'t combine conjunctions (`AND`) with `OR`. **Not supported:** `facet:value OR (facet:value AND facet:value)` Use quotes around your filters, if the facet attribute name or facet value has spaces, keywords (`OR`, `AND`, `NOT`), or quotes. If a facet attribute is an array, the filter matches if it matches at least one element of the array. For more information, see [Filters](https://www.algolia.com/doc/guides/managing-results/refine-results/filtering/).
|
|
1218
|
-
*/
|
|
1219
|
-
filters?: string;
|
|
1220
|
-
/**
|
|
1221
|
-
* Filters to promote or demote records in the search results. Optional filters work like facet filters, but they don\'t exclude records from the search results. Records that match the optional filter rank before records that don\'t match. Matches with higher weights (`<score=N>`) rank before matches with lower weights. If you\'re using a negative filter `facet:-value`, matching records rank after records that don\'t match.
|
|
1222
|
-
*/
|
|
1223
|
-
optionalFilters?: string[];
|
|
1224
|
-
};
|
|
1225
|
-
|
|
1226
|
-
/**
|
|
1227
|
-
* Object ID and position of the recommendation you want to pin.
|
|
1228
|
-
*/
|
|
1229
|
-
type PromoteConsequenceObject = {
|
|
1230
|
-
/**
|
|
1231
|
-
* Unique record identifier.
|
|
1232
|
-
*/
|
|
1233
|
-
objectID?: string;
|
|
1234
|
-
/**
|
|
1235
|
-
* Index in the list of recommendations where to place this item.
|
|
1236
|
-
*/
|
|
1237
|
-
position?: number;
|
|
1238
|
-
};
|
|
1239
|
-
|
|
1240
|
-
/**
|
|
1241
|
-
* Effect of the rule.
|
|
1242
|
-
*/
|
|
1243
|
-
type Consequence = {
|
|
1244
|
-
/**
|
|
1245
|
-
* Exclude items from recommendations.
|
|
1246
|
-
*/
|
|
1247
|
-
hide?: HideConsequenceObject[];
|
|
1248
|
-
/**
|
|
1249
|
-
* Place items at specific positions in the list of recommendations.
|
|
1320
|
+
* Unique identifier of a task. 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`.
|
|
1250
1321
|
*/
|
|
1251
|
-
|
|
1252
|
-
params?: ParamsConsequence;
|
|
1253
|
-
};
|
|
1254
|
-
|
|
1255
|
-
/**
|
|
1256
|
-
* Rule metadata.
|
|
1257
|
-
*/
|
|
1258
|
-
type RuleMetadata = {
|
|
1322
|
+
taskID: number;
|
|
1259
1323
|
/**
|
|
1260
1324
|
* Date and time when the object was updated, in RFC 3339 format.
|
|
1261
1325
|
*/
|
|
1262
|
-
|
|
1263
|
-
};
|
|
1264
|
-
|
|
1265
|
-
/**
|
|
1266
|
-
* Recommend rule.
|
|
1267
|
-
*/
|
|
1268
|
-
type RecommendRule = {
|
|
1269
|
-
_metadata?: RuleMetadata;
|
|
1270
|
-
/**
|
|
1271
|
-
* Unique identifier of a rule object.
|
|
1272
|
-
*/
|
|
1273
|
-
objectID?: string;
|
|
1274
|
-
condition?: Condition;
|
|
1275
|
-
consequence?: Consequence;
|
|
1276
|
-
/**
|
|
1277
|
-
* Description of the rule\'s purpose. This can be helpful for display in the Algolia dashboard.
|
|
1278
|
-
*/
|
|
1279
|
-
description?: string;
|
|
1280
|
-
/**
|
|
1281
|
-
* Indicates whether to enable the rule. If it isn\'t enabled, it isn\'t applied at query time.
|
|
1282
|
-
*/
|
|
1283
|
-
enabled?: boolean;
|
|
1326
|
+
updatedAt: string;
|
|
1284
1327
|
};
|
|
1285
1328
|
|
|
1286
1329
|
type SearchRecommendRulesResponse = {
|
|
@@ -1302,7 +1345,7 @@ type SearchRecommendRulesResponse = {
|
|
|
1302
1345
|
nbPages: number;
|
|
1303
1346
|
};
|
|
1304
1347
|
|
|
1305
|
-
declare const apiClientVersion = "5.
|
|
1348
|
+
declare const apiClientVersion = "5.7.0";
|
|
1306
1349
|
declare function createRecommendClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, ...options }: CreateClientOptions): {
|
|
1307
1350
|
transporter: _algolia_client_common.Transporter;
|
|
1308
1351
|
/**
|
|
@@ -1333,6 +1376,19 @@ declare function createRecommendClient({ appId: appIdOption, apiKey: apiKeyOptio
|
|
|
1333
1376
|
setClientApiKey({ apiKey }: {
|
|
1334
1377
|
apiKey: string;
|
|
1335
1378
|
}): void;
|
|
1379
|
+
/**
|
|
1380
|
+
* Create or update a batch of Recommend Rules Each Recommend Rule is created or updated, depending on whether a Recommend Rule with the same `objectID` already exists. You may also specify `true` for `clearExistingRules`, in which case the batch will atomically replace all the existing Recommend Rules. Recommend Rules are similar to Search Rules, except that the conditions and consequences apply to a [source item](/doc/guides/algolia-recommend/overview/#recommend-models) instead of a query. The main differences are the following: - Conditions `pattern` and `anchoring` are unavailable. - Condition `filters` triggers if the source item matches the specified filters. - Condition `filters` accepts numeric filters. - Consequence `params` only covers filtering parameters. - Consequence `automaticFacetFilters` doesn\'t require a facet value placeholder (it tries to match the data source item\'s attributes instead).
|
|
1381
|
+
*
|
|
1382
|
+
* Required API Key ACLs:
|
|
1383
|
+
* - editSettings.
|
|
1384
|
+
*
|
|
1385
|
+
* @param batchRecommendRules - The batchRecommendRules object.
|
|
1386
|
+
* @param batchRecommendRules.indexName - Name of the index on which to perform the operation.
|
|
1387
|
+
* @param batchRecommendRules.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
|
|
1388
|
+
* @param batchRecommendRules.recommendRule - The recommendRule object.
|
|
1389
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1390
|
+
*/
|
|
1391
|
+
batchRecommendRules({ indexName, model, recommendRule }: BatchRecommendRulesProps, requestOptions?: RequestOptions): Promise<RecommendUpdatedAtResponse>;
|
|
1336
1392
|
/**
|
|
1337
1393
|
* This method allow you to send requests to the Algolia REST API.
|
|
1338
1394
|
*
|
|
@@ -1446,4 +1502,4 @@ type RecommendClient = ReturnType<typeof createRecommendClient>;
|
|
|
1446
1502
|
|
|
1447
1503
|
declare function recommendClient(appId: string, apiKey: string, options?: ClientOptions): RecommendClient;
|
|
1448
1504
|
|
|
1449
|
-
export { type AdvancedSyntaxFeatures, type AlternativesAsExact, type AroundPrecision, type AroundRadius, type AroundRadiusAll, type AutoFacetFilter, type BaseIndexSettings, type BaseRecommendIndexSettings, type BaseRecommendRequest, type BaseRecommendSearchParams, type BaseSearchResponse, type BooleanString, type BoughtTogetherQuery, type Condition, type Consequence, type CustomDeleteProps, type CustomGetProps, type CustomPostProps, type CustomPutProps, type DeleteRecommendRuleProps, type DeletedAtResponse, type Distinct, type ErrorBase, type ExactOnSingleWordQuery, type Exhaustive, type FacetFilters, type FacetOrdering, type FacetStats, type FallbackParams, type FbtModel, type FrequentlyBoughtTogether, type GetRecommendRuleProps, type GetRecommendStatusProps, type GetRecommendTaskResponse, type GetRecommendationsParams, type GetRecommendationsResponse, type HideConsequenceObject, type HighlightResult, type HighlightResultOption, type IgnorePlurals, type IndexSettingsFacets, type LegacyGetRecommendationsParams, type LookingSimilar, type LookingSimilarModel, type LookingSimilarQuery, type MatchLevel, type MatchedGeoLocation, type NumericFilters, type OptionalFilters, type ParamsConsequence, type Personalization, type PromoteConsequenceObject, type QueryType, type Range, type RankingInfo, type ReRankingApplyFilter, type RecommendClient, type RecommendHit, type RecommendIndexSettings, type RecommendModels, type RecommendRule, type RecommendSearchParams, type RecommendationsHit, type RecommendationsHits, type RecommendationsRequest, type RecommendationsResults, type RecommendedForYou, type RecommendedForYouModel, type RecommendedForYouQuery, type Redirect, type RedirectRuleIndexData, type RedirectRuleIndexMetadata, type RedirectURL, type RelatedModel, type RelatedProducts, type RelatedQuery, type RemoveStopWords, type RemoveWordsIfNoResults, type RenderingContent, type RuleMetadata, type SearchPagination, type SearchParamsQuery, type SearchRecommendRulesParams, type SearchRecommendRulesProps, type SearchRecommendRulesResponse, type SnippetResult, type SnippetResultOption, type SortRemainingBy, type SupportedLanguage, type TagFilters, type TaskStatus, type TrendingFacetHit, type TrendingFacets, type TrendingFacetsModel, type TrendingFacetsQuery, type TrendingItems, type TrendingItemsModel, type TrendingItemsQuery, type TypoTolerance, type TypoToleranceEnum, type Value, apiClientVersion, recommendClient };
|
|
1505
|
+
export { type AdvancedSyntaxFeatures, type AlternativesAsExact, type AroundPrecision, type AroundRadius, type AroundRadiusAll, type AutoFacetFilter, type BaseIndexSettings, type BaseRecommendIndexSettings, type BaseRecommendRequest, type BaseRecommendSearchParams, type BaseSearchResponse, type BatchRecommendRulesProps, type BooleanString, type BoughtTogetherQuery, type Condition, type Consequence, type CustomDeleteProps, type CustomGetProps, type CustomPostProps, type CustomPutProps, type DeleteRecommendRuleProps, type DeletedAtResponse, type Distinct, type ErrorBase, type ExactOnSingleWordQuery, type Exhaustive, type FacetFilters, type FacetOrdering, type FacetStats, type FallbackParams, type FbtModel, type FrequentlyBoughtTogether, type GetRecommendRuleProps, type GetRecommendStatusProps, type GetRecommendTaskResponse, type GetRecommendationsParams, type GetRecommendationsResponse, type HideConsequenceObject, type HighlightResult, type HighlightResultOption, type IgnorePlurals, type IndexSettingsFacets, type LegacyGetRecommendationsParams, type LookingSimilar, type LookingSimilarModel, type LookingSimilarQuery, type MatchLevel, type MatchedGeoLocation, type NumericFilters, type OptionalFilters, type ParamsConsequence, type Personalization, type PromoteConsequenceObject, type QueryType, type Range, type RankingInfo, type ReRankingApplyFilter, type RecommendClient, type RecommendHit, type RecommendIndexSettings, type RecommendModels, type RecommendRule, type RecommendSearchParams, type RecommendUpdatedAtResponse, type RecommendationsHit, type RecommendationsHits, type RecommendationsRequest, type RecommendationsResults, type RecommendedForYou, type RecommendedForYouModel, type RecommendedForYouQuery, type Redirect, type RedirectRuleIndexData, type RedirectRuleIndexMetadata, type RedirectURL, type RelatedModel, type RelatedProducts, type RelatedQuery, type RemoveStopWords, type RemoveWordsIfNoResults, type RenderingContent, type RuleMetadata, type SearchPagination, type SearchParamsQuery, type SearchRecommendRulesParams, type SearchRecommendRulesProps, type SearchRecommendRulesResponse, type SnippetResult, type SnippetResultOption, type SortRemainingBy, type SupportedLanguage, type TagFilters, type TaskStatus, type TimeRange, type TrendingFacetHit, type TrendingFacets, type TrendingFacetsModel, type TrendingFacetsQuery, type TrendingItems, type TrendingItemsModel, type TrendingItemsQuery, type TypoTolerance, type TypoToleranceEnum, type Value, apiClientVersion, recommendClient };
|