algoliasearch 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.
Files changed (110) hide show
  1. package/README.md +6 -8
  2. package/builds/browser.ts +5 -4
  3. package/builds/fetch.ts +5 -4
  4. package/builds/models.ts +30 -16
  5. package/builds/node.ts +5 -4
  6. package/dist/algoliasearch.umd.js +1 -1
  7. package/dist/browser.d.ts +1 -1
  8. package/dist/browser.js +6 -6
  9. package/dist/browser.js.map +1 -1
  10. package/dist/browser.min.js +1 -1
  11. package/dist/browser.min.js.map +1 -1
  12. package/dist/fetch.d.ts +1 -1
  13. package/dist/fetch.js +6 -6
  14. package/dist/fetch.js.map +1 -1
  15. package/dist/lite/browser.d.ts +646 -583
  16. package/dist/lite/builds/browser.js +8 -11
  17. package/dist/lite/builds/browser.js.map +1 -1
  18. package/dist/lite/builds/browser.min.js +1 -1
  19. package/dist/lite/builds/browser.min.js.map +1 -1
  20. package/dist/lite/builds/browser.umd.js +2 -2
  21. package/dist/lite/builds/node.cjs +5 -8
  22. package/dist/lite/builds/node.cjs.map +1 -1
  23. package/dist/lite/builds/node.js +6 -9
  24. package/dist/lite/builds/node.js.map +1 -1
  25. package/dist/lite/node.d.cts +646 -582
  26. package/dist/lite/node.d.ts +646 -582
  27. package/dist/lite/src/liteClient.cjs +4 -7
  28. package/dist/lite/src/liteClient.cjs.map +1 -1
  29. package/dist/lite/src/liteClient.js +4 -7
  30. package/dist/lite/src/liteClient.js.map +1 -1
  31. package/dist/node.cjs +3 -3
  32. package/dist/node.cjs.map +1 -1
  33. package/dist/node.d.cts +1 -1
  34. package/dist/node.d.ts +1 -1
  35. package/dist/node.js +6 -6
  36. package/dist/node.js.map +1 -1
  37. package/index.js +1 -1
  38. package/lite/builds/browser.ts +11 -9
  39. package/lite/builds/node.ts +8 -6
  40. package/lite/model/acl.ts +1 -1
  41. package/lite/model/alternativesAsExact.ts +1 -1
  42. package/lite/model/apiKey.ts +4 -4
  43. package/lite/model/aroundPrecision.ts +1 -1
  44. package/lite/model/aroundRadius.ts +1 -1
  45. package/lite/model/automaticFacetFilters.ts +1 -1
  46. package/lite/model/banner.ts +13 -0
  47. package/lite/model/bannerImage.ts +12 -0
  48. package/lite/model/bannerImageUrl.ts +8 -0
  49. package/lite/model/bannerLink.ts +8 -0
  50. package/lite/model/banners.ts +10 -0
  51. package/lite/model/baseIndexSettings.ts +15 -15
  52. package/lite/model/baseRecommendIndexSettings.ts +14 -14
  53. package/lite/model/baseRecommendSearchParams.ts +8 -8
  54. package/lite/model/baseSearchParams.ts +1 -1
  55. package/lite/model/baseSearchParamsWithoutQuery.ts +8 -8
  56. package/lite/model/baseSearchResponse.ts +2 -2
  57. package/lite/model/booleanString.ts +1 -1
  58. package/lite/model/browseParamsObject.ts +1 -1
  59. package/lite/model/browseResponse.ts +1 -1
  60. package/lite/model/clientMethodProps.ts +2 -2
  61. package/lite/model/consequenceQueryObject.ts +2 -2
  62. package/lite/model/facetFilters.ts +1 -1
  63. package/lite/model/facetOrdering.ts +1 -1
  64. package/lite/model/getApiKeyResponse.ts +1 -1
  65. package/lite/model/getRecommendationsParams.ts +1 -1
  66. package/lite/model/getRecommendationsResponse.ts +1 -1
  67. package/lite/model/highlightResult.ts +1 -1
  68. package/lite/model/highlightResultOption.ts +1 -1
  69. package/lite/model/hit.ts +2 -2
  70. package/lite/model/ignorePlurals.ts +1 -1
  71. package/lite/model/index.ts +13 -7
  72. package/lite/model/indexSettingsAsSearchParams.ts +15 -15
  73. package/lite/model/indexSettingsFacets.ts +1 -1
  74. package/lite/model/matchLevel.ts +1 -1
  75. package/lite/model/mode.ts +1 -1
  76. package/lite/model/numericFilters.ts +2 -2
  77. package/lite/model/optionalFilters.ts +1 -1
  78. package/lite/model/queryType.ts +2 -2
  79. package/lite/model/reRankingApplyFilter.ts +1 -1
  80. package/lite/model/recommendHit.ts +2 -2
  81. package/lite/model/recommendSearchParams.ts +1 -1
  82. package/lite/model/recommendationsHit.ts +1 -0
  83. package/lite/model/recommendationsHits.ts +1 -1
  84. package/lite/model/recommendationsRequest.ts +5 -3
  85. package/lite/model/recommendationsResults.ts +1 -1
  86. package/lite/model/redirect.ts +1 -1
  87. package/lite/model/removeStopWords.ts +1 -1
  88. package/lite/model/removeWordsIfNoResults.ts +1 -1
  89. package/lite/model/renderingContent.ts +4 -1
  90. package/lite/model/searchForFacetValuesResponse.ts +1 -1
  91. package/lite/model/searchForFacets.ts +1 -1
  92. package/lite/model/searchForHits.ts +1 -1
  93. package/lite/model/searchHits.ts +1 -1
  94. package/lite/model/searchMethodParams.ts +1 -1
  95. package/lite/model/searchParams.ts +1 -1
  96. package/lite/model/searchQuery.ts +1 -1
  97. package/lite/model/searchResponse.ts +1 -1
  98. package/lite/model/searchResponses.ts +1 -1
  99. package/lite/model/searchResult.ts +1 -1
  100. package/lite/model/semanticSearch.ts +1 -1
  101. package/lite/model/snippetResult.ts +1 -1
  102. package/lite/model/sortRemainingBy.ts +1 -1
  103. package/lite/model/supportedLanguage.ts +1 -1
  104. package/lite/model/tagFilters.ts +1 -1
  105. package/lite/model/typoTolerance.ts +2 -2
  106. package/lite/model/value.ts +2 -2
  107. package/lite/model/widgets.ts +10 -0
  108. package/lite/src/liteClient.ts +15 -15
  109. package/lite.js +1 -1
  110. package/package.json +14 -14
@@ -18,7 +18,7 @@ type Range = {
18
18
  /**
19
19
  * 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.
20
20
  */
21
- type AroundPrecision = Range[] | number;
21
+ type AroundPrecision = number | Array<Range>;
22
22
 
23
23
  /**
24
24
  * Return all records with a valid `_geoloc` attribute. Don\'t filter by distance.
@@ -28,32 +28,32 @@ type AroundRadiusAll = 'all';
28
28
  /**
29
29
  * 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.
30
30
  */
31
- type AroundRadius = AroundRadiusAll | number;
31
+ type AroundRadius = number | AroundRadiusAll;
32
32
 
33
33
  /**
34
34
  * 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`.
35
35
  */
36
- type FacetFilters = FacetFilters[] | string;
36
+ type FacetFilters = Array<FacetFilters> | string;
37
37
 
38
38
  /**
39
- * 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: `<`, `<=`, `=`, `!=`, `>`, `>=`. Comparsions 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`.
39
+ * 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`.
40
40
  */
41
- type NumericFilters = NumericFilters[] | string;
41
+ type NumericFilters = Array<NumericFilters> | string;
42
42
 
43
43
  /**
44
44
  * 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.
45
45
  */
46
- type OptionalFilters = OptionalFilters[] | string;
46
+ type OptionalFilters = Array<OptionalFilters> | string;
47
47
 
48
48
  /**
49
49
  * ISO code for a supported language.
50
50
  */
51
- 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-br' | 'pt' | 'qu' | 'ro' | 'ru' | 'sk' | 'sq' | 'sv' | 'sw' | 'ta' | 'te' | 'th' | 'tl' | 'tn' | 'tr' | 'tt' | 'uk' | 'ur' | 'uz' | 'zh';
51
+ 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';
52
52
 
53
53
  /**
54
54
  * 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`.
55
55
  */
56
- type TagFilters = TagFilters[] | string;
56
+ type TagFilters = Array<TagFilters> | string;
57
57
 
58
58
  type BaseRecommendSearchParams = {
59
59
  /**
@@ -75,17 +75,17 @@ type BaseRecommendSearchParams = {
75
75
  /**
76
76
  * Restricts a search to a subset of your searchable attributes. Attribute names are case-sensitive.
77
77
  */
78
- restrictSearchableAttributes?: string[];
78
+ restrictSearchableAttributes?: Array<string>;
79
79
  /**
80
80
  * 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).
81
81
  */
82
- facets?: string[];
82
+ facets?: Array<string>;
83
83
  /**
84
84
  * 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`.
85
85
  */
86
86
  facetingAfterDistinct?: boolean;
87
87
  /**
88
- * 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`.
88
+ * 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`.
89
89
  */
90
90
  aroundLatLng?: string;
91
91
  /**
@@ -101,19 +101,19 @@ type BaseRecommendSearchParams = {
101
101
  /**
102
102
  * 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).
103
103
  */
104
- insideBoundingBox?: number[][];
104
+ insideBoundingBox?: Array<Array<number>>;
105
105
  /**
106
106
  * 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`.
107
107
  */
108
- insidePolygon?: number[][];
108
+ insidePolygon?: Array<Array<number>>;
109
109
  /**
110
110
  * 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`.
111
111
  */
112
- naturalLanguages?: SupportedLanguage[];
112
+ naturalLanguages?: Array<SupportedLanguage>;
113
113
  /**
114
114
  * 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.
115
115
  */
116
- ruleContexts?: string[];
116
+ ruleContexts?: Array<string>;
117
117
  /**
118
118
  * 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).
119
119
  */
@@ -141,7 +141,7 @@ type BaseRecommendSearchParams = {
141
141
  /**
142
142
  * Tags to apply to the query for [segmenting analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).
143
143
  */
144
- analyticsTags?: string[];
144
+ analyticsTags?: Array<string>;
145
145
  /**
146
146
  * Whether to include this search when calculating processing-time percentiles.
147
147
  */
@@ -154,13 +154,13 @@ type BaseRecommendSearchParams = {
154
154
 
155
155
  type BaseIndexSettings = {
156
156
  /**
157
- * 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 using this attribute as a filter, but doesn\'t evalue 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))`.
157
+ * 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))`.
158
158
  */
159
- attributesForFaceting?: string[];
159
+ attributesForFaceting?: Array<string>;
160
160
  /**
161
- * 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 by 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/).
161
+ * 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/).
162
162
  */
163
- replicas?: string[];
163
+ replicas?: Array<string>;
164
164
  /**
165
165
  * 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.
166
166
  */
@@ -168,19 +168,19 @@ type BaseIndexSettings = {
168
168
  /**
169
169
  * 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.
170
170
  */
171
- unretrievableAttributes?: string[];
171
+ unretrievableAttributes?: Array<string>;
172
172
  /**
173
173
  * 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.
174
174
  */
175
- disableTypoToleranceOnWords?: string[];
175
+ disableTypoToleranceOnWords?: Array<string>;
176
176
  /**
177
177
  * 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.
178
178
  */
179
- attributesToTransliterate?: string[];
179
+ attributesToTransliterate?: Array<string>;
180
180
  /**
181
181
  * Attributes for which to split [camel case](https://wikipedia.org/wiki/Camel_case) words. Attribute names are case-sensitive.
182
182
  */
183
- camelCaseAttributes?: string[];
183
+ camelCaseAttributes?: Array<string>;
184
184
  /**
185
185
  * 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).
186
186
  */
@@ -188,27 +188,27 @@ type BaseIndexSettings = {
188
188
  /**
189
189
  * 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/).
190
190
  */
191
- indexLanguages?: SupportedLanguage[];
191
+ indexLanguages?: Array<SupportedLanguage>;
192
192
  /**
193
193
  * 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.
194
194
  */
195
- disablePrefixOnAttributes?: string[];
195
+ disablePrefixOnAttributes?: Array<string>;
196
196
  /**
197
197
  * Whether arrays with exclusively non-negative integers should be compressed for better performance. If true, the compressed arrays may be reordered.
198
198
  */
199
199
  allowCompressionOfIntegerArray?: boolean;
200
200
  /**
201
- * 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. If you want to turn off filtering for all numeric attributes, specifiy 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 `!=`.
201
+ * 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 `!=`.
202
202
  */
203
- numericAttributesForFiltering?: string[];
203
+ numericAttributesForFiltering?: Array<string>;
204
204
  /**
205
205
  * 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.
206
206
  */
207
207
  separatorsToIndex?: string;
208
208
  /**
209
- * 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 higer than matches at the end.
209
+ * 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.
210
210
  */
211
- searchableAttributes?: string[];
211
+ searchableAttributes?: Array<string>;
212
212
  /**
213
213
  * An object with custom data. You can store up to 32kB as custom data.
214
214
  */
@@ -216,7 +216,11 @@ type BaseIndexSettings = {
216
216
  /**
217
217
  * 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/).
218
218
  */
219
- customNormalization?: Record<string, Record<string, string>>;
219
+ customNormalization?: {
220
+ [key: string]: {
221
+ [key: string]: string;
222
+ };
223
+ };
220
224
  /**
221
225
  * 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.
222
226
  */
@@ -225,7 +229,7 @@ type BaseIndexSettings = {
225
229
 
226
230
  type AdvancedSyntaxFeatures = 'exactPhrase' | 'excludeWords';
227
231
 
228
- type AlternativesAsExact = 'ignorePlurals' | 'multiWordsSynonym' | 'singleWordSynonym';
232
+ type AlternativesAsExact = 'ignorePlurals' | 'singleWordSynonym' | 'multiWordsSynonym';
229
233
 
230
234
  /**
231
235
  * 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.
@@ -237,32 +241,32 @@ type Distinct = boolean | number;
237
241
  */
238
242
  type ExactOnSingleWordQuery = 'attribute' | 'none' | 'word';
239
243
 
240
- type BooleanString = 'false' | 'true';
244
+ type BooleanString = 'true' | 'false';
241
245
 
242
246
  /**
243
247
  * Treat singular, plurals, and other forms of declensions as equivalent. You should only use this feature for the languages used in your index.
244
248
  */
245
- type IgnorePlurals = BooleanString | SupportedLanguage[] | boolean;
249
+ type IgnorePlurals = Array<SupportedLanguage> | BooleanString | boolean;
246
250
 
247
251
  /**
248
- * 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/).
252
+ * 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/).
249
253
  */
250
- type QueryType = 'prefixAll' | 'prefixLast' | 'prefixNone';
254
+ type QueryType = 'prefixLast' | 'prefixAll' | 'prefixNone';
251
255
 
252
256
  /**
253
257
  * Restrict [Dynamic Re-Ranking](https://www.algolia.com/doc/guides/algolia-ai/re-ranking/) to records that match these filters.
254
258
  */
255
- type ReRankingApplyFilter = ReRankingApplyFilter[] | string;
259
+ type ReRankingApplyFilter = Array<ReRankingApplyFilter> | string;
256
260
 
257
261
  /**
258
262
  * 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.
259
263
  */
260
- type RemoveStopWords = SupportedLanguage[] | boolean;
264
+ type RemoveStopWords = Array<SupportedLanguage> | boolean;
261
265
 
262
266
  /**
263
267
  * 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/).
264
268
  */
265
- type RemoveWordsIfNoResults = 'allOptional' | 'firstWords' | 'lastWords' | 'none';
269
+ type RemoveWordsIfNoResults = 'none' | 'lastWords' | 'firstWords' | 'allOptional';
266
270
 
267
271
  /**
268
272
  * Order of facet names.
@@ -271,24 +275,24 @@ type IndexSettingsFacets = {
271
275
  /**
272
276
  * Explicit order of facets or facet values. This setting lets you always show specific facets or facet values at the top of the list.
273
277
  */
274
- order?: string[];
278
+ order?: Array<string>;
275
279
  };
276
280
 
277
281
  /**
278
282
  * 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.
279
283
  */
280
- type SortRemainingBy = 'alpha' | 'count' | 'hidden';
284
+ type SortRemainingBy = 'count' | 'alpha' | 'hidden';
281
285
 
282
286
  type Value = {
283
287
  /**
284
288
  * Explicit order of facets or facet values. This setting lets you always show specific facets or facet values at the top of the list.
285
289
  */
286
- order?: string[];
290
+ order?: Array<string>;
287
291
  sortRemainingBy?: SortRemainingBy;
288
292
  /**
289
293
  * Hide facet values.
290
294
  */
291
- hide?: string[];
295
+ hide?: Array<string>;
292
296
  };
293
297
 
294
298
  /**
@@ -299,7 +303,9 @@ type FacetOrdering = {
299
303
  /**
300
304
  * Order of facet values. One object for each facet.
301
305
  */
302
- values?: Record<string, Value>;
306
+ values?: {
307
+ [key: string]: Value;
308
+ };
303
309
  };
304
310
 
305
311
  /**
@@ -310,11 +316,56 @@ type RedirectURL = {
310
316
  };
311
317
 
312
318
  /**
313
- * 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.
319
+ * url for a search banner image.
320
+ */
321
+ type BannerImageUrl = {
322
+ url?: string;
323
+ };
324
+
325
+ /**
326
+ * image of a search banner.
327
+ */
328
+ type BannerImage = {
329
+ urls?: BannerImageUrl;
330
+ title?: string;
331
+ };
332
+
333
+ /**
334
+ * link for a banner defined in merchandising studio.
335
+ */
336
+ type BannerLink = {
337
+ url?: string;
338
+ };
339
+
340
+ /**
341
+ * a search banner with image and url.
342
+ */
343
+ type Banner = {
344
+ image?: BannerImage;
345
+ link?: BannerLink;
346
+ };
347
+
348
+ /**
349
+ * banners defined in the merchandising studio for the given search.
350
+ */
351
+ type Banners = {
352
+ banners?: Banner;
353
+ };
354
+
355
+ /**
356
+ * widgets returned from any rules that are applied to the current search.
357
+ */
358
+ type Widgets = {
359
+ banners?: Banners;
360
+ };
361
+
362
+ /**
363
+ * 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.
314
364
  */
315
365
  type RenderingContent = {
316
366
  facetOrdering?: FacetOrdering;
317
367
  redirect?: RedirectURL;
368
+ widgets?: Widgets;
318
369
  };
319
370
 
320
371
  /**
@@ -323,19 +374,19 @@ type RenderingContent = {
323
374
  type TypoToleranceEnum = 'min' | 'strict';
324
375
 
325
376
  /**
326
- * 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 concetenation](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/splitting-and-concatenation/) is also active.
377
+ * 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.
327
378
  */
328
- type TypoTolerance = TypoToleranceEnum | boolean;
379
+ type TypoTolerance = boolean | TypoToleranceEnum;
329
380
 
330
381
  type BaseRecommendIndexSettings = {
331
382
  /**
332
383
  * 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.
333
384
  */
334
- attributesToRetrieve?: string[];
385
+ attributesToRetrieve?: Array<string>;
335
386
  /**
336
387
  * 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/).
337
388
  */
338
- ranking?: string[];
389
+ ranking?: Array<string>;
339
390
  /**
340
391
  * 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.
341
392
  */
@@ -343,11 +394,11 @@ type BaseRecommendIndexSettings = {
343
394
  /**
344
395
  * 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/).
345
396
  */
346
- attributesToHighlight?: string[];
397
+ attributesToHighlight?: Array<string>;
347
398
  /**
348
399
  * 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.
349
400
  */
350
- attributesToSnippet?: string[];
401
+ attributesToSnippet?: Array<string>;
351
402
  /**
352
403
  * HTML tag to insert before the highlighted parts in all highlighted results and snippets.
353
404
  */
@@ -380,13 +431,13 @@ type BaseRecommendIndexSettings = {
380
431
  /**
381
432
  * 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.
382
433
  */
383
- disableTypoToleranceOnAttributes?: string[];
434
+ disableTypoToleranceOnAttributes?: Array<string>;
384
435
  ignorePlurals?: IgnorePlurals;
385
436
  removeStopWords?: RemoveStopWords;
386
437
  /**
387
438
  * 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/).
388
439
  */
389
- queryLanguages?: SupportedLanguage[];
440
+ queryLanguages?: Array<SupportedLanguage>;
390
441
  /**
391
442
  * 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).
392
443
  */
@@ -406,25 +457,25 @@ type BaseRecommendIndexSettings = {
406
457
  */
407
458
  advancedSyntax?: boolean;
408
459
  /**
409
- * 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 dividied 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).
460
+ * 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).
410
461
  */
411
- optionalWords?: string[];
462
+ optionalWords?: Array<string>;
412
463
  /**
413
- * 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 likelyhood 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.
464
+ * 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.
414
465
  */
415
- disableExactOnAttributes?: string[];
466
+ disableExactOnAttributes?: Array<string>;
416
467
  exactOnSingleWordQuery?: ExactOnSingleWordQuery;
417
468
  /**
418
469
  * 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.
419
470
  */
420
- alternativesAsExact?: AlternativesAsExact[];
471
+ alternativesAsExact?: Array<AlternativesAsExact>;
421
472
  /**
422
473
  * 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.
423
474
  */
424
- advancedSyntaxFeatures?: AdvancedSyntaxFeatures[];
475
+ advancedSyntaxFeatures?: Array<AdvancedSyntaxFeatures>;
425
476
  distinct?: Distinct;
426
477
  /**
427
- * 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 occurences of \"house\" are replaced by \"home\" in the highlighted response.
478
+ * 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.
428
479
  */
429
480
  replaceSynonymsInHighlight?: boolean;
430
481
  /**
@@ -434,7 +485,7 @@ type BaseRecommendIndexSettings = {
434
485
  /**
435
486
  * 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.
436
487
  */
437
- responseFields?: string[];
488
+ responseFields?: Array<string>;
438
489
  /**
439
490
  * 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).
440
491
  */
@@ -474,7 +525,7 @@ type SearchParamsQuery = {
474
525
  /**
475
526
  * Search parameters for filtering the recommendations.
476
527
  */
477
- type RecommendSearchParams = BaseRecommendSearchParams & RecommendIndexSettings & SearchParamsQuery;
528
+ type RecommendSearchParams = BaseRecommendSearchParams & SearchParamsQuery & RecommendIndexSettings;
478
529
 
479
530
  type BaseRecommendRequest = {
480
531
  /**
@@ -589,757 +640,744 @@ type TrendingItems = {
589
640
 
590
641
  type TrendingItemsQuery = BaseRecommendRequest & TrendingItems;
591
642
 
592
- type RecommendationsRequest = BoughtTogetherQuery | LookingSimilarQuery | RecommendedForYouQuery | RelatedQuery | TrendingFacetsQuery | TrendingItemsQuery;
643
+ type RecommendationsRequest = BoughtTogetherQuery | RelatedQuery | TrendingItemsQuery | TrendingFacetsQuery | LookingSimilarQuery | RecommendedForYouQuery;
593
644
 
594
645
  /**
595
- * - `default`: perform a search query - `facet` [searches for facet values](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#search-for-facet-values).
646
+ * Recommend request body.
596
647
  */
597
- type SearchTypeFacet = 'facet';
648
+ type GetRecommendationsParams = {
649
+ /**
650
+ * Recommendation request with parameters depending on the requested model.
651
+ */
652
+ requests: Array<RecommendationsRequest>;
653
+ };
598
654
 
599
- type SearchForFacetsOptions = {
655
+ /**
656
+ * Whether certain properties of the search response are calculated exhaustive (exact) or approximated.
657
+ */
658
+ type Exhaustive = {
600
659
  /**
601
- * Facet name.
660
+ * Whether the facet count is exhaustive (`true`) or approximate (`false`). See the [related discussion](https://support.algolia.com/hc/en-us/articles/4406975248145-Why-are-my-facet-and-hit-counts-not-accurate-).
602
661
  */
603
- facet: string;
662
+ facetsCount?: boolean;
604
663
  /**
605
- * Index name (case-sensitive).
664
+ * The value is `false` if not all facet values are retrieved.
606
665
  */
607
- indexName: string;
666
+ facetValues?: boolean;
608
667
  /**
609
- * Text to search inside the facet\'s values.
668
+ * Whether the `nbHits` is exhaustive (`true`) or approximate (`false`). When the query takes more than 50ms to be processed, the engine makes an approximation. This can happen when using complex filters on millions of records, when typo-tolerance was not exhaustive, or when enough hits have been retrieved (for example, after the engine finds 10,000 exact matches). `nbHits` is reported as non-exhaustive whenever an approximation is made, even if the approximation didn’t, in the end, impact the exhaustivity of the query.
610
669
  */
611
- facetQuery?: string;
670
+ nbHits?: boolean;
612
671
  /**
613
- * 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).
672
+ * Rules matching exhaustivity. The value is `false` if rules were enable for this query, and could not be fully processed due a timeout. This is generally caused by the number of alternatives (such as typos) which is too large.
614
673
  */
615
- maxFacetHits?: number;
616
- type: SearchTypeFacet;
674
+ rulesMatch?: boolean;
675
+ /**
676
+ * Whether the typo search was exhaustive (`true`) or approximate (`false`). An approximation is done when the typo search query part takes more than 10% of the query budget (ie. 5ms by default) to be processed (this can happen when a lot of typo alternatives exist for the query). This field will not be included when typo-tolerance is entirely disabled.
677
+ */
678
+ typo?: boolean;
679
+ };
680
+
681
+ type FacetStats = {
682
+ /**
683
+ * Minimum value in the results.
684
+ */
685
+ min?: number;
686
+ /**
687
+ * Maximum value in the results.
688
+ */
689
+ max?: number;
690
+ /**
691
+ * Average facet value in the results.
692
+ */
693
+ avg?: number;
694
+ /**
695
+ * Sum of all values in the results.
696
+ */
697
+ sum?: number;
617
698
  };
618
699
 
619
700
  /**
620
- * - `default`: perform a search query - `facet` [searches for facet values](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#search-for-facet-values).
701
+ * Redirect rule data.
621
702
  */
622
- type SearchTypeDefault = 'default';
703
+ type RedirectRuleIndexData = {
704
+ ruleObjectID: string;
705
+ };
623
706
 
624
- type SearchForHitsOptions = {
707
+ type RedirectRuleIndexMetadata = {
625
708
  /**
626
- * Index name (case-sensitive).
709
+ * Source index for the redirect rule.
627
710
  */
628
- indexName: string;
629
- type?: SearchTypeDefault;
630
- } & {
631
- facet?: never;
632
- maxFacetHits?: never;
633
- facetQuery?: never;
634
- };
635
-
636
- type BaseSearchParamsWithoutQuery = {
711
+ source: string;
637
712
  /**
638
- * Keywords to be used instead of the search query to conduct a more broader search. Using the `similarQuery` parameter changes other settings: - `queryType` is set to `prefixNone`. - `removeStopWords` is set to true. - `words` is set as the first ranking criterion. - All remaining words are treated as `optionalWords`. Since the `similarQuery` is supposed to do a broad search, they usually return many results. Combine it with `filters` to narrow down the list of results.
713
+ * Destination index for the redirect rule.
639
714
  */
640
- similarQuery?: string;
715
+ dest: string;
641
716
  /**
642
- * 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/).
717
+ * Reason for the redirect rule.
643
718
  */
644
- filters?: string;
645
- facetFilters?: FacetFilters;
646
- optionalFilters?: OptionalFilters;
647
- numericFilters?: NumericFilters;
648
- tagFilters?: TagFilters;
719
+ reason: string;
649
720
  /**
650
- * Whether to sum all filter scores. If true, all filter scores are summed. Otherwise, the maximum filter score is kept. For more information, see [filter scores](https://www.algolia.com/doc/guides/managing-results/refine-results/filtering/in-depth/filter-scoring/#accumulating-scores-with-sumorfiltersscores).
721
+ * Redirect rule status.
651
722
  */
652
- sumOrFiltersScores?: boolean;
723
+ succeed: boolean;
724
+ data: RedirectRuleIndexData;
725
+ };
726
+
727
+ /**
728
+ * [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.
729
+ */
730
+ type Redirect = {
731
+ index?: Array<RedirectRuleIndexMetadata>;
732
+ };
733
+
734
+ type BaseSearchResponse = Record<string, any> & {
653
735
  /**
654
- * Restricts a search to a subset of your searchable attributes. Attribute names are case-sensitive.
736
+ * A/B test ID. This is only included in the response for indices that are part of an A/B test.
655
737
  */
656
- restrictSearchableAttributes?: string[];
738
+ abTestID?: number;
657
739
  /**
658
- * 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).
740
+ * Variant ID. This is only included in the response for indices that are part of an A/B test.
659
741
  */
660
- facets?: string[];
742
+ abTestVariantID?: number;
661
743
  /**
662
- * 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`.
744
+ * Computed geographical location.
663
745
  */
664
- facetingAfterDistinct?: boolean;
746
+ aroundLatLng?: string;
665
747
  /**
666
- * Page of search results to retrieve.
748
+ * Distance from a central coordinate provided by `aroundLatLng`.
667
749
  */
668
- page?: number;
750
+ automaticRadius?: string;
751
+ exhaustive?: Exhaustive;
669
752
  /**
670
- * Position of the first hit to retrieve.
753
+ * See the `facetsCount` field of the `exhaustive` object in the response.
671
754
  */
672
- offset?: number;
755
+ exhaustiveFacetsCount?: boolean;
673
756
  /**
674
- * Number of hits to retrieve (used in combination with `offset`).
757
+ * See the `nbHits` field of the `exhaustive` object in the response.
675
758
  */
676
- length?: number;
759
+ exhaustiveNbHits?: boolean;
677
760
  /**
678
- * 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`.
761
+ * See the `typo` field of the `exhaustive` object in the response.
679
762
  */
680
- aroundLatLng?: string;
763
+ exhaustiveTypo?: boolean;
681
764
  /**
682
- * Whether to obtain the coordinates from the request\'s IP address.
765
+ * Facet counts.
683
766
  */
684
- aroundLatLngViaIP?: boolean;
685
- aroundRadius?: AroundRadius;
686
- aroundPrecision?: AroundPrecision;
767
+ facets?: {
768
+ [key: string]: {
769
+ [key: string]: number;
770
+ };
771
+ };
687
772
  /**
688
- * Minimum radius (in meters) for a search around a location when `aroundRadius` isn\'t set.
773
+ * Statistics for numerical facets.
689
774
  */
690
- minimumAroundRadius?: number;
775
+ facets_stats?: {
776
+ [key: string]: FacetStats;
777
+ };
691
778
  /**
692
- * 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).
779
+ * Index name used for the query.
693
780
  */
694
- insideBoundingBox?: number[][];
781
+ index?: string;
695
782
  /**
696
- * 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`.
783
+ * Index name used for the query. During A/B testing, the targeted index isn\'t always the index used by the query.
697
784
  */
698
- insidePolygon?: number[][];
785
+ indexUsed?: string;
699
786
  /**
700
- * 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`.
787
+ * Warnings about the query.
701
788
  */
702
- naturalLanguages?: SupportedLanguage[];
789
+ message?: string;
703
790
  /**
704
- * 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.
791
+ * Number of hits selected and sorted by the relevant sort algorithm.
705
792
  */
706
- ruleContexts?: string[];
793
+ nbSortedHits?: number;
707
794
  /**
708
- * 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).
795
+ * Post-[normalization](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/#what-does-normalization-mean) query string that will be searched.
709
796
  */
710
- personalizationImpact?: number;
797
+ parsedQuery?: string;
711
798
  /**
712
- * Unique pseudonymous or anonymous user identifier. This helps with analytics and click and conversion events. For more information, see [user token](https://www.algolia.com/doc/guides/sending-events/concepts/usertoken/).
799
+ * Time the server took to process the request, in milliseconds.
713
800
  */
714
- userToken?: string;
801
+ processingTimeMS: number;
715
802
  /**
716
- * Whether the search response should include detailed ranking information.
803
+ * Experimental. List of processing steps and their times, in milliseconds. You can use this list to investigate performance issues.
717
804
  */
718
- getRankingInfo?: boolean;
805
+ processingTimingsMS?: Record<string, unknown>;
719
806
  /**
720
- * Whether to take into account an index\'s synonyms for this search.
807
+ * Markup text indicating which parts of the original query have been removed to retrieve a non-empty result set.
721
808
  */
722
- synonyms?: boolean;
809
+ queryAfterRemoval?: string;
810
+ redirect?: Redirect;
811
+ renderingContent?: RenderingContent;
723
812
  /**
724
- * Whether to include a `queryID` attribute in the response. The query ID is a unique identifier for a search query and is required for tracking [click and conversion events](https://www.algolia.com/guides/sending-events/getting-started/).
813
+ * Time the server took to process the request, in milliseconds.
725
814
  */
726
- clickAnalytics?: boolean;
815
+ serverTimeMS?: number;
727
816
  /**
728
- * Whether this search will be included in Analytics.
817
+ * Host name of the server that processed the request.
729
818
  */
730
- analytics?: boolean;
819
+ serverUsed?: string;
731
820
  /**
732
- * Tags to apply to the query for [segmenting analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).
821
+ * An object with custom data. You can store up to 32kB as custom data.
733
822
  */
734
- analyticsTags?: string[];
823
+ userData?: Record<string, unknown>;
735
824
  /**
736
- * Whether to include this search when calculating processing-time percentiles.
825
+ * Unique identifier for the query. This is used for [click analytics](https://www.algolia.com/doc/guides/analytics/click-analytics/).
737
826
  */
738
- percentileComputation?: boolean;
827
+ queryID?: string;
739
828
  /**
740
- * Whether to enable A/B testing for this search.
829
+ * Whether automatic events collection is enabled for the application.
741
830
  */
742
- enableABTest?: boolean;
831
+ _automaticInsights?: boolean;
743
832
  };
744
833
 
745
- type BaseSearchParams = BaseSearchParamsWithoutQuery & SearchParamsQuery;
746
-
747
834
  /**
748
- * Search mode the index will use to query for results. This setting only applies to indices, for which Algolia enabled NeuralSearch for you.
835
+ * Whether the whole query string matches or only a part.
749
836
  */
750
- type Mode = 'keywordSearch' | 'neuralSearch';
837
+ type MatchLevel = 'none' | 'partial' | 'full';
751
838
 
752
839
  /**
753
- * Settings for the semantic search part of NeuralSearch. Only used when `mode` is `neuralSearch`.
840
+ * Surround words that match the query with HTML tags for highlighting.
754
841
  */
755
- type SemanticSearch = {
842
+ type HighlightResultOption = {
756
843
  /**
757
- * Indices from which to collect click and conversion events. If null, the current index and all its replicas are used.
844
+ * Highlighted attribute value, including HTML tags.
758
845
  */
759
- eventSources?: string[] | null;
760
- };
761
-
762
- type IndexSettingsAsSearchParams = {
846
+ value: string;
847
+ matchLevel: MatchLevel;
763
848
  /**
764
- * 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.
849
+ * List of matched words from the search query.
765
850
  */
766
- attributesToRetrieve?: string[];
851
+ matchedWords: Array<string>;
767
852
  /**
768
- * 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/).
853
+ * Whether the entire attribute value is highlighted.
769
854
  */
770
- ranking?: string[];
855
+ fullyHighlighted?: boolean;
856
+ };
857
+
858
+ type HighlightResult = HighlightResultOption | {
859
+ [key: string]: HighlightResult;
860
+ } | Array<HighlightResult>;
861
+
862
+ type MatchedGeoLocation = {
771
863
  /**
772
- * Attributes to use as [custom ranking](https://www.algolia.com/doc/guides/managing-results/must-do/custom-ranking/). Attribute names are case-sensitive. The custom ranking attributes decide which items are shown first if the other ranking criteria are equal. Records with missing values for your selected custom ranking attributes are always sorted last. Boolean attributes are sorted based on their alphabetical order. **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. If you use two or more custom ranking attributes, [reduce the precision](https://www.algolia.com/doc/guides/managing-results/must-do/custom-ranking/how-to/controlling-custom-ranking-metrics-precision/) of your first attributes, or the other attributes will never be applied.
864
+ * Latitude of the matched location.
773
865
  */
774
- customRanking?: string[];
866
+ lat?: number;
775
867
  /**
776
- * 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.
868
+ * Longitude of the matched location.
777
869
  */
778
- relevancyStrictness?: number;
870
+ lng?: number;
779
871
  /**
780
- * 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/).
872
+ * Distance between the matched location and the search location (in meters).
781
873
  */
782
- attributesToHighlight?: string[];
874
+ distance?: number;
875
+ };
876
+
877
+ type Personalization = {
783
878
  /**
784
- * 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.
879
+ * The score of the filters.
785
880
  */
786
- attributesToSnippet?: string[];
881
+ filtersScore?: number;
787
882
  /**
788
- * HTML tag to insert before the highlighted parts in all highlighted results and snippets.
883
+ * The score of the ranking.
789
884
  */
790
- highlightPreTag?: string;
885
+ rankingScore?: number;
791
886
  /**
792
- * HTML tag to insert after the highlighted parts in all highlighted results and snippets.
887
+ * The score of the event.
793
888
  */
794
- highlightPostTag?: string;
795
- /**
796
- * String used as an ellipsis indicator when a snippet is truncated.
797
- */
798
- snippetEllipsisText?: string;
799
- /**
800
- * Whether to restrict highlighting and snippeting to items that at least partially matched the search query. By default, all items are highlighted and snippeted.
801
- */
802
- restrictHighlightAndSnippetArrays?: boolean;
889
+ score?: number;
890
+ };
891
+
892
+ /**
893
+ * Object with detailed information about the record\'s ranking.
894
+ */
895
+ type RankingInfo = {
803
896
  /**
804
- * Number of hits per page.
897
+ * Whether a filter matched the query.
805
898
  */
806
- hitsPerPage?: number;
899
+ filters?: number;
807
900
  /**
808
- * Minimum number of characters a word in the search query must contain to accept matches with [one typo](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/typo-tolerance/in-depth/configuring-typo-tolerance/#configuring-word-length-for-typos).
901
+ * Position of the first matched word in the best matching attribute of the record.
809
902
  */
810
- minWordSizefor1Typo?: number;
903
+ firstMatchedWord: number;
811
904
  /**
812
- * Minimum number of characters a word in the search query must contain to accept matches with [two typos](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/typo-tolerance/in-depth/configuring-typo-tolerance/#configuring-word-length-for-typos).
905
+ * Distance between the geo location in the search query and the best matching geo location in the record, divided by the geo precision (in meters).
813
906
  */
814
- minWordSizefor2Typos?: number;
815
- typoTolerance?: TypoTolerance;
907
+ geoDistance: number;
816
908
  /**
817
- * Whether to allow typos on numbers in the search query. Turn off this setting to reduce the number of irrelevant matches when searching in large sets of similar numbers.
909
+ * Precision used when computing the geo distance, in meters.
818
910
  */
819
- allowTyposOnNumericTokens?: boolean;
911
+ geoPrecision?: number;
912
+ matchedGeoLocation?: MatchedGeoLocation;
913
+ personalization?: Personalization;
820
914
  /**
821
- * 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.
915
+ * Number of exactly matched words.
822
916
  */
823
- disableTypoToleranceOnAttributes?: string[];
824
- ignorePlurals?: IgnorePlurals;
825
- removeStopWords?: RemoveStopWords;
917
+ nbExactWords: number;
826
918
  /**
827
- * Characters for which diacritics should be preserved. By default, Algolia removes diacritics from letters. For example, `é` becomes `e`. If this causes issues in your search, you can specify characters that should keep their diacritics.
919
+ * Number of typos encountered when matching the record.
828
920
  */
829
- keepDiacriticsOnCharacters?: string;
921
+ nbTypos: number;
830
922
  /**
831
- * 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/).
923
+ * Whether the record was promoted by a rule.
832
924
  */
833
- queryLanguages?: SupportedLanguage[];
925
+ promoted?: boolean;
834
926
  /**
835
- * 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).
927
+ * Number of words between multiple matches in the query plus 1. For single word queries, `proximityDistance` is 0.
836
928
  */
837
- decompoundQuery?: boolean;
929
+ proximityDistance?: number;
838
930
  /**
839
- * Whether to enable rules.
931
+ * Overall ranking of the record, expressed as a single integer. This attribute is internal.
840
932
  */
841
- enableRules?: boolean;
933
+ userScore: number;
842
934
  /**
843
- * Whether to enable Personalization.
935
+ * Number of matched words.
844
936
  */
845
- enablePersonalization?: boolean;
846
- queryType?: QueryType;
847
- removeWordsIfNoResults?: RemoveWordsIfNoResults;
848
- mode?: Mode;
849
- semanticSearch?: SemanticSearch;
937
+ words?: number;
850
938
  /**
851
- * Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` parameter to control which feature is supported.
939
+ * Whether the record is re-ranked.
852
940
  */
853
- advancedSyntax?: boolean;
941
+ promotedByReRanking?: boolean;
942
+ };
943
+
944
+ /**
945
+ * Snippets that show the context around a matching search query.
946
+ */
947
+ type SnippetResultOption = {
854
948
  /**
855
- * 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 dividied 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).
949
+ * Highlighted attribute value, including HTML tags.
856
950
  */
857
- optionalWords?: string[];
951
+ value: string;
952
+ matchLevel: MatchLevel;
953
+ };
954
+
955
+ type SnippetResult = SnippetResultOption | {
956
+ [key: string]: SnippetResult;
957
+ } | Array<SnippetResult>;
958
+
959
+ /**
960
+ * Recommend hit.
961
+ */
962
+ type RecommendHit = Record<string, any> & {
858
963
  /**
859
- * 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 likelyhood 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.
964
+ * Unique record identifier.
860
965
  */
861
- disableExactOnAttributes?: string[];
862
- exactOnSingleWordQuery?: ExactOnSingleWordQuery;
966
+ objectID: string;
863
967
  /**
864
- * 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.
968
+ * Surround words that match the query with HTML tags for highlighting.
865
969
  */
866
- alternativesAsExact?: AlternativesAsExact[];
970
+ _highlightResult?: {
971
+ [key: string]: HighlightResult;
972
+ };
867
973
  /**
868
- * 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.
974
+ * Snippets that show the context around a matching search query.
869
975
  */
870
- advancedSyntaxFeatures?: AdvancedSyntaxFeatures[];
871
- distinct?: Distinct;
976
+ _snippetResult?: {
977
+ [key: string]: SnippetResult;
978
+ };
979
+ _rankingInfo?: RankingInfo;
980
+ _distinctSeqID?: number;
872
981
  /**
873
- * 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 occurences of \"house\" are replaced by \"home\" in the highlighted response.
982
+ * Recommendation score.
874
983
  */
875
- replaceSynonymsInHighlight?: boolean;
984
+ _score: number;
985
+ };
986
+
987
+ /**
988
+ * Trending facet hit.
989
+ */
990
+ type TrendingFacetHit = {
876
991
  /**
877
- * Minimum proximity score for two matching words. This adjusts the [Proximity ranking criterion](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/#proximity) by equally scoring matches that are farther apart. For example, if `minProximity` is 2, neighboring matches and matches with one word between them would have the same score.
992
+ * Recommendation score.
878
993
  */
879
- minProximity?: number;
994
+ _score: number;
880
995
  /**
881
- * 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.
996
+ * Facet attribute. To be used in combination with `facetValue`. If specified, only recommendations matching the facet filter will be returned.
882
997
  */
883
- responseFields?: string[];
998
+ facetName: string;
884
999
  /**
885
- * 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).
1000
+ * Facet value. To be used in combination with `facetName`. If specified, only recommendations matching the facet filter will be returned.
886
1001
  */
887
- maxFacetHits?: number;
1002
+ facetValue: string;
1003
+ };
1004
+
1005
+ type RecommendationsHit = RecommendHit | TrendingFacetHit;
1006
+
1007
+ type RecommendationsHits = {
1008
+ hits: Array<RecommendationsHit>;
1009
+ };
1010
+
1011
+ type SearchPagination = {
888
1012
  /**
889
- * Maximum number of facet values to return for each facet.
1013
+ * Page of search results to retrieve.
890
1014
  */
891
- maxValuesPerFacet?: number;
1015
+ page?: number;
892
1016
  /**
893
- * Order in which to retrieve facet values. - `count`. Facet values are retrieved by decreasing count. The count is the number of matching records containing this facet value. - `alpha`. Retrieve facet values alphabetically. This setting doesn\'t influence how facet values are displayed in your UI (see `renderingContent`). For more information, see [facet value display](https://www.algolia.com/doc/guides/building-search-ui/ui-and-ux-patterns/facet-display/js/).
1017
+ * Number of results (hits).
894
1018
  */
895
- sortFacetValuesBy?: string;
1019
+ nbHits?: number;
896
1020
  /**
897
- * Whether the best matching attribute should be determined by minimum proximity. This setting only affects ranking if the Attribute ranking criterion comes before Proximity in the `ranking` setting. If true, the best matching attribute is selected based on the minimum proximity of multiple matches. Otherwise, the best matching attribute is determined by the order in the `searchableAttributes` setting.
1021
+ * Number of pages of results.
898
1022
  */
899
- attributeCriteriaComputedByMinProximity?: boolean;
900
- renderingContent?: RenderingContent;
1023
+ nbPages?: number;
901
1024
  /**
902
- * Whether this search will use [Dynamic Re-Ranking](https://www.algolia.com/doc/guides/algolia-ai/re-ranking/). This setting only has an effect if you activated Dynamic Re-Ranking for this index in the Algolia dashboard.
1025
+ * Number of hits per page.
903
1026
  */
904
- enableReRanking?: boolean;
905
- reRankingApplyFilter?: ReRankingApplyFilter | null;
1027
+ hitsPerPage?: number;
906
1028
  };
907
1029
 
908
- /**
909
- * Each parameter value, including the `query` must not be larger than 512 bytes.
910
- */
911
- type SearchParamsObject = BaseSearchParams & IndexSettingsAsSearchParams;
1030
+ type RecommendationsResults = BaseSearchResponse & SearchPagination & RecommendationsHits;
1031
+
1032
+ type GetRecommendationsResponse = {
1033
+ results: Array<RecommendationsResults>;
1034
+ };
912
1035
 
913
1036
  /**
914
- * Properties for the `customPost` method.
1037
+ * - `default`: perform a search query - `facet` [searches for facet values](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#search-for-facet-values).
915
1038
  */
916
- type CustomPostProps = {
1039
+ type SearchTypeFacet = 'facet';
1040
+
1041
+ type SearchForFacetsOptions = {
917
1042
  /**
918
- * Path of the endpoint, anything after \"/1\" must be specified.
1043
+ * Facet name.
919
1044
  */
920
- path: string;
1045
+ facet: string;
921
1046
  /**
922
- * Query parameters to apply to the current query.
1047
+ * Index name (case-sensitive).
923
1048
  */
924
- parameters?: Record<string, any>;
1049
+ indexName: string;
925
1050
  /**
926
- * Parameters to send with the custom request.
1051
+ * Text to search inside the facet\'s values.
927
1052
  */
928
- body?: Record<string, unknown>;
929
- };
930
- /**
931
- * 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.
932
- *
933
- * @deprecated This signature will be removed from the next major version, we recommend using the `GetRecommendationsParams` type for performances and future proof reasons.
934
- */
935
- type LegacyGetRecommendationsParams = RecommendationsRequest[];
936
- /**
937
- * In v4, the search parameters are wrapped in a `params` parameter.
938
- *
939
- * @deprecated The `search` method now accepts flat `searchParams` at the root of the method.
940
- */
941
- type LegacySearchParams = {
942
- params?: SearchParamsObject;
943
- };
944
- /**
945
- * In v4, the search parameters are wrapped in a `params` parameter.
946
- *
947
- * @deprecated The `search` method now accepts flat `searchParams` at the root of the method.
948
- */
949
- type LegacySearchForFacets = LegacySearchParams & SearchForFacetsOptions;
950
- /**
951
- * In v4, the search parameters are wrapped in a `params` parameter.
952
- *
953
- * @deprecated The `search` method now accepts flat `searchParams` at the root of the method.
954
- */
955
- type LegacySearchForHits = LegacySearchParams & SearchForHitsOptions;
956
- type LegacySearchQuery = LegacySearchForFacets | LegacySearchForHits;
957
- /**
958
- * Search method signature compatible with the `algoliasearch` v4 package. When using this signature, extra computation will be required to make it match the new signature.
959
- *
960
- * @deprecated This signature will be removed from the next major version, we recommend using the `SearchMethodParams` type for performances and future proof reasons.
961
- */
962
- type LegacySearchMethodProps = LegacySearchQuery[];
963
-
964
- /**
965
- * Recommend request body.
966
- */
967
- type GetRecommendationsParams = {
1053
+ facetQuery?: string;
968
1054
  /**
969
- * Recommendation request with parameters depending on the requested model.
1055
+ * 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).
970
1056
  */
971
- requests: RecommendationsRequest[];
1057
+ maxFacetHits?: number;
1058
+ type: SearchTypeFacet;
972
1059
  };
973
1060
 
974
- /**
975
- * Whether certain properties of the search response are calculated exhaustive (exact) or approximated.
976
- */
977
- type Exhaustive = {
978
- /**
979
- * Whether the facet count is exhaustive (`true`) or approximate (`false`). See the [related discussion](https://support.algolia.com/hc/en-us/articles/4406975248145-Why-are-my-facet-and-hit-counts-not-accurate-).
980
- */
981
- facetsCount?: boolean;
1061
+ type BaseSearchParamsWithoutQuery = {
982
1062
  /**
983
- * The value is `false` if not all facet values are retrieved.
1063
+ * Keywords to be used instead of the search query to conduct a more broader search. Using the `similarQuery` parameter changes other settings: - `queryType` is set to `prefixNone`. - `removeStopWords` is set to true. - `words` is set as the first ranking criterion. - All remaining words are treated as `optionalWords`. Since the `similarQuery` is supposed to do a broad search, they usually return many results. Combine it with `filters` to narrow down the list of results.
984
1064
  */
985
- facetValues?: boolean;
1065
+ similarQuery?: string;
986
1066
  /**
987
- * Whether the `nbHits` is exhaustive (`true`) or approximate (`false`). When the query takes more than 50ms to be processed, the engine makes an approximation. This can happen when using complex filters on millions of records, when typo-tolerance was not exhaustive, or when enough hits have been retrieved (for example, after the engine finds 10,000 exact matches). `nbHits` is reported as non-exhaustive whenever an approximation is made, even if the approximation didn’t, in the end, impact the exhaustivity of the query.
1067
+ * 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/).
988
1068
  */
989
- nbHits?: boolean;
1069
+ filters?: string;
1070
+ facetFilters?: FacetFilters;
1071
+ optionalFilters?: OptionalFilters;
1072
+ numericFilters?: NumericFilters;
1073
+ tagFilters?: TagFilters;
990
1074
  /**
991
- * Rules matching exhaustivity. The value is `false` if rules were enable for this query, and could not be fully processed due a timeout. This is generally caused by the number of alternatives (such as typos) which is too large.
1075
+ * Whether to sum all filter scores. If true, all filter scores are summed. Otherwise, the maximum filter score is kept. For more information, see [filter scores](https://www.algolia.com/doc/guides/managing-results/refine-results/filtering/in-depth/filter-scoring/#accumulating-scores-with-sumorfiltersscores).
992
1076
  */
993
- rulesMatch?: boolean;
1077
+ sumOrFiltersScores?: boolean;
994
1078
  /**
995
- * Whether the typo search was exhaustive (`true`) or approximate (`false`). An approximation is done when the typo search query part takes more than 10% of the query budget (ie. 5ms by default) to be processed (this can happen when a lot of typo alternatives exist for the query). This field will not be included when typo-tolerance is entirely disabled.
1079
+ * Restricts a search to a subset of your searchable attributes. Attribute names are case-sensitive.
996
1080
  */
997
- typo?: boolean;
998
- };
999
-
1000
- type FacetStats = {
1081
+ restrictSearchableAttributes?: Array<string>;
1001
1082
  /**
1002
- * Minimum value in the results.
1083
+ * 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).
1003
1084
  */
1004
- min?: number;
1085
+ facets?: Array<string>;
1005
1086
  /**
1006
- * Maximum value in the results.
1087
+ * 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`.
1007
1088
  */
1008
- max?: number;
1089
+ facetingAfterDistinct?: boolean;
1009
1090
  /**
1010
- * Average facet value in the results.
1091
+ * Page of search results to retrieve.
1011
1092
  */
1012
- avg?: number;
1093
+ page?: number;
1013
1094
  /**
1014
- * Sum of all values in the results.
1095
+ * Position of the first hit to retrieve.
1015
1096
  */
1016
- sum?: number;
1017
- };
1018
-
1019
- /**
1020
- * Redirect rule data.
1021
- */
1022
- type RedirectRuleIndexData = {
1023
- ruleObjectID: string;
1024
- };
1025
-
1026
- type RedirectRuleIndexMetadata = {
1097
+ offset?: number;
1027
1098
  /**
1028
- * Source index for the redirect rule.
1099
+ * Number of hits to retrieve (used in combination with `offset`).
1029
1100
  */
1030
- source: string;
1101
+ length?: number;
1031
1102
  /**
1032
- * Destination index for the redirect rule.
1103
+ * 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`.
1033
1104
  */
1034
- dest: string;
1105
+ aroundLatLng?: string;
1035
1106
  /**
1036
- * Reason for the redirect rule.
1107
+ * Whether to obtain the coordinates from the request\'s IP address.
1037
1108
  */
1038
- reason: string;
1109
+ aroundLatLngViaIP?: boolean;
1110
+ aroundRadius?: AroundRadius;
1111
+ aroundPrecision?: AroundPrecision;
1039
1112
  /**
1040
- * Redirect rule status.
1113
+ * Minimum radius (in meters) for a search around a location when `aroundRadius` isn\'t set.
1041
1114
  */
1042
- succeed: boolean;
1043
- data: RedirectRuleIndexData;
1044
- };
1045
-
1046
- /**
1047
- * [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.
1048
- */
1049
- type Redirect = {
1050
- index?: RedirectRuleIndexMetadata[];
1051
- };
1052
-
1053
- type BaseSearchResponse = Record<string, any> & {
1115
+ minimumAroundRadius?: number;
1054
1116
  /**
1055
- * A/B test ID. This is only included in the response for indices that are part of an A/B test.
1117
+ * 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).
1056
1118
  */
1057
- abTestID?: number;
1119
+ insideBoundingBox?: Array<Array<number>>;
1058
1120
  /**
1059
- * Variant ID. This is only included in the response for indices that are part of an A/B test.
1121
+ * 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`.
1060
1122
  */
1061
- abTestVariantID?: number;
1123
+ insidePolygon?: Array<Array<number>>;
1062
1124
  /**
1063
- * Computed geographical location.
1125
+ * 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`.
1064
1126
  */
1065
- aroundLatLng?: string;
1127
+ naturalLanguages?: Array<SupportedLanguage>;
1066
1128
  /**
1067
- * Distance from a central coordinate provided by `aroundLatLng`.
1129
+ * 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.
1068
1130
  */
1069
- automaticRadius?: string;
1070
- exhaustive?: Exhaustive;
1131
+ ruleContexts?: Array<string>;
1071
1132
  /**
1072
- * See the `facetsCount` field of the `exhaustive` object in the response.
1133
+ * 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).
1073
1134
  */
1074
- exhaustiveFacetsCount?: boolean;
1135
+ personalizationImpact?: number;
1075
1136
  /**
1076
- * See the `nbHits` field of the `exhaustive` object in the response.
1137
+ * Unique pseudonymous or anonymous user identifier. This helps with analytics and click and conversion events. For more information, see [user token](https://www.algolia.com/doc/guides/sending-events/concepts/usertoken/).
1077
1138
  */
1078
- exhaustiveNbHits?: boolean;
1139
+ userToken?: string;
1079
1140
  /**
1080
- * See the `typo` field of the `exhaustive` object in the response.
1141
+ * Whether the search response should include detailed ranking information.
1081
1142
  */
1082
- exhaustiveTypo?: boolean;
1143
+ getRankingInfo?: boolean;
1083
1144
  /**
1084
- * Facet counts.
1145
+ * Whether to take into account an index\'s synonyms for this search.
1085
1146
  */
1086
- facets?: Record<string, Record<string, number>>;
1147
+ synonyms?: boolean;
1087
1148
  /**
1088
- * Statistics for numerical facets.
1149
+ * Whether to include a `queryID` attribute in the response. The query ID is a unique identifier for a search query and is required for tracking [click and conversion events](https://www.algolia.com/guides/sending-events/getting-started/).
1089
1150
  */
1090
- facets_stats?: Record<string, FacetStats>;
1151
+ clickAnalytics?: boolean;
1091
1152
  /**
1092
- * Index name used for the query.
1153
+ * Whether this search will be included in Analytics.
1093
1154
  */
1094
- index?: string;
1155
+ analytics?: boolean;
1095
1156
  /**
1096
- * Index name used for the query. During A/B testing, the targeted index isn\'t always the index used by the query.
1157
+ * Tags to apply to the query for [segmenting analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).
1097
1158
  */
1098
- indexUsed?: string;
1159
+ analyticsTags?: Array<string>;
1099
1160
  /**
1100
- * Warnings about the query.
1161
+ * Whether to include this search when calculating processing-time percentiles.
1101
1162
  */
1102
- message?: string;
1163
+ percentileComputation?: boolean;
1103
1164
  /**
1104
- * Number of hits selected and sorted by the relevant sort algorithm.
1165
+ * Whether to enable A/B testing for this search.
1105
1166
  */
1106
- nbSortedHits?: number;
1167
+ enableABTest?: boolean;
1168
+ };
1169
+
1170
+ type BaseSearchParams = SearchParamsQuery & BaseSearchParamsWithoutQuery;
1171
+
1172
+ /**
1173
+ * Search mode the index will use to query for results. This setting only applies to indices, for which Algolia enabled NeuralSearch for you.
1174
+ */
1175
+ type Mode = 'neuralSearch' | 'keywordSearch';
1176
+
1177
+ /**
1178
+ * Settings for the semantic search part of NeuralSearch. Only used when `mode` is `neuralSearch`.
1179
+ */
1180
+ type SemanticSearch = {
1107
1181
  /**
1108
- * Post-[normalization](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/#what-does-normalization-mean) query string that will be searched.
1182
+ * Indices from which to collect click and conversion events. If null, the current index and all its replicas are used.
1109
1183
  */
1110
- parsedQuery?: string;
1184
+ eventSources?: Array<string> | null;
1185
+ };
1186
+
1187
+ type IndexSettingsAsSearchParams = {
1111
1188
  /**
1112
- * Time the server took to process the request, in milliseconds.
1189
+ * 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.
1113
1190
  */
1114
- processingTimeMS: number;
1191
+ attributesToRetrieve?: Array<string>;
1115
1192
  /**
1116
- * Experimental. List of processing steps and their times, in milliseconds. You can use this list to investigate performance issues.
1193
+ * 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/).
1117
1194
  */
1118
- processingTimingsMS?: Record<string, unknown>;
1195
+ ranking?: Array<string>;
1119
1196
  /**
1120
- * Markup text indicating which parts of the original query have been removed to retrieve a non-empty result set.
1197
+ * Attributes to use as [custom ranking](https://www.algolia.com/doc/guides/managing-results/must-do/custom-ranking/). Attribute names are case-sensitive. The custom ranking attributes decide which items are shown first if the other ranking criteria are equal. Records with missing values for your selected custom ranking attributes are always sorted last. Boolean attributes are sorted based on their alphabetical order. **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. If you use two or more custom ranking attributes, [reduce the precision](https://www.algolia.com/doc/guides/managing-results/must-do/custom-ranking/how-to/controlling-custom-ranking-metrics-precision/) of your first attributes, or the other attributes will never be applied.
1121
1198
  */
1122
- queryAfterRemoval?: string;
1123
- redirect?: Redirect;
1124
- renderingContent?: RenderingContent;
1199
+ customRanking?: Array<string>;
1125
1200
  /**
1126
- * Time the server took to process the request, in milliseconds.
1201
+ * 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.
1127
1202
  */
1128
- serverTimeMS?: number;
1203
+ relevancyStrictness?: number;
1129
1204
  /**
1130
- * Host name of the server that processed the request.
1205
+ * 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/).
1131
1206
  */
1132
- serverUsed?: string;
1207
+ attributesToHighlight?: Array<string>;
1133
1208
  /**
1134
- * An object with custom data. You can store up to 32kB as custom data.
1209
+ * 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.
1135
1210
  */
1136
- userData?: Record<string, unknown>;
1211
+ attributesToSnippet?: Array<string>;
1137
1212
  /**
1138
- * Unique identifier for the query. This is used for [click analytics](https://www.algolia.com/doc/guides/analytics/click-analytics/).
1213
+ * HTML tag to insert before the highlighted parts in all highlighted results and snippets.
1139
1214
  */
1140
- queryID?: string;
1215
+ highlightPreTag?: string;
1141
1216
  /**
1142
- * Whether automatic events collection is enabled for the application.
1217
+ * HTML tag to insert after the highlighted parts in all highlighted results and snippets.
1143
1218
  */
1144
- _automaticInsights?: boolean;
1145
- };
1146
-
1147
- /**
1148
- * Whether the whole query string matches or only a part.
1149
- */
1150
- type MatchLevel = 'full' | 'none' | 'partial';
1151
-
1152
- /**
1153
- * Surround words that match the query with HTML tags for highlighting.
1154
- */
1155
- type HighlightResultOption = {
1219
+ highlightPostTag?: string;
1156
1220
  /**
1157
- * Highlighted attribute value, including HTML tags.
1221
+ * String used as an ellipsis indicator when a snippet is truncated.
1158
1222
  */
1159
- value: string;
1160
- matchLevel: MatchLevel;
1223
+ snippetEllipsisText?: string;
1161
1224
  /**
1162
- * List of matched words from the search query.
1225
+ * Whether to restrict highlighting and snippeting to items that at least partially matched the search query. By default, all items are highlighted and snippeted.
1163
1226
  */
1164
- matchedWords: string[];
1227
+ restrictHighlightAndSnippetArrays?: boolean;
1165
1228
  /**
1166
- * Whether the entire attribute value is highlighted.
1167
- */
1168
- fullyHighlighted?: boolean;
1169
- };
1170
-
1171
- type HighlightResult = HighlightResult[] | HighlightResultOption | {
1172
- [key: string]: HighlightResult;
1173
- };
1174
-
1175
- type MatchedGeoLocation = {
1229
+ * Number of hits per page.
1230
+ */
1231
+ hitsPerPage?: number;
1176
1232
  /**
1177
- * Latitude of the matched location.
1233
+ * Minimum number of characters a word in the search query must contain to accept matches with [one typo](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/typo-tolerance/in-depth/configuring-typo-tolerance/#configuring-word-length-for-typos).
1178
1234
  */
1179
- lat?: number;
1235
+ minWordSizefor1Typo?: number;
1180
1236
  /**
1181
- * Longitude of the matched location.
1237
+ * Minimum number of characters a word in the search query must contain to accept matches with [two typos](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/typo-tolerance/in-depth/configuring-typo-tolerance/#configuring-word-length-for-typos).
1182
1238
  */
1183
- lng?: number;
1239
+ minWordSizefor2Typos?: number;
1240
+ typoTolerance?: TypoTolerance;
1184
1241
  /**
1185
- * Distance between the matched location and the search location (in meters).
1242
+ * Whether to allow typos on numbers in the search query. Turn off this setting to reduce the number of irrelevant matches when searching in large sets of similar numbers.
1186
1243
  */
1187
- distance?: number;
1188
- };
1189
-
1190
- type Personalization = {
1244
+ allowTyposOnNumericTokens?: boolean;
1191
1245
  /**
1192
- * The score of the filters.
1246
+ * 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.
1193
1247
  */
1194
- filtersScore?: number;
1248
+ disableTypoToleranceOnAttributes?: Array<string>;
1249
+ ignorePlurals?: IgnorePlurals;
1250
+ removeStopWords?: RemoveStopWords;
1195
1251
  /**
1196
- * The score of the ranking.
1252
+ * Characters for which diacritics should be preserved. By default, Algolia removes diacritics from letters. For example, `é` becomes `e`. If this causes issues in your search, you can specify characters that should keep their diacritics.
1197
1253
  */
1198
- rankingScore?: number;
1254
+ keepDiacriticsOnCharacters?: string;
1199
1255
  /**
1200
- * The score of the event.
1256
+ * 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/).
1201
1257
  */
1202
- score?: number;
1203
- };
1204
-
1205
- /**
1206
- * Object with detailed information about the record\'s ranking.
1207
- */
1208
- type RankingInfo = {
1258
+ queryLanguages?: Array<SupportedLanguage>;
1209
1259
  /**
1210
- * Whether a filter matched the query.
1260
+ * 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).
1211
1261
  */
1212
- filters?: number;
1262
+ decompoundQuery?: boolean;
1213
1263
  /**
1214
- * Position of the first matched word in the best matching attribute of the record.
1264
+ * Whether to enable rules.
1215
1265
  */
1216
- firstMatchedWord: number;
1266
+ enableRules?: boolean;
1217
1267
  /**
1218
- * Distance between the geo location in the search query and the best matching geo location in the record, divided by the geo precision (in meters).
1268
+ * Whether to enable Personalization.
1219
1269
  */
1220
- geoDistance: number;
1270
+ enablePersonalization?: boolean;
1271
+ queryType?: QueryType;
1272
+ removeWordsIfNoResults?: RemoveWordsIfNoResults;
1273
+ mode?: Mode;
1274
+ semanticSearch?: SemanticSearch;
1221
1275
  /**
1222
- * Precision used when computing the geo distance, in meters.
1276
+ * Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` parameter to control which feature is supported.
1223
1277
  */
1224
- geoPrecision?: number;
1225
- matchedGeoLocation?: MatchedGeoLocation;
1226
- personalization?: Personalization;
1278
+ advancedSyntax?: boolean;
1227
1279
  /**
1228
- * Number of exactly matched words.
1280
+ * 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).
1229
1281
  */
1230
- nbExactWords: number;
1282
+ optionalWords?: Array<string>;
1231
1283
  /**
1232
- * Number of typos encountered when matching the record.
1284
+ * 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.
1233
1285
  */
1234
- nbTypos: number;
1286
+ disableExactOnAttributes?: Array<string>;
1287
+ exactOnSingleWordQuery?: ExactOnSingleWordQuery;
1235
1288
  /**
1236
- * Whether the record was promoted by a rule.
1289
+ * 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.
1237
1290
  */
1238
- promoted?: boolean;
1291
+ alternativesAsExact?: Array<AlternativesAsExact>;
1239
1292
  /**
1240
- * Number of words between multiple matches in the query plus 1. For single word queries, `proximityDistance` is 0.
1293
+ * 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.
1241
1294
  */
1242
- proximityDistance?: number;
1295
+ advancedSyntaxFeatures?: Array<AdvancedSyntaxFeatures>;
1296
+ distinct?: Distinct;
1243
1297
  /**
1244
- * Overall ranking of the record, expressed as a single integer. This attribute is internal.
1298
+ * 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.
1245
1299
  */
1246
- userScore: number;
1300
+ replaceSynonymsInHighlight?: boolean;
1247
1301
  /**
1248
- * Number of matched words.
1302
+ * Minimum proximity score for two matching words. This adjusts the [Proximity ranking criterion](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/#proximity) by equally scoring matches that are farther apart. For example, if `minProximity` is 2, neighboring matches and matches with one word between them would have the same score.
1249
1303
  */
1250
- words?: number;
1304
+ minProximity?: number;
1251
1305
  /**
1252
- * Whether the record is re-ranked.
1306
+ * 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.
1253
1307
  */
1254
- promotedByReRanking?: boolean;
1255
- };
1256
-
1257
- /**
1258
- * Snippets that show the context around a matching search query.
1259
- */
1260
- type SnippetResultOption = {
1308
+ responseFields?: Array<string>;
1261
1309
  /**
1262
- * Highlighted attribute value, including HTML tags.
1310
+ * 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).
1263
1311
  */
1264
- value: string;
1265
- matchLevel: MatchLevel;
1266
- };
1267
-
1268
- type SnippetResult = SnippetResult[] | SnippetResultOption | {
1269
- [key: string]: SnippetResult;
1270
- };
1271
-
1272
- /**
1273
- * Recommend hit.
1274
- */
1275
- type RecommendHit = Record<string, any> & {
1312
+ maxFacetHits?: number;
1276
1313
  /**
1277
- * Unique record identifier.
1314
+ * Maximum number of facet values to return for each facet.
1278
1315
  */
1279
- objectID: string;
1316
+ maxValuesPerFacet?: number;
1280
1317
  /**
1281
- * Surround words that match the query with HTML tags for highlighting.
1318
+ * Order in which to retrieve facet values. - `count`. Facet values are retrieved by decreasing count. The count is the number of matching records containing this facet value. - `alpha`. Retrieve facet values alphabetically. This setting doesn\'t influence how facet values are displayed in your UI (see `renderingContent`). For more information, see [facet value display](https://www.algolia.com/doc/guides/building-search-ui/ui-and-ux-patterns/facet-display/js/).
1282
1319
  */
1283
- _highlightResult?: Record<string, HighlightResult>;
1320
+ sortFacetValuesBy?: string;
1284
1321
  /**
1285
- * Snippets that show the context around a matching search query.
1322
+ * Whether the best matching attribute should be determined by minimum proximity. This setting only affects ranking if the Attribute ranking criterion comes before Proximity in the `ranking` setting. If true, the best matching attribute is selected based on the minimum proximity of multiple matches. Otherwise, the best matching attribute is determined by the order in the `searchableAttributes` setting.
1286
1323
  */
1287
- _snippetResult?: Record<string, SnippetResult>;
1288
- _rankingInfo?: RankingInfo;
1289
- _distinctSeqID?: number;
1324
+ attributeCriteriaComputedByMinProximity?: boolean;
1325
+ renderingContent?: RenderingContent;
1290
1326
  /**
1291
- * Recommendation score.
1327
+ * Whether this search will use [Dynamic Re-Ranking](https://www.algolia.com/doc/guides/algolia-ai/re-ranking/). This setting only has an effect if you activated Dynamic Re-Ranking for this index in the Algolia dashboard.
1292
1328
  */
1293
- _score: number;
1329
+ enableReRanking?: boolean;
1330
+ reRankingApplyFilter?: ReRankingApplyFilter | null;
1294
1331
  };
1295
1332
 
1296
1333
  /**
1297
- * Trending facet hit.
1334
+ * Each parameter value, including the `query` must not be larger than 512 bytes.
1298
1335
  */
1299
- type TrendingFacetHit = {
1300
- /**
1301
- * Recommendation score.
1302
- */
1303
- _score: number;
1304
- /**
1305
- * Facet attribute. To be used in combination with `facetValue`. If specified, only recommendations matching the facet filter will be returned.
1306
- */
1307
- facetName: string;
1336
+ type SearchParamsObject = BaseSearchParams & IndexSettingsAsSearchParams;
1337
+
1338
+ /**
1339
+ * Search parameters as query string.
1340
+ */
1341
+ type SearchParamsString = {
1308
1342
  /**
1309
- * Facet value. To be used in combination with `facetName`. If specified, only recommendations matching the facet filter will be returned.
1343
+ * Search parameters as a URL-encoded query string.
1310
1344
  */
1311
- facetValue: string;
1345
+ params?: string;
1312
1346
  };
1313
1347
 
1314
- type RecommendationsHit = RecommendHit | TrendingFacetHit;
1348
+ type SearchParams = SearchParamsString | SearchParamsObject;
1315
1349
 
1316
- type RecommendationsHits = {
1317
- hits: RecommendationsHit[];
1318
- };
1350
+ type SearchForFacets = SearchParams & SearchForFacetsOptions;
1319
1351
 
1320
- type SearchPagination = {
1321
- /**
1322
- * Page of search results to retrieve.
1323
- */
1324
- page?: number;
1325
- /**
1326
- * Number of results (hits).
1327
- */
1328
- nbHits?: number;
1329
- /**
1330
- * Number of pages of results.
1331
- */
1332
- nbPages?: number;
1352
+ /**
1353
+ * - `default`: perform a search query - `facet` [searches for facet values](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#search-for-facet-values).
1354
+ */
1355
+ type SearchTypeDefault = 'default';
1356
+
1357
+ type SearchForHitsOptions = {
1333
1358
  /**
1334
- * Number of hits per page.
1359
+ * Index name (case-sensitive).
1335
1360
  */
1336
- hitsPerPage?: number;
1361
+ indexName: string;
1362
+ type?: SearchTypeDefault;
1363
+ } & {
1364
+ facet?: never;
1365
+ maxFacetHits?: never;
1366
+ facetQuery?: never;
1337
1367
  };
1338
1368
 
1339
- type RecommendationsResults = BaseSearchResponse & RecommendationsHits & SearchPagination;
1369
+ type SearchForHits = SearchParams & SearchForHitsOptions;
1340
1370
 
1341
- type GetRecommendationsResponse = {
1342
- results: RecommendationsResults[];
1371
+ type SearchQuery = SearchForHits | SearchForFacets;
1372
+
1373
+ /**
1374
+ * Strategy for multiple search queries: - `none`. Run all queries. - `stopIfEnoughMatches`. Run the queries one by one, stopping as soon as a query matches at least the `hitsPerPage` number of results.
1375
+ */
1376
+ type SearchStrategy = 'none' | 'stopIfEnoughMatches';
1377
+
1378
+ type SearchMethodParams = {
1379
+ requests: Array<SearchQuery>;
1380
+ strategy?: SearchStrategy;
1343
1381
  };
1344
1382
 
1345
1383
  type FacetHits = {
@@ -1361,7 +1399,7 @@ type SearchForFacetValuesResponse = {
1361
1399
  /**
1362
1400
  * Matching facet values.
1363
1401
  */
1364
- facetHits: FacetHits[];
1402
+ facetHits: Array<FacetHits>;
1365
1403
  /**
1366
1404
  * Whether the facet count is exhaustive (true) or approximate (false). For more information, see [Why are my facet and hit counts not accurate](https://support.algolia.com/hc/en-us/articles/4406975248145-Why-are-my-facet-and-hit-counts-not-accurate-).
1367
1405
  */
@@ -1372,34 +1410,6 @@ type SearchForFacetValuesResponse = {
1372
1410
  processingTimeMS?: number;
1373
1411
  };
1374
1412
 
1375
- /**
1376
- * Search parameters as query string.
1377
- */
1378
- type SearchParamsString = {
1379
- /**
1380
- * Search parameters as a URL-encoded query string.
1381
- */
1382
- params?: string;
1383
- };
1384
-
1385
- type SearchParams = SearchParamsObject | SearchParamsString;
1386
-
1387
- type SearchForFacets = SearchForFacetsOptions & SearchParams;
1388
-
1389
- type SearchForHits = SearchForHitsOptions & SearchParams;
1390
-
1391
- type SearchQuery = SearchForFacets | SearchForHits;
1392
-
1393
- /**
1394
- * Strategy for multiple search queries: - `none`. Run all queries. - `stopIfEnoughMatches`. Run the queries one by one, stopping as soon as a query matches at least the `hitsPerPage` number of results.
1395
- */
1396
- type SearchStrategy = 'none' | 'stopIfEnoughMatches';
1397
-
1398
- type SearchMethodParams = {
1399
- requests: SearchQuery[];
1400
- strategy?: SearchStrategy;
1401
- };
1402
-
1403
1413
  /**
1404
1414
  * Search result. A hit is a record from your index, augmented with special attributes for highlighting, snippeting, and ranking.
1405
1415
  */
@@ -1411,11 +1421,15 @@ type Hit<T = Record<string, any>> = T & {
1411
1421
  /**
1412
1422
  * Surround words that match the query with HTML tags for highlighting.
1413
1423
  */
1414
- _highlightResult?: Record<string, HighlightResult>;
1424
+ _highlightResult?: {
1425
+ [key: string]: HighlightResult;
1426
+ };
1415
1427
  /**
1416
1428
  * Snippets that show the context around a matching search query.
1417
1429
  */
1418
- _snippetResult?: Record<string, SnippetResult>;
1430
+ _snippetResult?: {
1431
+ [key: string]: SnippetResult;
1432
+ };
1419
1433
  _rankingInfo?: RankingInfo;
1420
1434
  _distinctSeqID?: number;
1421
1435
  };
@@ -1424,7 +1438,7 @@ type SearchHits<T = Record<string, any>> = Record<string, any> & {
1424
1438
  /**
1425
1439
  * Search results (hits). Hits are records from your index that match the search criteria, augmented with additional attributes, such as, for highlighting.
1426
1440
  */
1427
- hits: Array<Hit<T>>;
1441
+ hits: Hit<T>[];
1428
1442
  /**
1429
1443
  * Search query.
1430
1444
  */
@@ -1435,15 +1449,68 @@ type SearchHits<T = Record<string, any>> = Record<string, any> & {
1435
1449
  params: string;
1436
1450
  };
1437
1451
 
1438
- type SearchResponse<T = Record<string, any>> = BaseSearchResponse & SearchHits<T> & SearchPagination;
1452
+ type SearchResponse<T = Record<string, any>> = BaseSearchResponse & SearchPagination & SearchHits<T>;
1439
1453
 
1440
- type SearchResult<T = Record<string, any>> = SearchForFacetValuesResponse | SearchResponse<T>;
1454
+ type SearchResult<T = Record<string, any>> = SearchResponse<T> | SearchForFacetValuesResponse;
1441
1455
 
1442
1456
  type SearchResponses<T = Record<string, any>> = {
1443
- results: Array<SearchResult<T>>;
1457
+ results: SearchResult<T>[];
1458
+ };
1459
+
1460
+ /**
1461
+ * Properties for the `customPost` method.
1462
+ */
1463
+ type CustomPostProps = {
1464
+ /**
1465
+ * Path of the endpoint, anything after \"/1\" must be specified.
1466
+ */
1467
+ path: string;
1468
+ /**
1469
+ * Query parameters to apply to the current query.
1470
+ */
1471
+ parameters?: {
1472
+ [key: string]: any;
1473
+ };
1474
+ /**
1475
+ * Parameters to send with the custom request.
1476
+ */
1477
+ body?: Record<string, unknown>;
1478
+ };
1479
+ /**
1480
+ * 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.
1481
+ *
1482
+ * @deprecated This signature will be removed from the next major version, we recommend using the `GetRecommendationsParams` type for performances and future proof reasons.
1483
+ */
1484
+ type LegacyGetRecommendationsParams = RecommendationsRequest[];
1485
+ /**
1486
+ * In v4, the search parameters are wrapped in a `params` parameter.
1487
+ *
1488
+ * @deprecated The `search` method now accepts flat `searchParams` at the root of the method.
1489
+ */
1490
+ type LegacySearchParams = {
1491
+ params?: SearchParamsObject;
1444
1492
  };
1493
+ /**
1494
+ * In v4, the search parameters are wrapped in a `params` parameter.
1495
+ *
1496
+ * @deprecated The `search` method now accepts flat `searchParams` at the root of the method.
1497
+ */
1498
+ type LegacySearchForFacets = LegacySearchParams & SearchForFacetsOptions;
1499
+ /**
1500
+ * In v4, the search parameters are wrapped in a `params` parameter.
1501
+ *
1502
+ * @deprecated The `search` method now accepts flat `searchParams` at the root of the method.
1503
+ */
1504
+ type LegacySearchForHits = LegacySearchParams & SearchForHitsOptions;
1505
+ type LegacySearchQuery = LegacySearchForFacets | LegacySearchForHits;
1506
+ /**
1507
+ * Search method signature compatible with the `algoliasearch` v4 package. When using this signature, extra computation will be required to make it match the new signature.
1508
+ *
1509
+ * @deprecated This signature will be removed from the next major version, we recommend using the `SearchMethodParams` type for performances and future proof reasons.
1510
+ */
1511
+ type LegacySearchMethodProps = LegacySearchQuery[];
1445
1512
 
1446
- declare const apiClientVersion = "5.6.1";
1513
+ declare const apiClientVersion = "5.8.0";
1447
1514
  declare function createLiteClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, ...options }: CreateClientOptions): {
1448
1515
  transporter: _algolia_client_common.Transporter;
1449
1516
  /**
@@ -1494,11 +1561,10 @@ declare function createLiteClient({ appId: appIdOption, apiKey: apiKeyOption, au
1494
1561
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1495
1562
  */
1496
1563
  searchForFacets(searchMethodParams: LegacySearchMethodProps | SearchMethodParams, requestOptions?: RequestOptions): Promise<{
1497
- results: SearchForFacetValuesResponse[];
1564
+ results: Array<SearchForFacetValuesResponse>;
1498
1565
  }>;
1499
1566
  /**
1500
1567
  * This method allow you to send requests to the Algolia REST API.
1501
- *
1502
1568
  * @param customPost - The customPost object.
1503
1569
  * @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.
1504
1570
  * @param customPost.parameters - Query parameters to apply to the current query.
@@ -1510,28 +1576,26 @@ declare function createLiteClient({ appId: appIdOption, apiKey: apiKeyOption, au
1510
1576
  * Retrieves recommendations from selected AI models.
1511
1577
  *
1512
1578
  * Required API Key ACLs:
1513
- * - search.
1514
- *
1579
+ * - search
1515
1580
  * @param getRecommendationsParams - The getRecommendationsParams object.
1516
1581
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1517
1582
  */
1518
1583
  getRecommendations(getRecommendationsParams: GetRecommendationsParams | LegacyGetRecommendationsParams, requestOptions?: RequestOptions): Promise<GetRecommendationsResponse>;
1519
1584
  /**
1520
- * Sends multiple search request to one or more indices. This can be useful in these cases: - Different indices for different purposes, such as, one index for products, another one for marketing content. - Multiple searches to the same index—for example, with different filters.
1585
+ * Sends multiple search requests to one or more indices. This can be useful in these cases: - Different indices for different purposes, such as, one index for products, another one for marketing content. - Multiple searches to the same index—for example, with different filters.
1521
1586
  *
1522
1587
  * Required API Key ACLs:
1523
- * - search.
1524
- *
1588
+ * - search
1525
1589
  * @param searchMethodParams - Muli-search request body. Results are returned in the same order as the requests.
1526
1590
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1527
1591
  */
1528
- search<T>(searchMethodParams: LegacySearchMethodProps | SearchMethodParams, requestOptions?: RequestOptions): Promise<SearchResponses<T>>;
1592
+ search<T>(searchMethodParams: SearchMethodParams | LegacySearchMethodProps, requestOptions?: RequestOptions): Promise<SearchResponses<T>>;
1529
1593
  };
1530
1594
 
1531
1595
  /**
1532
1596
  * Access control list permissions.
1533
1597
  */
1534
- type Acl = 'addObject' | 'analytics' | 'browse' | 'deleteIndex' | 'deleteObject' | 'editSettings' | 'inference' | 'listIndexes' | 'logs' | 'personalization' | 'recommendation' | 'search' | 'seeUnretrievableAttributes' | 'settings' | 'usage';
1598
+ type Acl = 'addObject' | 'analytics' | 'browse' | 'deleteObject' | 'deleteIndex' | 'editSettings' | 'inference' | 'listIndexes' | 'logs' | 'personalization' | 'recommendation' | 'search' | 'seeUnretrievableAttributes' | 'settings' | 'usage';
1535
1599
 
1536
1600
  /**
1537
1601
  * API key object.
@@ -1540,7 +1604,7 @@ type ApiKey = {
1540
1604
  /**
1541
1605
  * Permissions that determine the type of API requests this key can make. The required ACL is listed in each endpoint\'s reference. For more information, see [access control list](https://www.algolia.com/doc/guides/security/api-keys/#access-control-list-acl).
1542
1606
  */
1543
- acl: Acl[];
1607
+ acl: Array<Acl>;
1544
1608
  /**
1545
1609
  * Description of an API key to help you identify this API key.
1546
1610
  */
@@ -1548,7 +1612,7 @@ type ApiKey = {
1548
1612
  /**
1549
1613
  * Index names or patterns that this API key can access. By default, an API key can access all indices in the same application. You can use leading and trailing wildcard characters (`*`): - `dev_*` matches all indices starting with \"dev_\". - `*_dev` matches all indices ending with \"_dev\". - `*_products_*` matches all indices containing \"_products_\".
1550
1614
  */
1551
- indexes?: string[];
1615
+ indexes?: Array<string>;
1552
1616
  /**
1553
1617
  * Maximum number of results this API key can retrieve in one query. By default, there\'s no limit.
1554
1618
  */
@@ -1558,13 +1622,13 @@ type ApiKey = {
1558
1622
  */
1559
1623
  maxQueriesPerIPPerHour?: number;
1560
1624
  /**
1561
- * Query parameters to add when making API requests with this API key. To restrict this API key to specific IP addresses, add the `restrictSources` parameter. You can only add a single source, but you can provide a range of IP addresses. Creating an API key fails if the request is made from an IP address that\'s outside the restricted range.
1625
+ * Query parameters to add when making API requests with this API key. To restrict this API key to specific IP addresses, add the `restrictSources` parameter. You can only add a single source, but you can provide a range of IP addresses. Creating an API key fails if the request is made from an IP address outside the restricted range.
1562
1626
  */
1563
1627
  queryParameters?: string;
1564
1628
  /**
1565
1629
  * Allowed HTTP referrers for this API key. By default, all referrers are allowed. You can use leading and trailing wildcard characters (`*`): - `https://algolia.com/_*` allows all referrers starting with \"https://algolia.com/\" - `*.algolia.com` allows all referrers ending with \".algolia.com\" - `*algolia.com*` allows all referrers in the domain \"algolia.com\". Like all HTTP headers, referrers can be spoofed. Don\'t rely on them to secure your data. For more information, see [HTTP referrer restrictions](https://www.algolia.com/doc/guides/security/security-best-practices/#http-referrers-restrictions).
1566
1630
  */
1567
- referers?: string[];
1631
+ referers?: Array<string>;
1568
1632
  /**
1569
1633
  * Duration (in seconds) after which the API key expires. By default, API keys don\'t expire.
1570
1634
  */
@@ -1592,7 +1656,7 @@ type AutomaticFacetFilter = {
1592
1656
  /**
1593
1657
  * Filter to be applied to the search. You can use this to respond to search queries that match a facet value. For example, if users search for \"comedy\", which matches a facet value of the \"genre\" facet, you can filter the results to show the top-ranked comedy movies.
1594
1658
  */
1595
- type AutomaticFacetFilters = AutomaticFacetFilter[] | string[];
1659
+ type AutomaticFacetFilters = Array<AutomaticFacetFilter> | Array<string>;
1596
1660
 
1597
1661
  type BaseGetApiKeyResponse = {
1598
1662
  /**
@@ -1631,9 +1695,9 @@ type Cursor = {
1631
1695
  cursor?: string;
1632
1696
  };
1633
1697
 
1634
- type BrowseParamsObject = Cursor & SearchParamsObject;
1698
+ type BrowseParamsObject = SearchParamsObject & Cursor;
1635
1699
 
1636
- type BrowseResponse<T = Record<string, any>> = BaseSearchResponse & BrowsePagination & Cursor & SearchHits<T>;
1700
+ type BrowseResponse<T = Record<string, any>> = BaseSearchResponse & BrowsePagination & SearchHits<T> & Cursor;
1637
1701
 
1638
1702
  /**
1639
1703
  * Type of edit.
@@ -1656,11 +1720,11 @@ type ConsequenceQueryObject = {
1656
1720
  /**
1657
1721
  * Words to remove from the search query.
1658
1722
  */
1659
- remove?: string[];
1723
+ remove?: Array<string>;
1660
1724
  /**
1661
1725
  * Changes to make to the search query.
1662
1726
  */
1663
- edits?: Edit[];
1727
+ edits?: Array<Edit>;
1664
1728
  };
1665
1729
 
1666
1730
  /**
@@ -1687,7 +1751,7 @@ type ErrorBase = Record<string, any> & {
1687
1751
  message?: string;
1688
1752
  };
1689
1753
 
1690
- type GetApiKeyResponse = ApiKey & BaseGetApiKeyResponse;
1754
+ type GetApiKeyResponse = BaseGetApiKeyResponse & ApiKey;
1691
1755
 
1692
1756
  /**
1693
1757
  * Index settings.
@@ -1707,4 +1771,4 @@ type LiteClient = ReturnType<typeof createLiteClient>;
1707
1771
 
1708
1772
  declare function liteClient(appId: string, apiKey: string, options?: ClientOptions): LiteClient;
1709
1773
 
1710
- export { type Acl, type AdvancedSyntaxFeatures, type AlternativesAsExact, type ApiKey, type AroundPrecision, type AroundRadius, type AroundRadiusAll, type AutomaticFacetFilter, type AutomaticFacetFilters, type BaseGetApiKeyResponse, type BaseIndexSettings, type BaseRecommendIndexSettings, type BaseRecommendRequest, type BaseRecommendSearchParams, type BaseSearchParams, type BaseSearchParamsWithoutQuery, type BaseSearchResponse, type BooleanString, type BoughtTogetherQuery, type BrowsePagination, type BrowseParamsObject, type BrowseResponse, type ConsequenceParams, type ConsequenceQuery, type ConsequenceQueryObject, type Cursor, type CustomPostProps, type Distinct, type Edit, type EditType, type ErrorBase, type ExactOnSingleWordQuery, type Exhaustive, type FacetFilters, type FacetHits, type FacetOrdering, type FacetStats, type FallbackParams, type FbtModel, type FrequentlyBoughtTogether, type GetApiKeyResponse, type GetRecommendationsParams, type GetRecommendationsResponse, type HighlightResult, type HighlightResultOption, type Hit, type IgnorePlurals, type IndexSettings, type IndexSettingsAsSearchParams, type IndexSettingsFacets, type LegacyGetRecommendationsParams, type LegacySearchMethodProps, type LiteClient, type LookingSimilar, type LookingSimilarModel, type LookingSimilarQuery, type MatchLevel, type MatchedGeoLocation, type Mode, type NumericFilters, type OptionalFilters, type Params, type Personalization, type QueryType, type Range, type RankingInfo, type ReRankingApplyFilter, type RecommendHit, type RecommendIndexSettings, 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 SearchForFacetValuesResponse, type SearchForFacets, type SearchForFacetsOptions, type SearchForHits, type SearchForHitsOptions, type SearchHits, type SearchMethodParams, type SearchPagination, type SearchParams, type SearchParamsObject, type SearchParamsQuery, type SearchParamsString, type SearchQuery, type SearchResponse, type SearchResponses, type SearchResult, type SearchStrategy, type SearchTypeDefault, type SearchTypeFacet, type SemanticSearch, type SettingsResponse, type SnippetResult, type SnippetResultOption, type SortRemainingBy, type SupportedLanguage, type TagFilters, type TrendingFacetHit, type TrendingFacets, type TrendingFacetsModel, type TrendingFacetsQuery, type TrendingItems, type TrendingItemsModel, type TrendingItemsQuery, type TypoTolerance, type TypoToleranceEnum, type Value, type WithPrimary, apiClientVersion, liteClient };
1774
+ export { type Acl, type AdvancedSyntaxFeatures, type AlternativesAsExact, type ApiKey, type AroundPrecision, type AroundRadius, type AroundRadiusAll, type AutomaticFacetFilter, type AutomaticFacetFilters, type Banner, type BannerImage, type BannerImageUrl, type BannerLink, type Banners, type BaseGetApiKeyResponse, type BaseIndexSettings, type BaseRecommendIndexSettings, type BaseRecommendRequest, type BaseRecommendSearchParams, type BaseSearchParams, type BaseSearchParamsWithoutQuery, type BaseSearchResponse, type BooleanString, type BoughtTogetherQuery, type BrowsePagination, type BrowseParamsObject, type BrowseResponse, type ConsequenceParams, type ConsequenceQuery, type ConsequenceQueryObject, type Cursor, type CustomPostProps, type Distinct, type Edit, type EditType, type ErrorBase, type ExactOnSingleWordQuery, type Exhaustive, type FacetFilters, type FacetHits, type FacetOrdering, type FacetStats, type FallbackParams, type FbtModel, type FrequentlyBoughtTogether, type GetApiKeyResponse, type GetRecommendationsParams, type GetRecommendationsResponse, type HighlightResult, type HighlightResultOption, type Hit, type IgnorePlurals, type IndexSettings, type IndexSettingsAsSearchParams, type IndexSettingsFacets, type LegacyGetRecommendationsParams, type LegacySearchMethodProps, type LiteClient, type LookingSimilar, type LookingSimilarModel, type LookingSimilarQuery, type MatchLevel, type MatchedGeoLocation, type Mode, type NumericFilters, type OptionalFilters, type Params, type Personalization, type QueryType, type Range, type RankingInfo, type ReRankingApplyFilter, type RecommendHit, type RecommendIndexSettings, 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 SearchForFacetValuesResponse, type SearchForFacets, type SearchForFacetsOptions, type SearchForHits, type SearchForHitsOptions, type SearchHits, type SearchMethodParams, type SearchPagination, type SearchParams, type SearchParamsObject, type SearchParamsQuery, type SearchParamsString, type SearchQuery, type SearchResponse, type SearchResponses, type SearchResult, type SearchStrategy, type SearchTypeDefault, type SearchTypeFacet, type SemanticSearch, type SettingsResponse, type SnippetResult, type SnippetResultOption, type SortRemainingBy, type SupportedLanguage, type TagFilters, type TrendingFacetHit, type TrendingFacets, type TrendingFacetsModel, type TrendingFacetsQuery, type TrendingItems, type TrendingItemsModel, type TrendingItemsQuery, type TypoTolerance, type TypoToleranceEnum, type Value, type Widgets, type WithPrimary, apiClientVersion, liteClient };