@algolia/recommend 5.6.1 → 5.8.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 +5 -6
- package/dist/browser.d.ts +409 -295
- package/dist/builds/browser.js +40 -19
- 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 +37 -16
- package/dist/builds/fetch.js.map +1 -1
- package/dist/builds/node.cjs +37 -16
- package/dist/builds/node.cjs.map +1 -1
- package/dist/builds/node.js +38 -17
- package/dist/builds/node.js.map +1 -1
- package/dist/fetch.d.ts +408 -293
- package/dist/node.d.cts +408 -293
- package/dist/node.d.ts +408 -293
- package/dist/src/recommendClient.cjs +36 -15
- package/dist/src/recommendClient.cjs.map +1 -1
- package/dist/src/recommendClient.js +36 -15
- package/dist/src/recommendClient.js.map +1 -1
- package/index.js +1 -1
- package/model/alternativesAsExact.ts +1 -1
- package/model/aroundPrecision.ts +1 -1
- package/model/aroundRadius.ts +1 -1
- package/model/banner.ts +13 -0
- package/model/bannerImage.ts +12 -0
- package/model/bannerImageUrl.ts +8 -0
- package/model/bannerLink.ts +8 -0
- package/model/banners.ts +10 -0
- package/model/baseIndexSettings.ts +15 -15
- package/model/baseRecommendIndexSettings.ts +14 -14
- package/model/baseRecommendSearchParams.ts +8 -8
- package/model/baseSearchResponse.ts +2 -2
- package/model/booleanString.ts +1 -1
- package/model/clientMethodProps.ts +24 -6
- package/model/consequence.ts +2 -2
- package/model/facetFilters.ts +1 -1
- package/model/facetOrdering.ts +1 -1
- package/model/getRecommendationsParams.ts +1 -1
- package/model/getRecommendationsResponse.ts +1 -1
- package/model/highlightResult.ts +1 -1
- package/model/highlightResultOption.ts +1 -1
- package/model/ignorePlurals.ts +1 -1
- package/model/index.ts +17 -9
- package/model/indexSettingsFacets.ts +1 -1
- package/model/matchLevel.ts +1 -1
- package/model/numericFilters.ts +2 -2
- package/model/optionalFilters.ts +1 -1
- package/model/paramsConsequence.ts +2 -2
- package/model/queryType.ts +2 -2
- package/model/reRankingApplyFilter.ts +1 -1
- package/model/recommendHit.ts +2 -2
- package/model/recommendModels.ts +1 -1
- package/model/recommendRule.ts +6 -0
- package/model/recommendSearchParams.ts +1 -1
- package/model/recommendUpdatedAtResponse.ts +16 -0
- package/model/recommendationsHit.ts +1 -0
- package/model/recommendationsHits.ts +1 -1
- package/model/recommendationsRequest.ts +5 -3
- package/model/recommendationsResults.ts +1 -1
- package/model/redirect.ts +1 -1
- package/model/removeStopWords.ts +1 -1
- package/model/removeWordsIfNoResults.ts +1 -1
- package/model/renderingContent.ts +4 -1
- package/model/searchRecommendRulesParams.ts +1 -1
- package/model/searchRecommendRulesResponse.ts +1 -1
- package/model/snippetResult.ts +1 -1
- package/model/sortRemainingBy.ts +1 -1
- package/model/supportedLanguage.ts +1 -1
- package/model/tagFilters.ts +1 -1
- package/model/taskStatus.ts +1 -1
- package/model/timeRange.ts +13 -0
- package/model/typoTolerance.ts +2 -2
- package/model/value.ts +2 -2
- package/model/widgets.ts +10 -0
- package/package.json +7 -7
package/dist/node.d.cts
CHANGED
|
@@ -1,7 +1,28 @@
|
|
|
1
1
|
import * as _algolia_client_common from '@algolia/client-common';
|
|
2
2
|
import { CreateClientOptions, RequestOptions, ClientOptions } from '@algolia/client-common';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Response, taskID, and deletion timestamp.
|
|
6
|
+
*/
|
|
7
|
+
type DeletedAtResponse = {
|
|
8
|
+
/**
|
|
9
|
+
* 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`.
|
|
10
|
+
*/
|
|
11
|
+
taskID: number;
|
|
12
|
+
/**
|
|
13
|
+
* Date and time when the object was deleted, in RFC 3339 format.
|
|
14
|
+
*/
|
|
15
|
+
deletedAt: string;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Task status, `published` if the task is completed, `notPublished` otherwise.
|
|
20
|
+
*/
|
|
21
|
+
type TaskStatus = 'published' | 'notPublished';
|
|
22
|
+
|
|
23
|
+
type GetRecommendTaskResponse = {
|
|
24
|
+
status: TaskStatus;
|
|
25
|
+
};
|
|
5
26
|
|
|
6
27
|
/**
|
|
7
28
|
* Range object with lower and upper values in meters to define custom ranges.
|
|
@@ -20,7 +41,7 @@ type Range = {
|
|
|
20
41
|
/**
|
|
21
42
|
* Precision of a coordinate-based search in meters to group results with similar distances. The Geo ranking criterion considers all matches within the same range of distances to be equal.
|
|
22
43
|
*/
|
|
23
|
-
type AroundPrecision =
|
|
44
|
+
type AroundPrecision = number | Array<Range>;
|
|
24
45
|
|
|
25
46
|
/**
|
|
26
47
|
* Return all records with a valid `_geoloc` attribute. Don\'t filter by distance.
|
|
@@ -30,32 +51,32 @@ type AroundRadiusAll = 'all';
|
|
|
30
51
|
/**
|
|
31
52
|
* Maximum radius for a search around a central location. This parameter works in combination with the `aroundLatLng` and `aroundLatLngViaIP` parameters. By default, the search radius is determined automatically from the density of hits around the central location. The search radius is small if there are many hits close to the central coordinates.
|
|
32
53
|
*/
|
|
33
|
-
type AroundRadius =
|
|
54
|
+
type AroundRadius = number | AroundRadiusAll;
|
|
34
55
|
|
|
35
56
|
/**
|
|
36
57
|
* Filter the search by facet values, so that only records with the same facet values are retrieved. **Prefer using the `filters` parameter, which supports all filter types and combinations with boolean operators.** - `[filter1, filter2]` is interpreted as `filter1 AND filter2`. - `[[filter1, filter2], filter3]` is interpreted as `filter1 OR filter2 AND filter3`. - `facet:-value` is interpreted as `NOT facet:value`. While it\'s best to avoid attributes that start with a `-`, you can still filter them by escaping with a backslash: `facet:\\-value`.
|
|
37
58
|
*/
|
|
38
|
-
type FacetFilters = FacetFilters
|
|
59
|
+
type FacetFilters = Array<FacetFilters> | string;
|
|
39
60
|
|
|
40
61
|
/**
|
|
41
|
-
* Filter by numeric facets. **Prefer using the `filters` parameter, which supports all filter types and combinations with boolean operators.** You can use numeric comparison operators: `<`, `<=`, `=`, `!=`, `>`, `>=`.
|
|
62
|
+
* Filter by numeric facets. **Prefer using the `filters` parameter, which supports all filter types and combinations with boolean operators.** You can use numeric comparison operators: `<`, `<=`, `=`, `!=`, `>`, `>=`. Comparisons are precise up to 3 decimals. You can also provide ranges: `facet:<lower> TO <upper>`. The range includes the lower and upper boundaries. The same combination rules apply as for `facetFilters`.
|
|
42
63
|
*/
|
|
43
|
-
type NumericFilters = NumericFilters
|
|
64
|
+
type NumericFilters = Array<NumericFilters> | string;
|
|
44
65
|
|
|
45
66
|
/**
|
|
46
67
|
* Filters to promote or demote records in the search results. Optional filters work like facet filters, but they don\'t exclude records from the search results. Records that match the optional filter rank before records that don\'t match. If you\'re using a negative filter `facet:-value`, matching records rank after records that don\'t match. - Optional filters don\'t work on virtual replicas. - Optional filters are applied _after_ sort-by attributes. - Optional filters don\'t work with numeric attributes.
|
|
47
68
|
*/
|
|
48
|
-
type OptionalFilters = OptionalFilters
|
|
69
|
+
type OptionalFilters = Array<OptionalFilters> | string;
|
|
49
70
|
|
|
50
71
|
/**
|
|
51
72
|
* ISO code for a supported language.
|
|
52
73
|
*/
|
|
53
|
-
type SupportedLanguage = 'af' | 'ar' | 'az' | 'bg' | 'bn' | 'ca' | 'cs' | 'cy' | 'da' | 'de' | 'el' | 'en' | 'eo' | 'es' | 'et' | 'eu' | 'fa' | 'fi' | 'fo' | 'fr' | 'ga' | 'gl' | 'he' | 'hi' | 'hu' | 'hy' | 'id' | 'is' | 'it' | 'ja' | 'ka' | 'kk' | 'ko' | 'ku' | 'ky' | 'lt' | 'lv' | 'mi' | 'mn' | 'mr' | 'ms' | 'mt' | 'nb' | 'nl' | 'no' | 'ns' | 'pl' | 'ps' | 'pt
|
|
74
|
+
type SupportedLanguage = 'af' | 'ar' | 'az' | 'bg' | 'bn' | 'ca' | 'cs' | 'cy' | 'da' | 'de' | 'el' | 'en' | 'eo' | 'es' | 'et' | 'eu' | 'fa' | 'fi' | 'fo' | 'fr' | 'ga' | 'gl' | 'he' | 'hi' | 'hu' | 'hy' | 'id' | 'is' | 'it' | 'ja' | 'ka' | 'kk' | 'ko' | 'ku' | 'ky' | 'lt' | 'lv' | 'mi' | 'mn' | 'mr' | 'ms' | 'mt' | 'nb' | 'nl' | 'no' | 'ns' | 'pl' | 'ps' | 'pt' | 'pt-br' | 'qu' | 'ro' | 'ru' | 'sk' | 'sq' | 'sv' | 'sw' | 'ta' | 'te' | 'th' | 'tl' | 'tn' | 'tr' | 'tt' | 'uk' | 'ur' | 'uz' | 'zh';
|
|
54
75
|
|
|
55
76
|
/**
|
|
56
77
|
* Filter the search by values of the special `_tags` attribute. **Prefer using the `filters` parameter, which supports all filter types and combinations with boolean operators.** Different from regular facets, `_tags` can only be used for filtering (including or excluding records). You won\'t get a facet count. The same combination and escaping rules apply as for `facetFilters`.
|
|
57
78
|
*/
|
|
58
|
-
type TagFilters = TagFilters
|
|
79
|
+
type TagFilters = Array<TagFilters> | string;
|
|
59
80
|
|
|
60
81
|
type BaseRecommendSearchParams = {
|
|
61
82
|
/**
|
|
@@ -77,17 +98,17 @@ type BaseRecommendSearchParams = {
|
|
|
77
98
|
/**
|
|
78
99
|
* Restricts a search to a subset of your searchable attributes. Attribute names are case-sensitive.
|
|
79
100
|
*/
|
|
80
|
-
restrictSearchableAttributes?: string
|
|
101
|
+
restrictSearchableAttributes?: Array<string>;
|
|
81
102
|
/**
|
|
82
103
|
* Facets for which to retrieve facet values that match the search criteria and the number of matching facet values. To retrieve all facets, use the wildcard character `*`. For more information, see [facets](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#contextual-facet-values-and-counts).
|
|
83
104
|
*/
|
|
84
|
-
facets?: string
|
|
105
|
+
facets?: Array<string>;
|
|
85
106
|
/**
|
|
86
107
|
* Whether faceting should be applied after deduplication with `distinct`. This leads to accurate facet counts when using faceting in combination with `distinct`. It\'s usually better to use `afterDistinct` modifiers in the `attributesForFaceting` setting, as `facetingAfterDistinct` only computes correct facet counts if all records have the same facet values for the `attributeForDistinct`.
|
|
87
108
|
*/
|
|
88
109
|
facetingAfterDistinct?: boolean;
|
|
89
110
|
/**
|
|
90
|
-
* Coordinates for the center of a circle, expressed as a comma-separated string of latitude and longitude. Only records included within circle around this central location are included in the results. The radius of the circle is determined by the `aroundRadius` and `minimumAroundRadius` settings. This parameter is ignored if you also specify `insidePolygon` or `insideBoundingBox`.
|
|
111
|
+
* Coordinates for the center of a circle, expressed as a comma-separated string of latitude and longitude. Only records included within a circle around this central location are included in the results. The radius of the circle is determined by the `aroundRadius` and `minimumAroundRadius` settings. This parameter is ignored if you also specify `insidePolygon` or `insideBoundingBox`.
|
|
91
112
|
*/
|
|
92
113
|
aroundLatLng?: string;
|
|
93
114
|
/**
|
|
@@ -103,19 +124,19 @@ type BaseRecommendSearchParams = {
|
|
|
103
124
|
/**
|
|
104
125
|
* Coordinates for a rectangular area in which to search. Each bounding box is defined by the two opposite points of its diagonal, and expressed as latitude and longitude pair: `[p1 lat, p1 long, p2 lat, p2 long]`. Provide multiple bounding boxes as nested arrays. For more information, see [rectangular area](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filtering-inside-rectangular-or-polygonal-areas).
|
|
105
126
|
*/
|
|
106
|
-
insideBoundingBox?: number
|
|
127
|
+
insideBoundingBox?: Array<Array<number>>;
|
|
107
128
|
/**
|
|
108
129
|
* Coordinates of a polygon in which to search. Polygons are defined by 3 to 10,000 points. Each point is represented by its latitude and longitude. Provide multiple polygons as nested arrays. For more information, see [filtering inside polygons](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filtering-inside-rectangular-or-polygonal-areas). This parameter is ignored if you also specify `insideBoundingBox`.
|
|
109
130
|
*/
|
|
110
|
-
insidePolygon?: number
|
|
131
|
+
insidePolygon?: Array<Array<number>>;
|
|
111
132
|
/**
|
|
112
133
|
* ISO language codes that adjust settings that are useful for processing natural language queries (as opposed to keyword searches): - Sets `removeStopWords` and `ignorePlurals` to the list of provided languages. - Sets `removeWordsIfNoResults` to `allOptional`. - Adds a `natural_language` attribute to `ruleContexts` and `analyticsTags`.
|
|
113
134
|
*/
|
|
114
|
-
naturalLanguages?: SupportedLanguage
|
|
135
|
+
naturalLanguages?: Array<SupportedLanguage>;
|
|
115
136
|
/**
|
|
116
137
|
* Assigns a rule context to the search query. [Rule contexts](https://www.algolia.com/doc/guides/managing-results/rules/rules-overview/how-to/customize-search-results-by-platform/#whats-a-context) are strings that you can use to trigger matching rules.
|
|
117
138
|
*/
|
|
118
|
-
ruleContexts?: string
|
|
139
|
+
ruleContexts?: Array<string>;
|
|
119
140
|
/**
|
|
120
141
|
* Impact that Personalization should have on this search. The higher this value is, the more Personalization determines the ranking compared to other factors. For more information, see [Understanding Personalization impact](https://www.algolia.com/doc/guides/personalization/personalizing-results/in-depth/configuring-personalization/#understanding-personalization-impact).
|
|
121
142
|
*/
|
|
@@ -143,7 +164,7 @@ type BaseRecommendSearchParams = {
|
|
|
143
164
|
/**
|
|
144
165
|
* Tags to apply to the query for [segmenting analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).
|
|
145
166
|
*/
|
|
146
|
-
analyticsTags?: string
|
|
167
|
+
analyticsTags?: Array<string>;
|
|
147
168
|
/**
|
|
148
169
|
* Whether to include this search when calculating processing-time percentiles.
|
|
149
170
|
*/
|
|
@@ -156,13 +177,13 @@ type BaseRecommendSearchParams = {
|
|
|
156
177
|
|
|
157
178
|
type BaseIndexSettings = {
|
|
158
179
|
/**
|
|
159
|
-
* Attributes used for [faceting](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/). Facets are attributes that let you categorize search results. They can be used for filtering search results. By default, no attribute is used for faceting. Attribute names are case-sensitive. **Modifiers** - `filterOnly(\"ATTRIBUTE\")`. Allows
|
|
180
|
+
* Attributes used for [faceting](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/). Facets are attributes that let you categorize search results. They can be used for filtering search results. By default, no attribute is used for faceting. Attribute names are case-sensitive. **Modifiers** - `filterOnly(\"ATTRIBUTE\")`. Allows the attribute to be used as a filter but doesn\'t evaluate the facet values. - `searchable(\"ATTRIBUTE\")`. Allows searching for facet values. - `afterDistinct(\"ATTRIBUTE\")`. Evaluates the facet count _after_ deduplication with `distinct`. This ensures accurate facet counts. You can apply this modifier to searchable facets: `afterDistinct(searchable(ATTRIBUTE))`.
|
|
160
181
|
*/
|
|
161
|
-
attributesForFaceting?: string
|
|
182
|
+
attributesForFaceting?: Array<string>;
|
|
162
183
|
/**
|
|
163
|
-
* Creates [replica indices](https://www.algolia.com/doc/guides/managing-results/refine-results/sorting/in-depth/replicas/). Replicas are copies of a primary index with the same records but different settings, synonyms, or rules. If you want to offer a different ranking or sorting of your search results, you\'ll use replica indices. All index operations on a primary index are automatically forwarded to its replicas. To add a replica index, you must provide the complete set of replicas to this parameter. If you omit a replica from this list, the replica turns into a regular, standalone index that will no longer
|
|
184
|
+
* Creates [replica indices](https://www.algolia.com/doc/guides/managing-results/refine-results/sorting/in-depth/replicas/). Replicas are copies of a primary index with the same records but different settings, synonyms, or rules. If you want to offer a different ranking or sorting of your search results, you\'ll use replica indices. All index operations on a primary index are automatically forwarded to its replicas. To add a replica index, you must provide the complete set of replicas to this parameter. If you omit a replica from this list, the replica turns into a regular, standalone index that will no longer be synced with the primary index. **Modifier** - `virtual(\"REPLICA\")`. Create a virtual replica, Virtual replicas don\'t increase the number of records and are optimized for [Relevant sorting](https://www.algolia.com/doc/guides/managing-results/refine-results/sorting/in-depth/relevant-sort/).
|
|
164
185
|
*/
|
|
165
|
-
replicas?: string
|
|
186
|
+
replicas?: Array<string>;
|
|
166
187
|
/**
|
|
167
188
|
* Maximum number of search results that can be obtained through pagination. Higher pagination limits might slow down your search. For pagination limits above 1,000, the sorting of results beyond the 1,000th hit can\'t be guaranteed.
|
|
168
189
|
*/
|
|
@@ -170,19 +191,19 @@ type BaseIndexSettings = {
|
|
|
170
191
|
/**
|
|
171
192
|
* Attributes that can\'t be retrieved at query time. This can be useful if you want to use an attribute for ranking or to [restrict access](https://www.algolia.com/doc/guides/security/api-keys/how-to/user-restricted-access-to-data/), but don\'t want to include it in the search results. Attribute names are case-sensitive.
|
|
172
193
|
*/
|
|
173
|
-
unretrievableAttributes?: string
|
|
194
|
+
unretrievableAttributes?: Array<string>;
|
|
174
195
|
/**
|
|
175
196
|
* Words for which you want to turn off [typo tolerance](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/typo-tolerance/). This also turns off [word splitting and concatenation](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/splitting-and-concatenation/) for the specified words.
|
|
176
197
|
*/
|
|
177
|
-
disableTypoToleranceOnWords?: string
|
|
198
|
+
disableTypoToleranceOnWords?: Array<string>;
|
|
178
199
|
/**
|
|
179
200
|
* Attributes, for which you want to support [Japanese transliteration](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/language-specific-configurations/#japanese-transliteration-and-type-ahead). Transliteration supports searching in any of the Japanese writing systems. To support transliteration, you must set the indexing language to Japanese. Attribute names are case-sensitive.
|
|
180
201
|
*/
|
|
181
|
-
attributesToTransliterate?: string
|
|
202
|
+
attributesToTransliterate?: Array<string>;
|
|
182
203
|
/**
|
|
183
204
|
* Attributes for which to split [camel case](https://wikipedia.org/wiki/Camel_case) words. Attribute names are case-sensitive.
|
|
184
205
|
*/
|
|
185
|
-
camelCaseAttributes?: string
|
|
206
|
+
camelCaseAttributes?: Array<string>;
|
|
186
207
|
/**
|
|
187
208
|
* Searchable attributes to which Algolia should apply [word segmentation](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/how-to/customize-segmentation/) (decompounding). Attribute names are case-sensitive. Compound words are formed by combining two or more individual words, and are particularly prevalent in Germanic languages—for example, \"firefighter\". With decompounding, the individual components are indexed separately. You can specify different lists for different languages. Decompounding is supported for these languages: Dutch (`nl`), German (`de`), Finnish (`fi`), Danish (`da`), Swedish (`sv`), and Norwegian (`no`). Decompounding doesn\'t work for words with [non-spacing mark Unicode characters](https://www.charactercodes.net/category/non-spacing_mark). For example, `Gartenstühle` won\'t be decompounded if the `ü` consists of `u` (U+0075) and `◌̈` (U+0308).
|
|
188
209
|
*/
|
|
@@ -190,27 +211,27 @@ type BaseIndexSettings = {
|
|
|
190
211
|
/**
|
|
191
212
|
* Languages for language-specific processing steps, such as word detection and dictionary settings. **You should always specify an indexing language.** If you don\'t specify an indexing language, the search engine uses all [supported languages](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/supported-languages/), or the languages you specified with the `ignorePlurals` or `removeStopWords` parameters. This can lead to unexpected search results. For more information, see [Language-specific configuration](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/language-specific-configurations/).
|
|
192
213
|
*/
|
|
193
|
-
indexLanguages?: SupportedLanguage
|
|
214
|
+
indexLanguages?: Array<SupportedLanguage>;
|
|
194
215
|
/**
|
|
195
216
|
* Searchable attributes for which you want to turn off [prefix matching](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/override-search-engine-defaults/#adjusting-prefix-search). Attribute names are case-sensitive.
|
|
196
217
|
*/
|
|
197
|
-
disablePrefixOnAttributes?: string
|
|
218
|
+
disablePrefixOnAttributes?: Array<string>;
|
|
198
219
|
/**
|
|
199
220
|
* Whether arrays with exclusively non-negative integers should be compressed for better performance. If true, the compressed arrays may be reordered.
|
|
200
221
|
*/
|
|
201
222
|
allowCompressionOfIntegerArray?: boolean;
|
|
202
223
|
/**
|
|
203
|
-
* Numeric attributes that can be used as [numerical filters](https://www.algolia.com/doc/guides/managing-results/rules/detecting-intent/how-to/applying-a-custom-filter-for-a-specific-query/#numerical-filters). Attribute names are case-sensitive. By default, all numeric attributes are available as numerical filters. For faster indexing, reduce the number of numeric attributes.
|
|
224
|
+
* Numeric attributes that can be used as [numerical filters](https://www.algolia.com/doc/guides/managing-results/rules/detecting-intent/how-to/applying-a-custom-filter-for-a-specific-query/#numerical-filters). Attribute names are case-sensitive. By default, all numeric attributes are available as numerical filters. For faster indexing, reduce the number of numeric attributes. To turn off filtering for all numeric attributes, specify an attribute that doesn\'t exist in your index, such as `NO_NUMERIC_FILTERING`. **Modifier** - `equalOnly(\"ATTRIBUTE\")`. Support only filtering based on equality comparisons `=` and `!=`.
|
|
204
225
|
*/
|
|
205
|
-
numericAttributesForFiltering?: string
|
|
226
|
+
numericAttributesForFiltering?: Array<string>;
|
|
206
227
|
/**
|
|
207
228
|
* Controls which separators are indexed. Separators are all non-letter characters except spaces and currency characters, such as $€£¥. By default, separator characters aren\'t indexed. With `separatorsToIndex`, Algolia treats separator characters as separate words. For example, a search for `C#` would report two matches.
|
|
208
229
|
*/
|
|
209
230
|
separatorsToIndex?: string;
|
|
210
231
|
/**
|
|
211
|
-
* Attributes used for searching. Attribute names are case-sensitive. By default, all attributes are searchable and the [Attribute](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/#attribute) ranking criterion is turned off. With a non-empty list, Algolia only returns results with matches in the selected attributes. In addition, the Attribute ranking criterion is turned on: matches in attributes that are higher in the list of `searchableAttributes` rank first. To make matches in two attributes rank equally, include them in a comma-separated string, such as `\"title,alternate_title\"`. Attributes with the same priority are always unordered. For more information, see [Searchable attributes](https://www.algolia.com/doc/guides/sending-and-managing-data/prepare-your-data/how-to/setting-searchable-attributes/). **Modifier** - `unordered(\"ATTRIBUTE\")`. Ignore the position of a match within the attribute. Without modifier, matches at the beginning of an attribute rank
|
|
232
|
+
* Attributes used for searching. Attribute names are case-sensitive. By default, all attributes are searchable and the [Attribute](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/#attribute) ranking criterion is turned off. With a non-empty list, Algolia only returns results with matches in the selected attributes. In addition, the Attribute ranking criterion is turned on: matches in attributes that are higher in the list of `searchableAttributes` rank first. To make matches in two attributes rank equally, include them in a comma-separated string, such as `\"title,alternate_title\"`. Attributes with the same priority are always unordered. For more information, see [Searchable attributes](https://www.algolia.com/doc/guides/sending-and-managing-data/prepare-your-data/how-to/setting-searchable-attributes/). **Modifier** - `unordered(\"ATTRIBUTE\")`. Ignore the position of a match within the attribute. Without a modifier, matches at the beginning of an attribute rank higher than matches at the end.
|
|
212
233
|
*/
|
|
213
|
-
searchableAttributes?: string
|
|
234
|
+
searchableAttributes?: Array<string>;
|
|
214
235
|
/**
|
|
215
236
|
* An object with custom data. You can store up to 32kB as custom data.
|
|
216
237
|
*/
|
|
@@ -218,7 +239,11 @@ type BaseIndexSettings = {
|
|
|
218
239
|
/**
|
|
219
240
|
* Characters and their normalized replacements. This overrides Algolia\'s default [normalization](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/normalization/).
|
|
220
241
|
*/
|
|
221
|
-
customNormalization?:
|
|
242
|
+
customNormalization?: {
|
|
243
|
+
[key: string]: {
|
|
244
|
+
[key: string]: string;
|
|
245
|
+
};
|
|
246
|
+
};
|
|
222
247
|
/**
|
|
223
248
|
* Attribute that should be used to establish groups of results. Attribute names are case-sensitive. All records with the same value for this attribute are considered a group. You can combine `attributeForDistinct` with the `distinct` search parameter to control how many items per group are included in the search results. If you want to use the same attribute also for faceting, use the `afterDistinct` modifier of the `attributesForFaceting` setting. This applies faceting _after_ deduplication, which will result in accurate facet counts.
|
|
224
249
|
*/
|
|
@@ -227,7 +252,7 @@ type BaseIndexSettings = {
|
|
|
227
252
|
|
|
228
253
|
type AdvancedSyntaxFeatures = 'exactPhrase' | 'excludeWords';
|
|
229
254
|
|
|
230
|
-
type AlternativesAsExact = 'ignorePlurals' | '
|
|
255
|
+
type AlternativesAsExact = 'ignorePlurals' | 'singleWordSynonym' | 'multiWordsSynonym';
|
|
231
256
|
|
|
232
257
|
/**
|
|
233
258
|
* Determines how many records of a group are included in the search results. Records with the same value for the `attributeForDistinct` attribute are considered a group. The `distinct` setting controls how many members of the group are returned. This is useful for [deduplication and grouping](https://www.algolia.com/doc/guides/managing-results/refine-results/grouping/#introducing-algolias-distinct-feature). The `distinct` setting is ignored if `attributeForDistinct` is not set.
|
|
@@ -239,32 +264,32 @@ type Distinct = boolean | number;
|
|
|
239
264
|
*/
|
|
240
265
|
type ExactOnSingleWordQuery = 'attribute' | 'none' | 'word';
|
|
241
266
|
|
|
242
|
-
type BooleanString = '
|
|
267
|
+
type BooleanString = 'true' | 'false';
|
|
243
268
|
|
|
244
269
|
/**
|
|
245
270
|
* Treat singular, plurals, and other forms of declensions as equivalent. You should only use this feature for the languages used in your index.
|
|
246
271
|
*/
|
|
247
|
-
type IgnorePlurals =
|
|
272
|
+
type IgnorePlurals = Array<SupportedLanguage> | BooleanString | boolean;
|
|
248
273
|
|
|
249
274
|
/**
|
|
250
|
-
* Determines if and how query words are interpreted as prefixes. By default, only the last query word is treated as prefix (`prefixLast`). To turn off prefix search, use `prefixNone`. Avoid `prefixAll`, which treats all query words as prefixes. This might lead to counterintuitive results and makes your search slower. 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/).
|
|
275
|
+
* Determines if and how query words are interpreted as prefixes. By default, only the last query word is treated as a prefix (`prefixLast`). To turn off prefix search, use `prefixNone`. Avoid `prefixAll`, which treats all query words as prefixes. This might lead to counterintuitive results and makes your search slower. 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/).
|
|
251
276
|
*/
|
|
252
|
-
type QueryType = '
|
|
277
|
+
type QueryType = 'prefixLast' | 'prefixAll' | 'prefixNone';
|
|
253
278
|
|
|
254
279
|
/**
|
|
255
280
|
* Restrict [Dynamic Re-Ranking](https://www.algolia.com/doc/guides/algolia-ai/re-ranking/) to records that match these filters.
|
|
256
281
|
*/
|
|
257
|
-
type ReRankingApplyFilter = ReRankingApplyFilter
|
|
282
|
+
type ReRankingApplyFilter = Array<ReRankingApplyFilter> | string;
|
|
258
283
|
|
|
259
284
|
/**
|
|
260
285
|
* Removes stop words from the search query. Stop words are common words like articles, conjunctions, prepositions, or pronouns that have little or no meaning on their own. In English, \"the\", \"a\", or \"and\" are stop words. You should only use this feature for the languages used in your index.
|
|
261
286
|
*/
|
|
262
|
-
type RemoveStopWords = SupportedLanguage
|
|
287
|
+
type RemoveStopWords = Array<SupportedLanguage> | boolean;
|
|
263
288
|
|
|
264
289
|
/**
|
|
265
290
|
* Strategy for removing words from the query when it doesn\'t return any results. This helps to avoid returning empty search results. - `none`. No words are removed when a query doesn\'t return results. - `lastWords`. Treat the last (then second to last, then third to last) word as optional, until there are results or at most 5 words have been removed. - `firstWords`. Treat the first (then second, then third) word as optional, until there are results or at most 5 words have been removed. - `allOptional`. Treat all words as optional. 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/).
|
|
266
291
|
*/
|
|
267
|
-
type RemoveWordsIfNoResults = '
|
|
292
|
+
type RemoveWordsIfNoResults = 'none' | 'lastWords' | 'firstWords' | 'allOptional';
|
|
268
293
|
|
|
269
294
|
/**
|
|
270
295
|
* Order of facet names.
|
|
@@ -273,24 +298,24 @@ type IndexSettingsFacets = {
|
|
|
273
298
|
/**
|
|
274
299
|
* Explicit order of facets or facet values. This setting lets you always show specific facets or facet values at the top of the list.
|
|
275
300
|
*/
|
|
276
|
-
order?: string
|
|
301
|
+
order?: Array<string>;
|
|
277
302
|
};
|
|
278
303
|
|
|
279
304
|
/**
|
|
280
305
|
* Order of facet values that aren\'t explicitly positioned with the `order` setting. - `count`. Order remaining facet values by decreasing count. The count is the number of matching records containing this facet value. - `alpha`. Sort facet values alphabetically. - `hidden`. Don\'t show facet values that aren\'t explicitly positioned.
|
|
281
306
|
*/
|
|
282
|
-
type SortRemainingBy = '
|
|
307
|
+
type SortRemainingBy = 'count' | 'alpha' | 'hidden';
|
|
283
308
|
|
|
284
309
|
type Value = {
|
|
285
310
|
/**
|
|
286
311
|
* Explicit order of facets or facet values. This setting lets you always show specific facets or facet values at the top of the list.
|
|
287
312
|
*/
|
|
288
|
-
order?: string
|
|
313
|
+
order?: Array<string>;
|
|
289
314
|
sortRemainingBy?: SortRemainingBy;
|
|
290
315
|
/**
|
|
291
316
|
* Hide facet values.
|
|
292
317
|
*/
|
|
293
|
-
hide?: string
|
|
318
|
+
hide?: Array<string>;
|
|
294
319
|
};
|
|
295
320
|
|
|
296
321
|
/**
|
|
@@ -301,7 +326,9 @@ type FacetOrdering = {
|
|
|
301
326
|
/**
|
|
302
327
|
* Order of facet values. One object for each facet.
|
|
303
328
|
*/
|
|
304
|
-
values?:
|
|
329
|
+
values?: {
|
|
330
|
+
[key: string]: Value;
|
|
331
|
+
};
|
|
305
332
|
};
|
|
306
333
|
|
|
307
334
|
/**
|
|
@@ -312,11 +339,56 @@ type RedirectURL = {
|
|
|
312
339
|
};
|
|
313
340
|
|
|
314
341
|
/**
|
|
315
|
-
*
|
|
342
|
+
* url for a search banner image.
|
|
343
|
+
*/
|
|
344
|
+
type BannerImageUrl = {
|
|
345
|
+
url?: string;
|
|
346
|
+
};
|
|
347
|
+
|
|
348
|
+
/**
|
|
349
|
+
* image of a search banner.
|
|
350
|
+
*/
|
|
351
|
+
type BannerImage = {
|
|
352
|
+
urls?: BannerImageUrl;
|
|
353
|
+
title?: string;
|
|
354
|
+
};
|
|
355
|
+
|
|
356
|
+
/**
|
|
357
|
+
* link for a banner defined in merchandising studio.
|
|
358
|
+
*/
|
|
359
|
+
type BannerLink = {
|
|
360
|
+
url?: string;
|
|
361
|
+
};
|
|
362
|
+
|
|
363
|
+
/**
|
|
364
|
+
* a search banner with image and url.
|
|
365
|
+
*/
|
|
366
|
+
type Banner = {
|
|
367
|
+
image?: BannerImage;
|
|
368
|
+
link?: BannerLink;
|
|
369
|
+
};
|
|
370
|
+
|
|
371
|
+
/**
|
|
372
|
+
* banners defined in the merchandising studio for the given search.
|
|
373
|
+
*/
|
|
374
|
+
type Banners = {
|
|
375
|
+
banners?: Banner;
|
|
376
|
+
};
|
|
377
|
+
|
|
378
|
+
/**
|
|
379
|
+
* widgets returned from any rules that are applied to the current search.
|
|
380
|
+
*/
|
|
381
|
+
type Widgets = {
|
|
382
|
+
banners?: Banners;
|
|
383
|
+
};
|
|
384
|
+
|
|
385
|
+
/**
|
|
386
|
+
* Extra data that can be used in the search UI. You can use this to control aspects of your search UI, such as the order of facet names and values without changing your frontend code.
|
|
316
387
|
*/
|
|
317
388
|
type RenderingContent = {
|
|
318
389
|
facetOrdering?: FacetOrdering;
|
|
319
390
|
redirect?: RedirectURL;
|
|
391
|
+
widgets?: Widgets;
|
|
320
392
|
};
|
|
321
393
|
|
|
322
394
|
/**
|
|
@@ -325,19 +397,19 @@ type RenderingContent = {
|
|
|
325
397
|
type TypoToleranceEnum = 'min' | 'strict';
|
|
326
398
|
|
|
327
399
|
/**
|
|
328
|
-
* Whether [typo tolerance](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/typo-tolerance/) is enabled and how it is applied. If typo tolerance is true, `min`, or `strict`, [word splitting and
|
|
400
|
+
* Whether [typo tolerance](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/typo-tolerance/) is enabled and how it is applied. If typo tolerance is true, `min`, or `strict`, [word splitting and concatenation](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/splitting-and-concatenation/) are also active.
|
|
329
401
|
*/
|
|
330
|
-
type TypoTolerance =
|
|
402
|
+
type TypoTolerance = boolean | TypoToleranceEnum;
|
|
331
403
|
|
|
332
404
|
type BaseRecommendIndexSettings = {
|
|
333
405
|
/**
|
|
334
406
|
* Attributes to include in the API response. To reduce the size of your response, you can retrieve only some of the attributes. Attribute names are case-sensitive. - `*` retrieves all attributes, except attributes included in the `customRanking` and `unretrievableAttributes` settings. - To retrieve all attributes except a specific one, prefix the attribute with a dash and combine it with the `*`: `[\"*\", \"-ATTRIBUTE\"]`. - The `objectID` attribute is always included.
|
|
335
407
|
*/
|
|
336
|
-
attributesToRetrieve?: string
|
|
408
|
+
attributesToRetrieve?: Array<string>;
|
|
337
409
|
/**
|
|
338
410
|
* Determines the order in which Algolia returns your results. By default, each entry corresponds to a [ranking criteria](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/). The tie-breaking algorithm sequentially applies each criterion in the order they\'re specified. 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/), you put the sorting attribute at the top of the list. **Modifiers** - `asc(\"ATTRIBUTE\")`. Sort the index by the values of an attribute, in ascending order. - `desc(\"ATTRIBUTE\")`. Sort the index by the values of an attribute, in descending order. Before you modify the default setting, you should test your changes in the dashboard, and by [A/B testing](https://www.algolia.com/doc/guides/ab-testing/what-is-ab-testing/).
|
|
339
411
|
*/
|
|
340
|
-
ranking?: string
|
|
412
|
+
ranking?: Array<string>;
|
|
341
413
|
/**
|
|
342
414
|
* Relevancy threshold below which less relevant results aren\'t included in the results. 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). Use this setting to strike a balance between the relevance and number of returned results.
|
|
343
415
|
*/
|
|
@@ -345,11 +417,11 @@ type BaseRecommendIndexSettings = {
|
|
|
345
417
|
/**
|
|
346
418
|
* Attributes to highlight. By default, all searchable attributes are highlighted. Use `*` to highlight all attributes or use an empty array `[]` to turn off highlighting. Attribute names are case-sensitive. With highlighting, strings that match the search query are surrounded by HTML tags defined by `highlightPreTag` and `highlightPostTag`. You can use this to visually highlight matching parts of a search query in your UI. For more information, see [Highlighting and snippeting](https://www.algolia.com/doc/guides/building-search-ui/ui-and-ux-patterns/highlighting-snippeting/js/).
|
|
347
419
|
*/
|
|
348
|
-
attributesToHighlight?: string
|
|
420
|
+
attributesToHighlight?: Array<string>;
|
|
349
421
|
/**
|
|
350
422
|
* Attributes for which to enable snippets. Attribute names are case-sensitive. Snippets provide additional context to matched words. If you enable snippets, they include 10 words, including the matched word. The matched word will also be wrapped by HTML tags for highlighting. You can adjust the number of words with the following notation: `ATTRIBUTE:NUMBER`, where `NUMBER` is the number of words to be extracted.
|
|
351
423
|
*/
|
|
352
|
-
attributesToSnippet?: string
|
|
424
|
+
attributesToSnippet?: Array<string>;
|
|
353
425
|
/**
|
|
354
426
|
* HTML tag to insert before the highlighted parts in all highlighted results and snippets.
|
|
355
427
|
*/
|
|
@@ -382,13 +454,13 @@ type BaseRecommendIndexSettings = {
|
|
|
382
454
|
/**
|
|
383
455
|
* Attributes for which you want to turn off [typo tolerance](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/typo-tolerance/). Attribute names are case-sensitive. Returning only exact matches can help when: - [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/). - Reducing the number of matches when you have too many. This can happen with attributes that are long blocks of text, such as product descriptions. Consider alternatives such as `disableTypoToleranceOnWords` or adding synonyms if your attributes have intentional unusual spellings that might look like typos.
|
|
384
456
|
*/
|
|
385
|
-
disableTypoToleranceOnAttributes?: string
|
|
457
|
+
disableTypoToleranceOnAttributes?: Array<string>;
|
|
386
458
|
ignorePlurals?: IgnorePlurals;
|
|
387
459
|
removeStopWords?: RemoveStopWords;
|
|
388
460
|
/**
|
|
389
461
|
* Languages for language-specific query processing steps such as plurals, stop-word removal, and word-detection dictionaries. This setting sets a default list of languages used by the `removeStopWords` and `ignorePlurals` settings. This setting also sets a dictionary for word detection in the logogram-based [CJK](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/normalization/#normalization-for-logogram-based-languages-cjk) languages. To support this, you must place the CJK language **first**. **You should always specify a query language.** If you don\'t specify an indexing language, the search engine uses all [supported languages](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/supported-languages/), or the languages you specified with the `ignorePlurals` or `removeStopWords` parameters. This can lead to unexpected search results. For more information, see [Language-specific configuration](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/language-specific-configurations/).
|
|
390
462
|
*/
|
|
391
|
-
queryLanguages?: SupportedLanguage
|
|
463
|
+
queryLanguages?: Array<SupportedLanguage>;
|
|
392
464
|
/**
|
|
393
465
|
* Whether to split compound words in the query into their building blocks. 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). Word segmentation is supported for these languages: German, Dutch, Finnish, Swedish, and Norwegian. Decompounding doesn\'t work for words with [non-spacing mark Unicode characters](https://www.charactercodes.net/category/non-spacing_mark). For example, `Gartenstühle` won\'t be decompounded if the `ü` consists of `u` (U+0075) and `◌̈` (U+0308).
|
|
394
466
|
*/
|
|
@@ -408,25 +480,25 @@ type BaseRecommendIndexSettings = {
|
|
|
408
480
|
*/
|
|
409
481
|
advancedSyntax?: boolean;
|
|
410
482
|
/**
|
|
411
|
-
* Words that should be considered optional when found in the query. By default, records must match all words in the search query to be included in the search results. 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. For example, if the search query is \"action video\" and \"video\" is an optional word, the search engine runs two queries. One for \"action video\" and one for \"action\". Records that match all words are ranked higher. For a search query with 4 or more words **and** all its words are optional, the number of matched words required for a record to be included in the search results increases for every 1,000 records: - If `optionalWords` has less than 10 words, the required number of matched words increases by 1: results 1 to 1,000 require 1 matched word, results 1,001 to 2000 need 2 matched words. - If `optionalWords` has 10 or more words, the number of required matched words increases by the number of optional words
|
|
483
|
+
* Words that should be considered optional when found in the query. By default, records must match all words in the search query to be included in the search results. 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. For example, if the search query is \"action video\" and \"video\" is an optional word, the search engine runs two queries. One for \"action video\" and one for \"action\". Records that match all words are ranked higher. For a search query with 4 or more words **and** all its words are optional, the number of matched words required for a record to be included in the search results increases for every 1,000 records: - If `optionalWords` has less than 10 words, the required number of matched words increases by 1: results 1 to 1,000 require 1 matched word, results 1,001 to 2000 need 2 matched words. - If `optionalWords` has 10 or more words, the number of required matched words increases by the number of optional words divided by 5 (rounded down). For example, with 18 optional words: results 1 to 1,000 require 1 matched word, results 1,001 to 2000 need 4 matched words. 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).
|
|
412
484
|
*/
|
|
413
|
-
optionalWords?: string
|
|
485
|
+
optionalWords?: Array<string>;
|
|
414
486
|
/**
|
|
415
|
-
* 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). Attribute names are case-sensitive. This can be useful for attributes with long values, where the
|
|
487
|
+
* 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). Attribute names are case-sensitive. This can be useful for attributes with long values, where the likelihood of an exact match is high, such as product descriptions. Turning off the Exact ranking criterion for these attributes favors exact matching on other attributes. This reduces the impact of individual attributes with a lot of content on ranking.
|
|
416
488
|
*/
|
|
417
|
-
disableExactOnAttributes?: string
|
|
489
|
+
disableExactOnAttributes?: Array<string>;
|
|
418
490
|
exactOnSingleWordQuery?: ExactOnSingleWordQuery;
|
|
419
491
|
/**
|
|
420
492
|
* Alternatives of query words that should be considered as exact matches by the Exact ranking criterion. - `ignorePlurals`. Plurals and similar declensions added by the `ignorePlurals` setting are considered exact matches. - `singleWordSynonym`. Single-word synonyms, such as \"NY/NYC\" are considered exact matches. - `multiWordsSynonym`. Multi-word synonyms, such as \"NY/New York\" are considered exact matches.
|
|
421
493
|
*/
|
|
422
|
-
alternativesAsExact?: AlternativesAsExact
|
|
494
|
+
alternativesAsExact?: Array<AlternativesAsExact>;
|
|
423
495
|
/**
|
|
424
496
|
* Advanced search syntax features you want to support. - `exactPhrase`. Phrases in quotes must match exactly. For example, `sparkly blue \"iPhone case\"` only returns records with the exact string \"iPhone case\". - `excludeWords`. Query words prefixed with a `-` must not occur in a record. For example, `search -engine` matches records that contain \"search\" but not \"engine\". This setting only has an effect if `advancedSyntax` is true.
|
|
425
497
|
*/
|
|
426
|
-
advancedSyntaxFeatures?: AdvancedSyntaxFeatures
|
|
498
|
+
advancedSyntaxFeatures?: Array<AdvancedSyntaxFeatures>;
|
|
427
499
|
distinct?: Distinct;
|
|
428
500
|
/**
|
|
429
|
-
* Whether to replace a highlighted word with the matched synonym. By default, the original words are highlighted even if a synonym matches. For example, with `home` as a synonym for `house` and a search for `home`, records matching either \"home\" or \"house\" are included in the search results, and either \"home\" or \"house\" are highlighted. With `replaceSynonymsInHighlight` set to `true`, a search for `home` still matches the same records, but all
|
|
501
|
+
* Whether to replace a highlighted word with the matched synonym. By default, the original words are highlighted even if a synonym matches. For example, with `home` as a synonym for `house` and a search for `home`, records matching either \"home\" or \"house\" are included in the search results, and either \"home\" or \"house\" are highlighted. With `replaceSynonymsInHighlight` set to `true`, a search for `home` still matches the same records, but all occurrences of \"house\" are replaced by \"home\" in the highlighted response.
|
|
430
502
|
*/
|
|
431
503
|
replaceSynonymsInHighlight?: boolean;
|
|
432
504
|
/**
|
|
@@ -436,7 +508,7 @@ type BaseRecommendIndexSettings = {
|
|
|
436
508
|
/**
|
|
437
509
|
* Properties to include in the API response of `search` and `browse` requests. By default, all response properties are included. To reduce the response size, you can select, which attributes should be included. You can\'t exclude these properties: `message`, `warning`, `cursor`, `serverUsed`, `indexUsed`, `abTestVariantID`, `parsedQuery`, or any property triggered by the `getRankingInfo` parameter. Don\'t exclude properties that you might need in your search UI.
|
|
438
510
|
*/
|
|
439
|
-
responseFields?: string
|
|
511
|
+
responseFields?: Array<string>;
|
|
440
512
|
/**
|
|
441
513
|
* 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).
|
|
442
514
|
*/
|
|
@@ -476,7 +548,7 @@ type SearchParamsQuery = {
|
|
|
476
548
|
/**
|
|
477
549
|
* Search parameters for filtering the recommendations.
|
|
478
550
|
*/
|
|
479
|
-
type RecommendSearchParams = BaseRecommendSearchParams &
|
|
551
|
+
type RecommendSearchParams = BaseRecommendSearchParams & SearchParamsQuery & RecommendIndexSettings;
|
|
480
552
|
|
|
481
553
|
type BaseRecommendRequest = {
|
|
482
554
|
/**
|
|
@@ -591,200 +663,7 @@ type TrendingItems = {
|
|
|
591
663
|
|
|
592
664
|
type TrendingItemsQuery = BaseRecommendRequest & TrendingItems;
|
|
593
665
|
|
|
594
|
-
type RecommendationsRequest = BoughtTogetherQuery |
|
|
595
|
-
|
|
596
|
-
/**
|
|
597
|
-
* Recommend rules parameters.
|
|
598
|
-
*/
|
|
599
|
-
type SearchRecommendRulesParams = {
|
|
600
|
-
/**
|
|
601
|
-
* Search query.
|
|
602
|
-
*/
|
|
603
|
-
query?: string;
|
|
604
|
-
/**
|
|
605
|
-
* Only search for rules with matching context.
|
|
606
|
-
*/
|
|
607
|
-
context?: string;
|
|
608
|
-
/**
|
|
609
|
-
* Requested page of the API response.
|
|
610
|
-
*/
|
|
611
|
-
page?: number;
|
|
612
|
-
/**
|
|
613
|
-
* Maximum number of hits per page.
|
|
614
|
-
*/
|
|
615
|
-
hitsPerPage?: number;
|
|
616
|
-
/**
|
|
617
|
-
* Whether to only show rules where the value of their `enabled` property matches this parameter. If absent, show all rules, regardless of their `enabled` property.
|
|
618
|
-
*/
|
|
619
|
-
enabled?: boolean;
|
|
620
|
-
/**
|
|
621
|
-
* Filter expression. This only searches for rules matching the filter expression.
|
|
622
|
-
*/
|
|
623
|
-
filters?: string;
|
|
624
|
-
/**
|
|
625
|
-
* Include facets and facet values in the response. Use `[\'*\']` to include all facets.
|
|
626
|
-
*/
|
|
627
|
-
facets?: string[];
|
|
628
|
-
/**
|
|
629
|
-
* Maximum number of values to return for each facet.
|
|
630
|
-
*/
|
|
631
|
-
maxValuesPerFacet?: number;
|
|
632
|
-
};
|
|
633
|
-
|
|
634
|
-
/**
|
|
635
|
-
* Properties for the `customDelete` method.
|
|
636
|
-
*/
|
|
637
|
-
type CustomDeleteProps = {
|
|
638
|
-
/**
|
|
639
|
-
* Path of the endpoint, anything after \"/1\" must be specified.
|
|
640
|
-
*/
|
|
641
|
-
path: string;
|
|
642
|
-
/**
|
|
643
|
-
* Query parameters to apply to the current query.
|
|
644
|
-
*/
|
|
645
|
-
parameters?: Record<string, any>;
|
|
646
|
-
};
|
|
647
|
-
/**
|
|
648
|
-
* Properties for the `customGet` method.
|
|
649
|
-
*/
|
|
650
|
-
type CustomGetProps = {
|
|
651
|
-
/**
|
|
652
|
-
* Path of the endpoint, anything after \"/1\" must be specified.
|
|
653
|
-
*/
|
|
654
|
-
path: string;
|
|
655
|
-
/**
|
|
656
|
-
* Query parameters to apply to the current query.
|
|
657
|
-
*/
|
|
658
|
-
parameters?: Record<string, any>;
|
|
659
|
-
};
|
|
660
|
-
/**
|
|
661
|
-
* Properties for the `customPost` method.
|
|
662
|
-
*/
|
|
663
|
-
type CustomPostProps = {
|
|
664
|
-
/**
|
|
665
|
-
* Path of the endpoint, anything after \"/1\" must be specified.
|
|
666
|
-
*/
|
|
667
|
-
path: string;
|
|
668
|
-
/**
|
|
669
|
-
* Query parameters to apply to the current query.
|
|
670
|
-
*/
|
|
671
|
-
parameters?: Record<string, any>;
|
|
672
|
-
/**
|
|
673
|
-
* Parameters to send with the custom request.
|
|
674
|
-
*/
|
|
675
|
-
body?: Record<string, unknown>;
|
|
676
|
-
};
|
|
677
|
-
/**
|
|
678
|
-
* Properties for the `customPut` method.
|
|
679
|
-
*/
|
|
680
|
-
type CustomPutProps = {
|
|
681
|
-
/**
|
|
682
|
-
* Path of the endpoint, anything after \"/1\" must be specified.
|
|
683
|
-
*/
|
|
684
|
-
path: string;
|
|
685
|
-
/**
|
|
686
|
-
* Query parameters to apply to the current query.
|
|
687
|
-
*/
|
|
688
|
-
parameters?: Record<string, any>;
|
|
689
|
-
/**
|
|
690
|
-
* Parameters to send with the custom request.
|
|
691
|
-
*/
|
|
692
|
-
body?: Record<string, unknown>;
|
|
693
|
-
};
|
|
694
|
-
/**
|
|
695
|
-
* Properties for the `deleteRecommendRule` method.
|
|
696
|
-
*/
|
|
697
|
-
type DeleteRecommendRuleProps = {
|
|
698
|
-
/**
|
|
699
|
-
* Name of the index on which to perform the operation.
|
|
700
|
-
*/
|
|
701
|
-
indexName: string;
|
|
702
|
-
/**
|
|
703
|
-
* [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
|
|
704
|
-
*/
|
|
705
|
-
model: RecommendModels;
|
|
706
|
-
/**
|
|
707
|
-
* Unique record identifier.
|
|
708
|
-
*/
|
|
709
|
-
objectID: string;
|
|
710
|
-
};
|
|
711
|
-
/**
|
|
712
|
-
* Properties for the `getRecommendRule` method.
|
|
713
|
-
*/
|
|
714
|
-
type GetRecommendRuleProps = {
|
|
715
|
-
/**
|
|
716
|
-
* Name of the index on which to perform the operation.
|
|
717
|
-
*/
|
|
718
|
-
indexName: string;
|
|
719
|
-
/**
|
|
720
|
-
* [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
|
|
721
|
-
*/
|
|
722
|
-
model: RecommendModels;
|
|
723
|
-
/**
|
|
724
|
-
* Unique record identifier.
|
|
725
|
-
*/
|
|
726
|
-
objectID: string;
|
|
727
|
-
};
|
|
728
|
-
/**
|
|
729
|
-
* Properties for the `getRecommendStatus` method.
|
|
730
|
-
*/
|
|
731
|
-
type GetRecommendStatusProps = {
|
|
732
|
-
/**
|
|
733
|
-
* Name of the index on which to perform the operation.
|
|
734
|
-
*/
|
|
735
|
-
indexName: string;
|
|
736
|
-
/**
|
|
737
|
-
* [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
|
|
738
|
-
*/
|
|
739
|
-
model: RecommendModels;
|
|
740
|
-
/**
|
|
741
|
-
* Unique task identifier.
|
|
742
|
-
*/
|
|
743
|
-
taskID: number;
|
|
744
|
-
};
|
|
745
|
-
/**
|
|
746
|
-
* Recommend method signature compatible with the `algoliasearch` v4 package. When using this signature, extra computation will be required to make it match the new signature.
|
|
747
|
-
*
|
|
748
|
-
* @deprecated This signature will be removed from the next major version, we recommend using the `GetRecommendationsParams` type for performances and future proof reasons.
|
|
749
|
-
*/
|
|
750
|
-
type LegacyGetRecommendationsParams = RecommendationsRequest[];
|
|
751
|
-
/**
|
|
752
|
-
* Properties for the `searchRecommendRules` method.
|
|
753
|
-
*/
|
|
754
|
-
type SearchRecommendRulesProps = {
|
|
755
|
-
/**
|
|
756
|
-
* Name of the index on which to perform the operation.
|
|
757
|
-
*/
|
|
758
|
-
indexName: string;
|
|
759
|
-
/**
|
|
760
|
-
* [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
|
|
761
|
-
*/
|
|
762
|
-
model: RecommendModels;
|
|
763
|
-
searchRecommendRulesParams?: SearchRecommendRulesParams;
|
|
764
|
-
};
|
|
765
|
-
|
|
766
|
-
/**
|
|
767
|
-
* Response, taskID, and deletion timestamp.
|
|
768
|
-
*/
|
|
769
|
-
type DeletedAtResponse = {
|
|
770
|
-
/**
|
|
771
|
-
* 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`.
|
|
772
|
-
*/
|
|
773
|
-
taskID: number;
|
|
774
|
-
/**
|
|
775
|
-
* Date and time when the object was deleted, in RFC 3339 format.
|
|
776
|
-
*/
|
|
777
|
-
deletedAt: string;
|
|
778
|
-
};
|
|
779
|
-
|
|
780
|
-
/**
|
|
781
|
-
* Task status, `published` if the task is completed, `notPublished` otherwise.
|
|
782
|
-
*/
|
|
783
|
-
type TaskStatus = 'notPublished' | 'published';
|
|
784
|
-
|
|
785
|
-
type GetRecommendTaskResponse = {
|
|
786
|
-
status: TaskStatus;
|
|
787
|
-
};
|
|
666
|
+
type RecommendationsRequest = BoughtTogetherQuery | RelatedQuery | TrendingItemsQuery | TrendingFacetsQuery | LookingSimilarQuery | RecommendedForYouQuery;
|
|
788
667
|
|
|
789
668
|
/**
|
|
790
669
|
* Recommend request body.
|
|
@@ -793,7 +672,7 @@ type GetRecommendationsParams = {
|
|
|
793
672
|
/**
|
|
794
673
|
* Recommendation request with parameters depending on the requested model.
|
|
795
674
|
*/
|
|
796
|
-
requests: RecommendationsRequest
|
|
675
|
+
requests: Array<RecommendationsRequest>;
|
|
797
676
|
};
|
|
798
677
|
|
|
799
678
|
/**
|
|
@@ -872,7 +751,7 @@ type RedirectRuleIndexMetadata = {
|
|
|
872
751
|
* [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.
|
|
873
752
|
*/
|
|
874
753
|
type Redirect = {
|
|
875
|
-
index?: RedirectRuleIndexMetadata
|
|
754
|
+
index?: Array<RedirectRuleIndexMetadata>;
|
|
876
755
|
};
|
|
877
756
|
|
|
878
757
|
type BaseSearchResponse = Record<string, any> & {
|
|
@@ -908,11 +787,17 @@ type BaseSearchResponse = Record<string, any> & {
|
|
|
908
787
|
/**
|
|
909
788
|
* Facet counts.
|
|
910
789
|
*/
|
|
911
|
-
facets?:
|
|
790
|
+
facets?: {
|
|
791
|
+
[key: string]: {
|
|
792
|
+
[key: string]: number;
|
|
793
|
+
};
|
|
794
|
+
};
|
|
912
795
|
/**
|
|
913
796
|
* Statistics for numerical facets.
|
|
914
797
|
*/
|
|
915
|
-
facets_stats?:
|
|
798
|
+
facets_stats?: {
|
|
799
|
+
[key: string]: FacetStats;
|
|
800
|
+
};
|
|
916
801
|
/**
|
|
917
802
|
* Index name used for the query.
|
|
918
803
|
*/
|
|
@@ -972,7 +857,7 @@ type BaseSearchResponse = Record<string, any> & {
|
|
|
972
857
|
/**
|
|
973
858
|
* Whether the whole query string matches or only a part.
|
|
974
859
|
*/
|
|
975
|
-
type MatchLevel = '
|
|
860
|
+
type MatchLevel = 'none' | 'partial' | 'full';
|
|
976
861
|
|
|
977
862
|
/**
|
|
978
863
|
* Surround words that match the query with HTML tags for highlighting.
|
|
@@ -986,16 +871,16 @@ type HighlightResultOption = {
|
|
|
986
871
|
/**
|
|
987
872
|
* List of matched words from the search query.
|
|
988
873
|
*/
|
|
989
|
-
matchedWords: string
|
|
874
|
+
matchedWords: Array<string>;
|
|
990
875
|
/**
|
|
991
876
|
* Whether the entire attribute value is highlighted.
|
|
992
877
|
*/
|
|
993
878
|
fullyHighlighted?: boolean;
|
|
994
879
|
};
|
|
995
880
|
|
|
996
|
-
type HighlightResult =
|
|
881
|
+
type HighlightResult = HighlightResultOption | {
|
|
997
882
|
[key: string]: HighlightResult;
|
|
998
|
-
}
|
|
883
|
+
} | Array<HighlightResult>;
|
|
999
884
|
|
|
1000
885
|
type MatchedGeoLocation = {
|
|
1001
886
|
/**
|
|
@@ -1090,9 +975,9 @@ type SnippetResultOption = {
|
|
|
1090
975
|
matchLevel: MatchLevel;
|
|
1091
976
|
};
|
|
1092
977
|
|
|
1093
|
-
type SnippetResult =
|
|
978
|
+
type SnippetResult = SnippetResultOption | {
|
|
1094
979
|
[key: string]: SnippetResult;
|
|
1095
|
-
}
|
|
980
|
+
} | Array<SnippetResult>;
|
|
1096
981
|
|
|
1097
982
|
/**
|
|
1098
983
|
* Recommend hit.
|
|
@@ -1105,11 +990,15 @@ type RecommendHit = Record<string, any> & {
|
|
|
1105
990
|
/**
|
|
1106
991
|
* Surround words that match the query with HTML tags for highlighting.
|
|
1107
992
|
*/
|
|
1108
|
-
_highlightResult?:
|
|
993
|
+
_highlightResult?: {
|
|
994
|
+
[key: string]: HighlightResult;
|
|
995
|
+
};
|
|
1109
996
|
/**
|
|
1110
997
|
* Snippets that show the context around a matching search query.
|
|
1111
998
|
*/
|
|
1112
|
-
_snippetResult?:
|
|
999
|
+
_snippetResult?: {
|
|
1000
|
+
[key: string]: SnippetResult;
|
|
1001
|
+
};
|
|
1113
1002
|
_rankingInfo?: RankingInfo;
|
|
1114
1003
|
_distinctSeqID?: number;
|
|
1115
1004
|
/**
|
|
@@ -1139,7 +1028,7 @@ type TrendingFacetHit = {
|
|
|
1139
1028
|
type RecommendationsHit = RecommendHit | TrendingFacetHit;
|
|
1140
1029
|
|
|
1141
1030
|
type RecommendationsHits = {
|
|
1142
|
-
hits: RecommendationsHit
|
|
1031
|
+
hits: Array<RecommendationsHit>;
|
|
1143
1032
|
};
|
|
1144
1033
|
|
|
1145
1034
|
type SearchPagination = {
|
|
@@ -1161,10 +1050,10 @@ type SearchPagination = {
|
|
|
1161
1050
|
hitsPerPage?: number;
|
|
1162
1051
|
};
|
|
1163
1052
|
|
|
1164
|
-
type RecommendationsResults = BaseSearchResponse &
|
|
1053
|
+
type RecommendationsResults = BaseSearchResponse & SearchPagination & RecommendationsHits;
|
|
1165
1054
|
|
|
1166
1055
|
type GetRecommendationsResponse = {
|
|
1167
|
-
results: RecommendationsResults
|
|
1056
|
+
results: Array<RecommendationsResults>;
|
|
1168
1057
|
};
|
|
1169
1058
|
|
|
1170
1059
|
/**
|
|
@@ -1212,7 +1101,7 @@ type ParamsConsequence = {
|
|
|
1212
1101
|
/**
|
|
1213
1102
|
* Filter recommendations that match or don\'t match the same `facet:facet_value` combination as the viewed item.
|
|
1214
1103
|
*/
|
|
1215
|
-
automaticFacetFilters?: AutoFacetFilter
|
|
1104
|
+
automaticFacetFilters?: Array<AutoFacetFilter>;
|
|
1216
1105
|
/**
|
|
1217
1106
|
* 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
1107
|
*/
|
|
@@ -1220,7 +1109,7 @@ type ParamsConsequence = {
|
|
|
1220
1109
|
/**
|
|
1221
1110
|
* 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
1111
|
*/
|
|
1223
|
-
optionalFilters?: string
|
|
1112
|
+
optionalFilters?: Array<string>;
|
|
1224
1113
|
};
|
|
1225
1114
|
|
|
1226
1115
|
/**
|
|
@@ -1244,11 +1133,11 @@ type Consequence = {
|
|
|
1244
1133
|
/**
|
|
1245
1134
|
* Exclude items from recommendations.
|
|
1246
1135
|
*/
|
|
1247
|
-
hide?: HideConsequenceObject
|
|
1136
|
+
hide?: Array<HideConsequenceObject>;
|
|
1248
1137
|
/**
|
|
1249
1138
|
* Place items at specific positions in the list of recommendations.
|
|
1250
1139
|
*/
|
|
1251
|
-
promote?: PromoteConsequenceObject
|
|
1140
|
+
promote?: Array<PromoteConsequenceObject>;
|
|
1252
1141
|
params?: ParamsConsequence;
|
|
1253
1142
|
};
|
|
1254
1143
|
|
|
@@ -1262,6 +1151,17 @@ type RuleMetadata = {
|
|
|
1262
1151
|
lastUpdate?: string;
|
|
1263
1152
|
};
|
|
1264
1153
|
|
|
1154
|
+
type TimeRange = {
|
|
1155
|
+
/**
|
|
1156
|
+
* When the rule should start to be active, in Unix epoch time.
|
|
1157
|
+
*/
|
|
1158
|
+
from: number;
|
|
1159
|
+
/**
|
|
1160
|
+
* When the rule should stop to be active, in Unix epoch time.
|
|
1161
|
+
*/
|
|
1162
|
+
until: number;
|
|
1163
|
+
};
|
|
1164
|
+
|
|
1265
1165
|
/**
|
|
1266
1166
|
* Recommend rule.
|
|
1267
1167
|
*/
|
|
@@ -1281,13 +1181,31 @@ type RecommendRule = {
|
|
|
1281
1181
|
* Indicates whether to enable the rule. If it isn\'t enabled, it isn\'t applied at query time.
|
|
1282
1182
|
*/
|
|
1283
1183
|
enabled?: boolean;
|
|
1184
|
+
/**
|
|
1185
|
+
* Time periods when the rule is active.
|
|
1186
|
+
*/
|
|
1187
|
+
validity?: Array<TimeRange>;
|
|
1188
|
+
};
|
|
1189
|
+
|
|
1190
|
+
/**
|
|
1191
|
+
* Response, taskID, and update timestamp.
|
|
1192
|
+
*/
|
|
1193
|
+
type RecommendUpdatedAtResponse = {
|
|
1194
|
+
/**
|
|
1195
|
+
* 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`.
|
|
1196
|
+
*/
|
|
1197
|
+
taskID: number;
|
|
1198
|
+
/**
|
|
1199
|
+
* Date and time when the object was updated, in RFC 3339 format.
|
|
1200
|
+
*/
|
|
1201
|
+
updatedAt: string;
|
|
1284
1202
|
};
|
|
1285
1203
|
|
|
1286
1204
|
type SearchRecommendRulesResponse = {
|
|
1287
1205
|
/**
|
|
1288
1206
|
* Recommend rules that match the search criteria.
|
|
1289
1207
|
*/
|
|
1290
|
-
hits: RecommendRule
|
|
1208
|
+
hits: Array<RecommendRule>;
|
|
1291
1209
|
/**
|
|
1292
1210
|
* Number of results (hits).
|
|
1293
1211
|
*/
|
|
@@ -1302,7 +1220,201 @@ type SearchRecommendRulesResponse = {
|
|
|
1302
1220
|
nbPages: number;
|
|
1303
1221
|
};
|
|
1304
1222
|
|
|
1305
|
-
|
|
1223
|
+
type RecommendModels = 'related-products' | 'bought-together' | 'trending-facets' | 'trending-items';
|
|
1224
|
+
|
|
1225
|
+
/**
|
|
1226
|
+
* Recommend rules parameters.
|
|
1227
|
+
*/
|
|
1228
|
+
type SearchRecommendRulesParams = {
|
|
1229
|
+
/**
|
|
1230
|
+
* Search query.
|
|
1231
|
+
*/
|
|
1232
|
+
query?: string;
|
|
1233
|
+
/**
|
|
1234
|
+
* Only search for rules with matching context.
|
|
1235
|
+
*/
|
|
1236
|
+
context?: string;
|
|
1237
|
+
/**
|
|
1238
|
+
* Requested page of the API response.
|
|
1239
|
+
*/
|
|
1240
|
+
page?: number;
|
|
1241
|
+
/**
|
|
1242
|
+
* Maximum number of hits per page.
|
|
1243
|
+
*/
|
|
1244
|
+
hitsPerPage?: number;
|
|
1245
|
+
/**
|
|
1246
|
+
* Whether to only show rules where the value of their `enabled` property matches this parameter. If absent, show all rules, regardless of their `enabled` property.
|
|
1247
|
+
*/
|
|
1248
|
+
enabled?: boolean;
|
|
1249
|
+
/**
|
|
1250
|
+
* Filter expression. This only searches for rules matching the filter expression.
|
|
1251
|
+
*/
|
|
1252
|
+
filters?: string;
|
|
1253
|
+
/**
|
|
1254
|
+
* Include facets and facet values in the response. Use `[\'*\']` to include all facets.
|
|
1255
|
+
*/
|
|
1256
|
+
facets?: Array<string>;
|
|
1257
|
+
/**
|
|
1258
|
+
* Maximum number of values to return for each facet.
|
|
1259
|
+
*/
|
|
1260
|
+
maxValuesPerFacet?: number;
|
|
1261
|
+
};
|
|
1262
|
+
|
|
1263
|
+
/**
|
|
1264
|
+
* Properties for the `batchRecommendRules` method.
|
|
1265
|
+
*/
|
|
1266
|
+
type BatchRecommendRulesProps = {
|
|
1267
|
+
/**
|
|
1268
|
+
* Name of the index on which to perform the operation.
|
|
1269
|
+
*/
|
|
1270
|
+
indexName: string;
|
|
1271
|
+
/**
|
|
1272
|
+
* [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
|
|
1273
|
+
*/
|
|
1274
|
+
model: RecommendModels;
|
|
1275
|
+
recommendRule?: Array<RecommendRule>;
|
|
1276
|
+
};
|
|
1277
|
+
/**
|
|
1278
|
+
* Properties for the `customDelete` method.
|
|
1279
|
+
*/
|
|
1280
|
+
type CustomDeleteProps = {
|
|
1281
|
+
/**
|
|
1282
|
+
* Path of the endpoint, anything after \"/1\" must be specified.
|
|
1283
|
+
*/
|
|
1284
|
+
path: string;
|
|
1285
|
+
/**
|
|
1286
|
+
* Query parameters to apply to the current query.
|
|
1287
|
+
*/
|
|
1288
|
+
parameters?: {
|
|
1289
|
+
[key: string]: any;
|
|
1290
|
+
};
|
|
1291
|
+
};
|
|
1292
|
+
/**
|
|
1293
|
+
* Properties for the `customGet` method.
|
|
1294
|
+
*/
|
|
1295
|
+
type CustomGetProps = {
|
|
1296
|
+
/**
|
|
1297
|
+
* Path of the endpoint, anything after \"/1\" must be specified.
|
|
1298
|
+
*/
|
|
1299
|
+
path: string;
|
|
1300
|
+
/**
|
|
1301
|
+
* Query parameters to apply to the current query.
|
|
1302
|
+
*/
|
|
1303
|
+
parameters?: {
|
|
1304
|
+
[key: string]: any;
|
|
1305
|
+
};
|
|
1306
|
+
};
|
|
1307
|
+
/**
|
|
1308
|
+
* Properties for the `customPost` method.
|
|
1309
|
+
*/
|
|
1310
|
+
type CustomPostProps = {
|
|
1311
|
+
/**
|
|
1312
|
+
* Path of the endpoint, anything after \"/1\" must be specified.
|
|
1313
|
+
*/
|
|
1314
|
+
path: string;
|
|
1315
|
+
/**
|
|
1316
|
+
* Query parameters to apply to the current query.
|
|
1317
|
+
*/
|
|
1318
|
+
parameters?: {
|
|
1319
|
+
[key: string]: any;
|
|
1320
|
+
};
|
|
1321
|
+
/**
|
|
1322
|
+
* Parameters to send with the custom request.
|
|
1323
|
+
*/
|
|
1324
|
+
body?: Record<string, unknown>;
|
|
1325
|
+
};
|
|
1326
|
+
/**
|
|
1327
|
+
* Properties for the `customPut` method.
|
|
1328
|
+
*/
|
|
1329
|
+
type CustomPutProps = {
|
|
1330
|
+
/**
|
|
1331
|
+
* Path of the endpoint, anything after \"/1\" must be specified.
|
|
1332
|
+
*/
|
|
1333
|
+
path: string;
|
|
1334
|
+
/**
|
|
1335
|
+
* Query parameters to apply to the current query.
|
|
1336
|
+
*/
|
|
1337
|
+
parameters?: {
|
|
1338
|
+
[key: string]: any;
|
|
1339
|
+
};
|
|
1340
|
+
/**
|
|
1341
|
+
* Parameters to send with the custom request.
|
|
1342
|
+
*/
|
|
1343
|
+
body?: Record<string, unknown>;
|
|
1344
|
+
};
|
|
1345
|
+
/**
|
|
1346
|
+
* Properties for the `deleteRecommendRule` method.
|
|
1347
|
+
*/
|
|
1348
|
+
type DeleteRecommendRuleProps = {
|
|
1349
|
+
/**
|
|
1350
|
+
* Name of the index on which to perform the operation.
|
|
1351
|
+
*/
|
|
1352
|
+
indexName: string;
|
|
1353
|
+
/**
|
|
1354
|
+
* [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
|
|
1355
|
+
*/
|
|
1356
|
+
model: RecommendModels;
|
|
1357
|
+
/**
|
|
1358
|
+
* Unique record identifier.
|
|
1359
|
+
*/
|
|
1360
|
+
objectID: string;
|
|
1361
|
+
};
|
|
1362
|
+
/**
|
|
1363
|
+
* Properties for the `getRecommendRule` method.
|
|
1364
|
+
*/
|
|
1365
|
+
type GetRecommendRuleProps = {
|
|
1366
|
+
/**
|
|
1367
|
+
* Name of the index on which to perform the operation.
|
|
1368
|
+
*/
|
|
1369
|
+
indexName: string;
|
|
1370
|
+
/**
|
|
1371
|
+
* [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
|
|
1372
|
+
*/
|
|
1373
|
+
model: RecommendModels;
|
|
1374
|
+
/**
|
|
1375
|
+
* Unique record identifier.
|
|
1376
|
+
*/
|
|
1377
|
+
objectID: string;
|
|
1378
|
+
};
|
|
1379
|
+
/**
|
|
1380
|
+
* Properties for the `getRecommendStatus` method.
|
|
1381
|
+
*/
|
|
1382
|
+
type GetRecommendStatusProps = {
|
|
1383
|
+
/**
|
|
1384
|
+
* Name of the index on which to perform the operation.
|
|
1385
|
+
*/
|
|
1386
|
+
indexName: string;
|
|
1387
|
+
/**
|
|
1388
|
+
* [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
|
|
1389
|
+
*/
|
|
1390
|
+
model: RecommendModels;
|
|
1391
|
+
/**
|
|
1392
|
+
* Unique task identifier.
|
|
1393
|
+
*/
|
|
1394
|
+
taskID: number;
|
|
1395
|
+
};
|
|
1396
|
+
/**
|
|
1397
|
+
* Recommend method signature compatible with the `algoliasearch` v4 package. When using this signature, extra computation will be required to make it match the new signature.
|
|
1398
|
+
*
|
|
1399
|
+
* @deprecated This signature will be removed from the next major version, we recommend using the `GetRecommendationsParams` type for performances and future proof reasons.
|
|
1400
|
+
*/
|
|
1401
|
+
type LegacyGetRecommendationsParams = RecommendationsRequest[];
|
|
1402
|
+
/**
|
|
1403
|
+
* Properties for the `searchRecommendRules` method.
|
|
1404
|
+
*/
|
|
1405
|
+
type SearchRecommendRulesProps = {
|
|
1406
|
+
/**
|
|
1407
|
+
* Name of the index on which to perform the operation.
|
|
1408
|
+
*/
|
|
1409
|
+
indexName: string;
|
|
1410
|
+
/**
|
|
1411
|
+
* [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
|
|
1412
|
+
*/
|
|
1413
|
+
model: RecommendModels;
|
|
1414
|
+
searchRecommendRulesParams?: SearchRecommendRulesParams;
|
|
1415
|
+
};
|
|
1416
|
+
|
|
1417
|
+
declare const apiClientVersion = "5.8.0";
|
|
1306
1418
|
declare function createRecommendClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, ...options }: CreateClientOptions): {
|
|
1307
1419
|
transporter: _algolia_client_common.Transporter;
|
|
1308
1420
|
/**
|
|
@@ -1334,8 +1446,19 @@ declare function createRecommendClient({ appId: appIdOption, apiKey: apiKeyOptio
|
|
|
1334
1446
|
apiKey: string;
|
|
1335
1447
|
}): void;
|
|
1336
1448
|
/**
|
|
1337
|
-
*
|
|
1449
|
+
* 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).
|
|
1338
1450
|
*
|
|
1451
|
+
* Required API Key ACLs:
|
|
1452
|
+
* - editSettings
|
|
1453
|
+
* @param batchRecommendRules - The batchRecommendRules object.
|
|
1454
|
+
* @param batchRecommendRules.indexName - Name of the index on which to perform the operation.
|
|
1455
|
+
* @param batchRecommendRules.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
|
|
1456
|
+
* @param batchRecommendRules.recommendRule - The recommendRule object.
|
|
1457
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1458
|
+
*/
|
|
1459
|
+
batchRecommendRules({ indexName, model, recommendRule }: BatchRecommendRulesProps, requestOptions?: RequestOptions): Promise<RecommendUpdatedAtResponse>;
|
|
1460
|
+
/**
|
|
1461
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
1339
1462
|
* @param customDelete - The customDelete object.
|
|
1340
1463
|
* @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
1341
1464
|
* @param customDelete.parameters - Query parameters to apply to the current query.
|
|
@@ -1344,7 +1467,6 @@ declare function createRecommendClient({ appId: appIdOption, apiKey: apiKeyOptio
|
|
|
1344
1467
|
customDelete({ path, parameters }: CustomDeleteProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
|
|
1345
1468
|
/**
|
|
1346
1469
|
* This method allow you to send requests to the Algolia REST API.
|
|
1347
|
-
*
|
|
1348
1470
|
* @param customGet - The customGet object.
|
|
1349
1471
|
* @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
1350
1472
|
* @param customGet.parameters - Query parameters to apply to the current query.
|
|
@@ -1353,7 +1475,6 @@ declare function createRecommendClient({ appId: appIdOption, apiKey: apiKeyOptio
|
|
|
1353
1475
|
customGet({ path, parameters }: CustomGetProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
|
|
1354
1476
|
/**
|
|
1355
1477
|
* This method allow you to send requests to the Algolia REST API.
|
|
1356
|
-
*
|
|
1357
1478
|
* @param customPost - The customPost object.
|
|
1358
1479
|
* @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
1359
1480
|
* @param customPost.parameters - Query parameters to apply to the current query.
|
|
@@ -1363,7 +1484,6 @@ declare function createRecommendClient({ appId: appIdOption, apiKey: apiKeyOptio
|
|
|
1363
1484
|
customPost({ path, parameters, body }: CustomPostProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
|
|
1364
1485
|
/**
|
|
1365
1486
|
* This method allow you to send requests to the Algolia REST API.
|
|
1366
|
-
*
|
|
1367
1487
|
* @param customPut - The customPut object.
|
|
1368
1488
|
* @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
1369
1489
|
* @param customPut.parameters - Query parameters to apply to the current query.
|
|
@@ -1375,8 +1495,7 @@ declare function createRecommendClient({ appId: appIdOption, apiKey: apiKeyOptio
|
|
|
1375
1495
|
* Deletes a Recommend rule from a recommendation scenario.
|
|
1376
1496
|
*
|
|
1377
1497
|
* Required API Key ACLs:
|
|
1378
|
-
*
|
|
1379
|
-
*
|
|
1498
|
+
* - editSettings
|
|
1380
1499
|
* @param deleteRecommendRule - The deleteRecommendRule object.
|
|
1381
1500
|
* @param deleteRecommendRule.indexName - Name of the index on which to perform the operation.
|
|
1382
1501
|
* @param deleteRecommendRule.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
|
|
@@ -1388,8 +1507,7 @@ declare function createRecommendClient({ appId: appIdOption, apiKey: apiKeyOptio
|
|
|
1388
1507
|
* Retrieves a Recommend rule that you previously created in the Algolia dashboard.
|
|
1389
1508
|
*
|
|
1390
1509
|
* Required API Key ACLs:
|
|
1391
|
-
*
|
|
1392
|
-
*
|
|
1510
|
+
* - settings
|
|
1393
1511
|
* @param getRecommendRule - The getRecommendRule object.
|
|
1394
1512
|
* @param getRecommendRule.indexName - Name of the index on which to perform the operation.
|
|
1395
1513
|
* @param getRecommendRule.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
|
|
@@ -1401,8 +1519,7 @@ declare function createRecommendClient({ appId: appIdOption, apiKey: apiKeyOptio
|
|
|
1401
1519
|
* Checks the status of a given task. Deleting a Recommend rule is asynchronous. When you delete a rule, a task is created on a queue and completed depending on the load on the server. The API response includes a task ID that you can use to check the status.
|
|
1402
1520
|
*
|
|
1403
1521
|
* Required API Key ACLs:
|
|
1404
|
-
*
|
|
1405
|
-
*
|
|
1522
|
+
* - editSettings
|
|
1406
1523
|
* @param getRecommendStatus - The getRecommendStatus object.
|
|
1407
1524
|
* @param getRecommendStatus.indexName - Name of the index on which to perform the operation.
|
|
1408
1525
|
* @param getRecommendStatus.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
|
|
@@ -1414,8 +1531,7 @@ declare function createRecommendClient({ appId: appIdOption, apiKey: apiKeyOptio
|
|
|
1414
1531
|
* Retrieves recommendations from selected AI models.
|
|
1415
1532
|
*
|
|
1416
1533
|
* Required API Key ACLs:
|
|
1417
|
-
*
|
|
1418
|
-
*
|
|
1534
|
+
* - search
|
|
1419
1535
|
* @param getRecommendationsParams - The getRecommendationsParams object.
|
|
1420
1536
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1421
1537
|
*/
|
|
@@ -1424,8 +1540,7 @@ declare function createRecommendClient({ appId: appIdOption, apiKey: apiKeyOptio
|
|
|
1424
1540
|
* Searches for Recommend rules. Use an empty query to list all rules for this recommendation scenario.
|
|
1425
1541
|
*
|
|
1426
1542
|
* Required API Key ACLs:
|
|
1427
|
-
*
|
|
1428
|
-
*
|
|
1543
|
+
* - settings
|
|
1429
1544
|
* @param searchRecommendRules - The searchRecommendRules object.
|
|
1430
1545
|
* @param searchRecommendRules.indexName - Name of the index on which to perform the operation.
|
|
1431
1546
|
* @param searchRecommendRules.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
|
|
@@ -1446,4 +1561,4 @@ type RecommendClient = ReturnType<typeof createRecommendClient>;
|
|
|
1446
1561
|
|
|
1447
1562
|
declare function recommendClient(appId: string, apiKey: string, options?: ClientOptions): RecommendClient;
|
|
1448
1563
|
|
|
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 };
|
|
1564
|
+
export { type AdvancedSyntaxFeatures, type AlternativesAsExact, type AroundPrecision, type AroundRadius, type AroundRadiusAll, type AutoFacetFilter, type Banner, type BannerImage, type BannerImageUrl, type BannerLink, type Banners, 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, type Widgets, apiClientVersion, recommendClient };
|