algoliasearch 5.7.0 → 5.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -8
- package/builds/browser.ts +5 -4
- package/builds/fetch.ts +5 -4
- package/builds/models.ts +13 -3
- package/builds/node.ts +5 -4
- package/dist/algoliasearch.umd.js +1 -1
- package/dist/browser.d.ts +1 -1
- package/dist/browser.js +6 -6
- package/dist/browser.js.map +1 -1
- package/dist/browser.min.js +1 -1
- package/dist/browser.min.js.map +1 -1
- package/dist/fetch.d.ts +1 -1
- package/dist/fetch.js +6 -6
- package/dist/fetch.js.map +1 -1
- package/dist/lite/browser.d.ts +642 -583
- package/dist/lite/builds/browser.js +8 -11
- package/dist/lite/builds/browser.js.map +1 -1
- package/dist/lite/builds/browser.min.js +1 -1
- package/dist/lite/builds/browser.min.js.map +1 -1
- package/dist/lite/builds/browser.umd.js +2 -2
- package/dist/lite/builds/node.cjs +5 -8
- package/dist/lite/builds/node.cjs.map +1 -1
- package/dist/lite/builds/node.js +6 -9
- package/dist/lite/builds/node.js.map +1 -1
- package/dist/lite/node.d.cts +642 -582
- package/dist/lite/node.d.ts +642 -582
- package/dist/lite/src/liteClient.cjs +4 -7
- package/dist/lite/src/liteClient.cjs.map +1 -1
- package/dist/lite/src/liteClient.js +4 -7
- package/dist/lite/src/liteClient.js.map +1 -1
- package/dist/node.cjs +3 -3
- package/dist/node.cjs.map +1 -1
- package/dist/node.d.cts +1 -1
- package/dist/node.d.ts +1 -1
- package/dist/node.js +6 -6
- package/dist/node.js.map +1 -1
- package/index.d.ts +0 -1
- package/index.js +1 -2
- package/lite/builds/browser.ts +10 -9
- package/lite/builds/node.ts +7 -6
- package/lite/model/acl.ts +1 -1
- package/lite/model/alternativesAsExact.ts +1 -1
- package/lite/model/apiKey.ts +4 -4
- package/lite/model/aroundPrecision.ts +1 -1
- package/lite/model/aroundRadius.ts +1 -1
- package/lite/model/automaticFacetFilters.ts +1 -1
- package/lite/model/banner.ts +13 -0
- package/lite/model/bannerImage.ts +12 -0
- package/lite/model/bannerImageUrl.ts +8 -0
- package/lite/model/bannerLink.ts +8 -0
- package/lite/model/baseIndexSettings.ts +15 -15
- package/lite/model/baseRecommendIndexSettings.ts +14 -14
- package/lite/model/baseRecommendSearchParams.ts +8 -8
- package/lite/model/baseSearchParams.ts +1 -1
- package/lite/model/baseSearchParamsWithoutQuery.ts +8 -8
- package/lite/model/baseSearchResponse.ts +2 -2
- package/lite/model/booleanString.ts +1 -1
- package/lite/model/browseParamsObject.ts +1 -1
- package/lite/model/browseResponse.ts +1 -1
- package/lite/model/clientMethodProps.ts +2 -2
- package/lite/model/consequenceQueryObject.ts +2 -2
- package/lite/model/facetFilters.ts +1 -1
- package/lite/model/facetOrdering.ts +1 -1
- package/lite/model/getApiKeyResponse.ts +1 -1
- package/lite/model/getRecommendationsParams.ts +1 -1
- package/lite/model/getRecommendationsResponse.ts +1 -1
- package/lite/model/highlightResult.ts +1 -1
- package/lite/model/highlightResultOption.ts +1 -1
- package/lite/model/hit.ts +2 -2
- package/lite/model/ignorePlurals.ts +1 -1
- package/lite/model/index.ts +12 -7
- package/lite/model/indexSettingsAsSearchParams.ts +15 -15
- package/lite/model/indexSettingsFacets.ts +1 -1
- package/lite/model/matchLevel.ts +1 -1
- package/lite/model/mode.ts +1 -1
- package/lite/model/numericFilters.ts +2 -2
- package/lite/model/optionalFilters.ts +1 -1
- package/lite/model/queryType.ts +2 -2
- package/lite/model/reRankingApplyFilter.ts +1 -1
- package/lite/model/recommendHit.ts +2 -2
- package/lite/model/recommendSearchParams.ts +1 -1
- package/lite/model/recommendationsHit.ts +1 -0
- package/lite/model/recommendationsHits.ts +1 -1
- package/lite/model/recommendationsRequest.ts +5 -3
- package/lite/model/recommendationsResults.ts +1 -1
- package/lite/model/redirect.ts +1 -1
- package/lite/model/removeStopWords.ts +1 -1
- package/lite/model/removeWordsIfNoResults.ts +1 -1
- package/lite/model/renderingContent.ts +4 -1
- package/lite/model/searchForFacetValuesResponse.ts +1 -1
- package/lite/model/searchForFacets.ts +1 -1
- package/lite/model/searchForHits.ts +1 -1
- package/lite/model/searchHits.ts +1 -1
- package/lite/model/searchMethodParams.ts +1 -1
- package/lite/model/searchParams.ts +1 -1
- package/lite/model/searchQuery.ts +1 -1
- package/lite/model/searchResponse.ts +1 -1
- package/lite/model/searchResponses.ts +1 -1
- package/lite/model/searchResult.ts +1 -1
- package/lite/model/semanticSearch.ts +1 -1
- package/lite/model/snippetResult.ts +1 -1
- package/lite/model/sortRemainingBy.ts +1 -1
- package/lite/model/supportedLanguage.ts +1 -1
- package/lite/model/tagFilters.ts +1 -1
- package/lite/model/typoTolerance.ts +2 -2
- package/lite/model/value.ts +2 -2
- package/lite/model/widgets.ts +13 -0
- package/lite/src/liteClient.ts +15 -18
- package/lite.d.ts +0 -1
- package/lite.js +1 -2
- package/package.json +13 -13
|
@@ -19,17 +19,17 @@ export type IndexSettingsAsSearchParams = {
|
|
|
19
19
|
/**
|
|
20
20
|
* 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.
|
|
21
21
|
*/
|
|
22
|
-
attributesToRetrieve?: string
|
|
22
|
+
attributesToRetrieve?: Array<string>;
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
25
|
* 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/).
|
|
26
26
|
*/
|
|
27
|
-
ranking?: string
|
|
27
|
+
ranking?: Array<string>;
|
|
28
28
|
|
|
29
29
|
/**
|
|
30
30
|
* 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.
|
|
31
31
|
*/
|
|
32
|
-
customRanking?: string
|
|
32
|
+
customRanking?: Array<string>;
|
|
33
33
|
|
|
34
34
|
/**
|
|
35
35
|
* 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.
|
|
@@ -39,12 +39,12 @@ export type IndexSettingsAsSearchParams = {
|
|
|
39
39
|
/**
|
|
40
40
|
* 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/).
|
|
41
41
|
*/
|
|
42
|
-
attributesToHighlight?: string
|
|
42
|
+
attributesToHighlight?: Array<string>;
|
|
43
43
|
|
|
44
44
|
/**
|
|
45
45
|
* 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.
|
|
46
46
|
*/
|
|
47
|
-
attributesToSnippet?: string
|
|
47
|
+
attributesToSnippet?: Array<string>;
|
|
48
48
|
|
|
49
49
|
/**
|
|
50
50
|
* HTML tag to insert before the highlighted parts in all highlighted results and snippets.
|
|
@@ -91,7 +91,7 @@ export type IndexSettingsAsSearchParams = {
|
|
|
91
91
|
/**
|
|
92
92
|
* 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.
|
|
93
93
|
*/
|
|
94
|
-
disableTypoToleranceOnAttributes?: string
|
|
94
|
+
disableTypoToleranceOnAttributes?: Array<string>;
|
|
95
95
|
|
|
96
96
|
ignorePlurals?: IgnorePlurals;
|
|
97
97
|
|
|
@@ -105,7 +105,7 @@ export type IndexSettingsAsSearchParams = {
|
|
|
105
105
|
/**
|
|
106
106
|
* 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/).
|
|
107
107
|
*/
|
|
108
|
-
queryLanguages?: SupportedLanguage
|
|
108
|
+
queryLanguages?: Array<SupportedLanguage>;
|
|
109
109
|
|
|
110
110
|
/**
|
|
111
111
|
* 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).
|
|
@@ -136,31 +136,31 @@ export type IndexSettingsAsSearchParams = {
|
|
|
136
136
|
advancedSyntax?: boolean;
|
|
137
137
|
|
|
138
138
|
/**
|
|
139
|
-
* 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
|
|
139
|
+
* 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).
|
|
140
140
|
*/
|
|
141
|
-
optionalWords?: string
|
|
141
|
+
optionalWords?: Array<string>;
|
|
142
142
|
|
|
143
143
|
/**
|
|
144
|
-
* 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
|
|
144
|
+
* 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.
|
|
145
145
|
*/
|
|
146
|
-
disableExactOnAttributes?: string
|
|
146
|
+
disableExactOnAttributes?: Array<string>;
|
|
147
147
|
|
|
148
148
|
exactOnSingleWordQuery?: ExactOnSingleWordQuery;
|
|
149
149
|
|
|
150
150
|
/**
|
|
151
151
|
* 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.
|
|
152
152
|
*/
|
|
153
|
-
alternativesAsExact?: AlternativesAsExact
|
|
153
|
+
alternativesAsExact?: Array<AlternativesAsExact>;
|
|
154
154
|
|
|
155
155
|
/**
|
|
156
156
|
* 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.
|
|
157
157
|
*/
|
|
158
|
-
advancedSyntaxFeatures?: AdvancedSyntaxFeatures
|
|
158
|
+
advancedSyntaxFeatures?: Array<AdvancedSyntaxFeatures>;
|
|
159
159
|
|
|
160
160
|
distinct?: Distinct;
|
|
161
161
|
|
|
162
162
|
/**
|
|
163
|
-
* 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
|
|
163
|
+
* 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.
|
|
164
164
|
*/
|
|
165
165
|
replaceSynonymsInHighlight?: boolean;
|
|
166
166
|
|
|
@@ -172,7 +172,7 @@ export type IndexSettingsAsSearchParams = {
|
|
|
172
172
|
/**
|
|
173
173
|
* 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.
|
|
174
174
|
*/
|
|
175
|
-
responseFields?: string
|
|
175
|
+
responseFields?: Array<string>;
|
|
176
176
|
|
|
177
177
|
/**
|
|
178
178
|
* 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).
|
package/lite/model/matchLevel.ts
CHANGED
package/lite/model/mode.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* 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: `<`, `<=`, `=`, `!=`, `>`, `>=`.
|
|
4
|
+
* 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`.
|
|
5
5
|
*/
|
|
6
|
-
export type NumericFilters = NumericFilters
|
|
6
|
+
export type NumericFilters = Array<NumericFilters> | string;
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
/**
|
|
4
4
|
* 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.
|
|
5
5
|
*/
|
|
6
|
-
export type OptionalFilters = OptionalFilters
|
|
6
|
+
export type OptionalFilters = Array<OptionalFilters> | string;
|
package/lite/model/queryType.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* 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/).
|
|
4
|
+
* 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/).
|
|
5
5
|
*/
|
|
6
|
-
export type QueryType = '
|
|
6
|
+
export type QueryType = 'prefixLast' | 'prefixAll' | 'prefixNone';
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
/**
|
|
4
4
|
* Restrict [Dynamic Re-Ranking](https://www.algolia.com/doc/guides/algolia-ai/re-ranking/) to records that match these filters.
|
|
5
5
|
*/
|
|
6
|
-
export type ReRankingApplyFilter = ReRankingApplyFilter
|
|
6
|
+
export type ReRankingApplyFilter = Array<ReRankingApplyFilter> | string;
|
|
@@ -16,12 +16,12 @@ export type RecommendHit = Record<string, any> & {
|
|
|
16
16
|
/**
|
|
17
17
|
* Surround words that match the query with HTML tags for highlighting.
|
|
18
18
|
*/
|
|
19
|
-
_highlightResult?:
|
|
19
|
+
_highlightResult?: { [key: string]: HighlightResult };
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
22
|
* Snippets that show the context around a matching search query.
|
|
23
23
|
*/
|
|
24
|
-
_snippetResult?:
|
|
24
|
+
_snippetResult?: { [key: string]: SnippetResult };
|
|
25
25
|
|
|
26
26
|
_rankingInfo?: RankingInfo;
|
|
27
27
|
|
|
@@ -7,4 +7,4 @@ import type { SearchParamsQuery } from './searchParamsQuery';
|
|
|
7
7
|
/**
|
|
8
8
|
* Search parameters for filtering the recommendations.
|
|
9
9
|
*/
|
|
10
|
-
export type RecommendSearchParams = BaseRecommendSearchParams &
|
|
10
|
+
export type RecommendSearchParams = BaseRecommendSearchParams & SearchParamsQuery & RecommendIndexSettings;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
|
|
2
2
|
|
|
3
3
|
import type { RecommendHit } from './recommendHit';
|
|
4
|
+
|
|
4
5
|
import type { TrendingFacetHit } from './trendingFacetHit';
|
|
5
6
|
|
|
6
7
|
export type RecommendationsHit = RecommendHit | TrendingFacetHit;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
|
|
2
2
|
|
|
3
3
|
import type { BoughtTogetherQuery } from './boughtTogetherQuery';
|
|
4
|
+
|
|
4
5
|
import type { LookingSimilarQuery } from './lookingSimilarQuery';
|
|
6
|
+
|
|
5
7
|
import type { RecommendedForYouQuery } from './recommendedForYouQuery';
|
|
6
8
|
import type { RelatedQuery } from './relatedQuery';
|
|
7
9
|
import type { TrendingFacetsQuery } from './trendingFacetsQuery';
|
|
@@ -9,8 +11,8 @@ import type { TrendingItemsQuery } from './trendingItemsQuery';
|
|
|
9
11
|
|
|
10
12
|
export type RecommendationsRequest =
|
|
11
13
|
| BoughtTogetherQuery
|
|
12
|
-
| LookingSimilarQuery
|
|
13
|
-
| RecommendedForYouQuery
|
|
14
14
|
| RelatedQuery
|
|
15
|
+
| TrendingItemsQuery
|
|
15
16
|
| TrendingFacetsQuery
|
|
16
|
-
|
|
|
17
|
+
| LookingSimilarQuery
|
|
18
|
+
| RecommendedForYouQuery;
|
|
@@ -4,4 +4,4 @@ import type { BaseSearchResponse } from './baseSearchResponse';
|
|
|
4
4
|
import type { RecommendationsHits } from './recommendationsHits';
|
|
5
5
|
import type { SearchPagination } from './searchPagination';
|
|
6
6
|
|
|
7
|
-
export type RecommendationsResults = BaseSearchResponse &
|
|
7
|
+
export type RecommendationsResults = BaseSearchResponse & SearchPagination & RecommendationsHits;
|
package/lite/model/redirect.ts
CHANGED
|
@@ -6,5 +6,5 @@ import type { RedirectRuleIndexMetadata } from './redirectRuleIndexMetadata';
|
|
|
6
6
|
* [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.
|
|
7
7
|
*/
|
|
8
8
|
export type Redirect = {
|
|
9
|
-
index?: RedirectRuleIndexMetadata
|
|
9
|
+
index?: Array<RedirectRuleIndexMetadata>;
|
|
10
10
|
};
|
|
@@ -5,4 +5,4 @@ import type { SupportedLanguage } from './supportedLanguage';
|
|
|
5
5
|
/**
|
|
6
6
|
* 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.
|
|
7
7
|
*/
|
|
8
|
-
export type RemoveStopWords = SupportedLanguage
|
|
8
|
+
export type RemoveStopWords = Array<SupportedLanguage> | boolean;
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
/**
|
|
4
4
|
* 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/).
|
|
5
5
|
*/
|
|
6
|
-
export type RemoveWordsIfNoResults = '
|
|
6
|
+
export type RemoveWordsIfNoResults = 'none' | 'lastWords' | 'firstWords' | 'allOptional';
|
|
@@ -2,12 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
import type { FacetOrdering } from './facetOrdering';
|
|
4
4
|
import type { RedirectURL } from './redirectURL';
|
|
5
|
+
import type { Widgets } from './widgets';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
|
-
* Extra data that can be used in the search UI. You can use this to control aspects of your search UI, such as
|
|
8
|
+
* 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.
|
|
8
9
|
*/
|
|
9
10
|
export type RenderingContent = {
|
|
10
11
|
facetOrdering?: FacetOrdering;
|
|
11
12
|
|
|
12
13
|
redirect?: RedirectURL;
|
|
14
|
+
|
|
15
|
+
widgets?: Widgets;
|
|
13
16
|
};
|
|
@@ -6,7 +6,7 @@ export type SearchForFacetValuesResponse = {
|
|
|
6
6
|
/**
|
|
7
7
|
* Matching facet values.
|
|
8
8
|
*/
|
|
9
|
-
facetHits: FacetHits
|
|
9
|
+
facetHits: Array<FacetHits>;
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* 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-).
|
package/lite/model/searchHits.ts
CHANGED
|
@@ -6,7 +6,7 @@ export type SearchHits<T = Record<string, any>> = Record<string, any> & {
|
|
|
6
6
|
/**
|
|
7
7
|
* Search results (hits). Hits are records from your index that match the search criteria, augmented with additional attributes, such as, for highlighting.
|
|
8
8
|
*/
|
|
9
|
-
hits:
|
|
9
|
+
hits: Hit<T>[];
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* Search query.
|
|
@@ -4,4 +4,4 @@ import type { BaseSearchResponse } from './baseSearchResponse';
|
|
|
4
4
|
import type { SearchHits } from './searchHits';
|
|
5
5
|
import type { SearchPagination } from './searchPagination';
|
|
6
6
|
|
|
7
|
-
export type SearchResponse<T = Record<string, any>> = BaseSearchResponse & SearchHits<T
|
|
7
|
+
export type SearchResponse<T = Record<string, any>> = BaseSearchResponse & SearchPagination & SearchHits<T>;
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
import type { SearchForFacetValuesResponse } from './searchForFacetValuesResponse';
|
|
4
4
|
import type { SearchResponse } from './searchResponse';
|
|
5
5
|
|
|
6
|
-
export type SearchResult<T = Record<string, any>> =
|
|
6
|
+
export type SearchResult<T = Record<string, any>> = SearchResponse<T> | SearchForFacetValuesResponse;
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
|
|
3
3
|
import type { SnippetResultOption } from './snippetResultOption';
|
|
4
4
|
|
|
5
|
-
export type SnippetResult =
|
|
5
|
+
export type SnippetResult = SnippetResultOption | { [key: string]: SnippetResult } | Array<SnippetResult>;
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
/**
|
|
4
4
|
* 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.
|
|
5
5
|
*/
|
|
6
|
-
export type SortRemainingBy = '
|
|
6
|
+
export type SortRemainingBy = 'count' | 'alpha' | 'hidden';
|
package/lite/model/tagFilters.ts
CHANGED
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
/**
|
|
4
4
|
* 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`.
|
|
5
5
|
*/
|
|
6
|
-
export type TagFilters = TagFilters
|
|
6
|
+
export type TagFilters = Array<TagFilters> | string;
|
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
import type { TypoToleranceEnum } from './typoToleranceEnum';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
* 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
|
|
6
|
+
* 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.
|
|
7
7
|
*/
|
|
8
|
-
export type TypoTolerance =
|
|
8
|
+
export type TypoTolerance = boolean | TypoToleranceEnum;
|
package/lite/model/value.ts
CHANGED
|
@@ -6,12 +6,12 @@ export type Value = {
|
|
|
6
6
|
/**
|
|
7
7
|
* Explicit order of facets or facet values. This setting lets you always show specific facets or facet values at the top of the list.
|
|
8
8
|
*/
|
|
9
|
-
order?: string
|
|
9
|
+
order?: Array<string>;
|
|
10
10
|
|
|
11
11
|
sortRemainingBy?: SortRemainingBy;
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Hide facet values.
|
|
15
15
|
*/
|
|
16
|
-
hide?: string
|
|
16
|
+
hide?: Array<string>;
|
|
17
17
|
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
|
|
2
|
+
|
|
3
|
+
import type { Banner } from './banner';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* widgets returned from any rules that are applied to the current search.
|
|
7
|
+
*/
|
|
8
|
+
export type Widgets = {
|
|
9
|
+
/**
|
|
10
|
+
* banners defined in the merchandising studio for the given search.
|
|
11
|
+
*/
|
|
12
|
+
banners?: Array<Banner>;
|
|
13
|
+
};
|
package/lite/src/liteClient.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
|
|
2
2
|
|
|
3
|
-
import { createAuth, createTransporter, getAlgoliaAgent, shuffle } from '@algolia/client-common';
|
|
4
3
|
import type {
|
|
5
4
|
CreateClientOptions,
|
|
6
5
|
Headers,
|
|
@@ -9,20 +8,23 @@ import type {
|
|
|
9
8
|
Request,
|
|
10
9
|
RequestOptions,
|
|
11
10
|
} from '@algolia/client-common';
|
|
11
|
+
import { createAuth, createTransporter, getAlgoliaAgent, shuffle } from '@algolia/client-common';
|
|
12
|
+
|
|
13
|
+
import type { GetRecommendationsParams } from '../model/getRecommendationsParams';
|
|
14
|
+
import type { GetRecommendationsResponse } from '../model/getRecommendationsResponse';
|
|
15
|
+
import type { SearchMethodParams } from '../model/searchMethodParams';
|
|
16
|
+
import type { SearchResponses } from '../model/searchResponses';
|
|
12
17
|
|
|
13
18
|
import type {
|
|
14
19
|
CustomPostProps,
|
|
15
20
|
LegacyGetRecommendationsParams,
|
|
16
21
|
LegacySearchMethodProps,
|
|
17
22
|
} from '../model/clientMethodProps';
|
|
18
|
-
|
|
19
|
-
import type { GetRecommendationsResponse } from '../model/getRecommendationsResponse';
|
|
23
|
+
|
|
20
24
|
import type { SearchForFacetValuesResponse } from '../model/searchForFacetValuesResponse';
|
|
21
|
-
import type { SearchMethodParams } from '../model/searchMethodParams';
|
|
22
25
|
import type { SearchResponse } from '../model/searchResponse';
|
|
23
|
-
import type { SearchResponses } from '../model/searchResponses';
|
|
24
26
|
|
|
25
|
-
export const apiClientVersion = '5.
|
|
27
|
+
export const apiClientVersion = '5.8.1';
|
|
26
28
|
|
|
27
29
|
function getDefaultHosts(appId: string): Host[] {
|
|
28
30
|
return (
|
|
@@ -59,7 +61,6 @@ function getDefaultHosts(appId: string): Host[] {
|
|
|
59
61
|
);
|
|
60
62
|
}
|
|
61
63
|
|
|
62
|
-
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
63
64
|
export function createLiteClient({
|
|
64
65
|
appId: appIdOption,
|
|
65
66
|
apiKey: apiKeyOption,
|
|
@@ -132,6 +133,7 @@ export function createLiteClient({
|
|
|
132
133
|
transporter.baseQueryParameters['x-algolia-api-key'] = apiKey;
|
|
133
134
|
}
|
|
134
135
|
},
|
|
136
|
+
|
|
135
137
|
/**
|
|
136
138
|
* Helper: calls the `search` method but with certainty that we will only request Algolia records (hits) and not facets.
|
|
137
139
|
* Disclaimer: We don't assert that the parameters you pass to this method only contains `hits` requests to prevent impacting search performances, this helper is purely for typing purposes.
|
|
@@ -158,14 +160,13 @@ export function createLiteClient({
|
|
|
158
160
|
searchForFacets(
|
|
159
161
|
searchMethodParams: LegacySearchMethodProps | SearchMethodParams,
|
|
160
162
|
requestOptions?: RequestOptions,
|
|
161
|
-
): Promise<{ results: SearchForFacetValuesResponse
|
|
163
|
+
): Promise<{ results: Array<SearchForFacetValuesResponse> }> {
|
|
162
164
|
return this.search(searchMethodParams, requestOptions) as Promise<{
|
|
163
|
-
results: SearchForFacetValuesResponse
|
|
165
|
+
results: Array<SearchForFacetValuesResponse>;
|
|
164
166
|
}>;
|
|
165
167
|
},
|
|
166
168
|
/**
|
|
167
169
|
* This method allow you to send requests to the Algolia REST API.
|
|
168
|
-
*
|
|
169
170
|
* @param customPost - The customPost object.
|
|
170
171
|
* @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
171
172
|
* @param customPost.parameters - Query parameters to apply to the current query.
|
|
@@ -199,8 +200,7 @@ export function createLiteClient({
|
|
|
199
200
|
* Retrieves recommendations from selected AI models.
|
|
200
201
|
*
|
|
201
202
|
* Required API Key ACLs:
|
|
202
|
-
*
|
|
203
|
-
*
|
|
203
|
+
* - search
|
|
204
204
|
* @param getRecommendationsParams - The getRecommendationsParams object.
|
|
205
205
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
206
206
|
*/
|
|
@@ -213,7 +213,6 @@ export function createLiteClient({
|
|
|
213
213
|
requests: getRecommendationsParams,
|
|
214
214
|
};
|
|
215
215
|
|
|
216
|
-
// eslint-disable-next-line no-param-reassign
|
|
217
216
|
getRecommendationsParams = newSignatureRequest;
|
|
218
217
|
}
|
|
219
218
|
|
|
@@ -243,16 +242,15 @@ export function createLiteClient({
|
|
|
243
242
|
},
|
|
244
243
|
|
|
245
244
|
/**
|
|
246
|
-
* Sends multiple search
|
|
245
|
+
* 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.
|
|
247
246
|
*
|
|
248
247
|
* Required API Key ACLs:
|
|
249
|
-
*
|
|
250
|
-
*
|
|
248
|
+
* - search
|
|
251
249
|
* @param searchMethodParams - Muli-search request body. Results are returned in the same order as the requests.
|
|
252
250
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
253
251
|
*/
|
|
254
252
|
search<T>(
|
|
255
|
-
searchMethodParams:
|
|
253
|
+
searchMethodParams: SearchMethodParams | LegacySearchMethodProps,
|
|
256
254
|
requestOptions?: RequestOptions,
|
|
257
255
|
): Promise<SearchResponses<T>> {
|
|
258
256
|
if (searchMethodParams && Array.isArray(searchMethodParams)) {
|
|
@@ -276,7 +274,6 @@ export function createLiteClient({
|
|
|
276
274
|
}),
|
|
277
275
|
};
|
|
278
276
|
|
|
279
|
-
// eslint-disable-next-line no-param-reassign
|
|
280
277
|
searchMethodParams = newSignatureRequest;
|
|
281
278
|
}
|
|
282
279
|
|
package/lite.d.ts
CHANGED
package/lite.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
module.exports = require('./dist/lite/builds/node.cjs');
|
|
1
|
+
module.exports = require('./dist/lite/builds/node.cjs');
|