@algolia/recommend 5.0.0-alpha.76 → 5.0.0-alpha.78
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/dist/model/aroundPrecision.d.ts +6 -0
- package/dist/model/aroundPrecision.d.ts.map +1 -0
- package/dist/model/aroundPrecisionFromValueInner.d.ts +5 -0
- package/dist/model/aroundPrecisionFromValueInner.d.ts.map +1 -0
- package/dist/model/baseSearchParamsWithoutQuery.d.ts +14 -18
- package/dist/model/baseSearchParamsWithoutQuery.d.ts.map +1 -1
- package/dist/model/baseSearchResponse.d.ts +0 -8
- package/dist/model/baseSearchResponse.d.ts.map +1 -1
- package/dist/model/index.d.ts +3 -1
- package/dist/model/index.d.ts.map +1 -1
- package/dist/model/indexSettingsAsSearchParams.d.ts +16 -14
- package/dist/model/indexSettingsAsSearchParams.d.ts.map +1 -1
- package/dist/model/recommendHits.d.ts +8 -0
- package/dist/model/recommendHits.d.ts.map +1 -1
- package/dist/model/{indexSettingsAsSearchParamsSemanticSearch.d.ts → semanticSearch.d.ts} +2 -2
- package/dist/model/semanticSearch.d.ts.map +1 -0
- package/dist/{recommend.cjs.js → recommend.cjs} +1 -1
- package/dist/recommend.esm.browser.js +1 -1
- package/dist/recommend.esm.node.js +1 -1
- package/dist/recommend.umd.js +2 -2
- package/dist/src/recommendClient.d.ts +1 -1
- package/index.js +1 -1
- package/model/aroundPrecision.ts +8 -0
- package/model/aroundPrecisionFromValueInner.ts +7 -0
- package/model/baseSearchParamsWithoutQuery.ts +16 -21
- package/model/baseSearchResponse.ts +0 -10
- package/model/index.ts +3 -1
- package/model/indexSettingsAsSearchParams.ts +20 -17
- package/model/recommendHits.ts +10 -0
- package/model/{indexSettingsAsSearchParamsSemanticSearch.ts → semanticSearch.ts} +1 -1
- package/package.json +8 -8
- package/dist/model/indexSettingsAsSearchParamsSemanticSearch.d.ts.map +0 -1
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { AroundPrecisionFromValueInner } from './aroundPrecisionFromValueInner';
|
|
2
|
+
/**
|
|
3
|
+
* Precision of a geographical search (in meters), to [group results that are more or less the same distance from a central point](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/in-depth/geo-ranking-precision/).
|
|
4
|
+
*/
|
|
5
|
+
export type AroundPrecision = AroundPrecisionFromValueInner[] | number;
|
|
6
|
+
//# sourceMappingURL=aroundPrecision.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aroundPrecision.d.ts","sourceRoot":"","sources":["../../model/aroundPrecision.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAErF;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,6BAA6B,EAAE,GAAG,MAAM,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aroundPrecisionFromValueInner.d.ts","sourceRoot":"","sources":["../../model/aroundPrecisionFromValueInner.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,6BAA6B,GAAG;IAC1C,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import type { AroundPrecision } from './aroundPrecision';
|
|
1
2
|
import type { AroundRadius } from './aroundRadius';
|
|
2
3
|
import type { FacetFilters } from './facetFilters';
|
|
3
4
|
import type { NumericFilters } from './numericFilters';
|
|
4
5
|
import type { OptionalFilters } from './optionalFilters';
|
|
5
|
-
import type { ReRankingApplyFilter } from './reRankingApplyFilter';
|
|
6
6
|
import type { TagFilters } from './tagFilters';
|
|
7
7
|
export type BaseSearchParamsWithoutQuery = {
|
|
8
8
|
/**
|
|
@@ -22,21 +22,17 @@ export type BaseSearchParamsWithoutQuery = {
|
|
|
22
22
|
*/
|
|
23
23
|
sumOrFiltersScores?: boolean;
|
|
24
24
|
/**
|
|
25
|
-
*
|
|
25
|
+
* Restricts a query to only look at a subset of your [searchable attributes](https://www.algolia.com/doc/guides/managing-results/must-do/searchable-attributes/).
|
|
26
26
|
*/
|
|
27
|
-
|
|
27
|
+
restrictSearchableAttributes?: string[];
|
|
28
28
|
/**
|
|
29
|
-
*
|
|
29
|
+
* Returns [facets](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#contextual-facet-values-and-counts), their facet values, and the number of matching facet values.
|
|
30
30
|
*/
|
|
31
|
-
|
|
31
|
+
facets?: string[];
|
|
32
32
|
/**
|
|
33
33
|
* Forces faceting to be applied after [de-duplication](https://www.algolia.com/doc/guides/managing-results/refine-results/grouping/) (with the distinct feature). Alternatively, the `afterDistinct` [modifier](https://www.algolia.com/doc/api-reference/api-parameters/attributesForFaceting/#modifiers) of `attributesForFaceting` allows for more granular control.
|
|
34
34
|
*/
|
|
35
35
|
facetingAfterDistinct?: boolean;
|
|
36
|
-
/**
|
|
37
|
-
* Controls how facet values are fetched.
|
|
38
|
-
*/
|
|
39
|
-
sortFacetValuesBy?: string;
|
|
40
36
|
/**
|
|
41
37
|
* Page to retrieve (the first page is `0`, not `1`).
|
|
42
38
|
*/
|
|
@@ -58,10 +54,7 @@ export type BaseSearchParamsWithoutQuery = {
|
|
|
58
54
|
*/
|
|
59
55
|
aroundLatLngViaIP?: boolean;
|
|
60
56
|
aroundRadius?: AroundRadius;
|
|
61
|
-
|
|
62
|
-
* Precision of a geographical search (in meters), to [group results that are more or less the same distance from a central point](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/in-depth/geo-ranking-precision/).
|
|
63
|
-
*/
|
|
64
|
-
aroundPrecision?: number;
|
|
57
|
+
aroundPrecision?: AroundPrecision;
|
|
65
58
|
/**
|
|
66
59
|
* Minimum radius (in meters) used for a geographical search when `aroundRadius` isn\'t set.
|
|
67
60
|
*/
|
|
@@ -94,6 +87,14 @@ export type BaseSearchParamsWithoutQuery = {
|
|
|
94
87
|
* Incidates whether the search response includes [detailed ranking information](https://www.algolia.com/doc/guides/building-search-ui/going-further/backend-search/in-depth/understanding-the-api-response/#ranking-information).
|
|
95
88
|
*/
|
|
96
89
|
getRankingInfo?: boolean;
|
|
90
|
+
/**
|
|
91
|
+
* Enriches the API\'s response with information about how the query was processed.
|
|
92
|
+
*/
|
|
93
|
+
explain?: string[];
|
|
94
|
+
/**
|
|
95
|
+
* Whether to take into account an index\'s synonyms for a particular search.
|
|
96
|
+
*/
|
|
97
|
+
synonyms?: boolean;
|
|
97
98
|
/**
|
|
98
99
|
* Indicates whether a query ID parameter is included in the search response. This is required for [tracking click and conversion events](https://www.algolia.com/doc/guides/sending-events/concepts/event-types/#events-related-to-algolia-requests).
|
|
99
100
|
*/
|
|
@@ -114,10 +115,5 @@ export type BaseSearchParamsWithoutQuery = {
|
|
|
114
115
|
* Incidates whether this search will be considered in A/B testing.
|
|
115
116
|
*/
|
|
116
117
|
enableABTest?: boolean;
|
|
117
|
-
/**
|
|
118
|
-
* Indicates whether this search will use [Dynamic Re-Ranking](https://www.algolia.com/doc/guides/algolia-ai/re-ranking/).
|
|
119
|
-
*/
|
|
120
|
-
enableReRanking?: boolean;
|
|
121
|
-
reRankingApplyFilter?: ReRankingApplyFilter | null;
|
|
122
118
|
};
|
|
123
119
|
//# sourceMappingURL=baseSearchParamsWithoutQuery.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"baseSearchParamsWithoutQuery.d.ts","sourceRoot":"","sources":["../../model/baseSearchParamsWithoutQuery.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"baseSearchParamsWithoutQuery.d.ts","sourceRoot":"","sources":["../../model/baseSearchParamsWithoutQuery.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,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IACH,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IAExB;;OAEG;IACH,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAE/B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IAEnB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IAEzB;;OAEG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAEhC;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC"}
|
|
@@ -70,10 +70,6 @@ export type BaseSearchResponse = {
|
|
|
70
70
|
* Page to retrieve (the first page is `0`, not `1`).
|
|
71
71
|
*/
|
|
72
72
|
page: number;
|
|
73
|
-
/**
|
|
74
|
-
* URL-encoded string of all search parameters.
|
|
75
|
-
*/
|
|
76
|
-
params: string;
|
|
77
73
|
redirect?: BaseSearchResponseRedirect;
|
|
78
74
|
/**
|
|
79
75
|
* 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.
|
|
@@ -83,10 +79,6 @@ export type BaseSearchResponse = {
|
|
|
83
79
|
* Time the server took to process the request, in milliseconds.
|
|
84
80
|
*/
|
|
85
81
|
processingTimeMS: number;
|
|
86
|
-
/**
|
|
87
|
-
* Text to search for in an index.
|
|
88
|
-
*/
|
|
89
|
-
query: string;
|
|
90
82
|
/**
|
|
91
83
|
* Markup text indicating which parts of the original query have been removed to retrieve a non-empty result set.
|
|
92
84
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"baseSearchResponse.d.ts","sourceRoot":"","sources":["../../model/baseSearchResponse.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAC/E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAE3D,MAAM,MAAM,kBAAkB,GAAG;IAC/B;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;OAEG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAEhC;;OAEG;IACH,gBAAgB,EAAE,OAAO,CAAC;IAE1B;;OAEG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAEhD;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IAE3C;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb
|
|
1
|
+
{"version":3,"file":"baseSearchResponse.d.ts","sourceRoot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,CAAC;IAErB;;OAEG;IACH,gBAAgB,EAAE,MAAM,CAAC;IAEzB;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAE/B,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;CACrC,CAAC"}
|
package/dist/model/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export * from './advancedSyntaxFeatures';
|
|
2
2
|
export * from './alternativesAsExact';
|
|
3
3
|
export * from './anchoring';
|
|
4
|
+
export * from './aroundPrecision';
|
|
5
|
+
export * from './aroundPrecisionFromValueInner';
|
|
4
6
|
export * from './aroundRadius';
|
|
5
7
|
export * from './aroundRadiusAll';
|
|
6
8
|
export * from './automaticFacetFilter';
|
|
@@ -35,7 +37,6 @@ export * from './highlightResult';
|
|
|
35
37
|
export * from './highlightResultOption';
|
|
36
38
|
export * from './ignorePlurals';
|
|
37
39
|
export * from './indexSettingsAsSearchParams';
|
|
38
|
-
export * from './indexSettingsAsSearchParamsSemanticSearch';
|
|
39
40
|
export * from './matchLevel';
|
|
40
41
|
export * from './matchedGeoLocation';
|
|
41
42
|
export * from './mixedSearchFilters';
|
|
@@ -68,6 +69,7 @@ export * from './searchParamsObject';
|
|
|
68
69
|
export * from './searchParamsQuery';
|
|
69
70
|
export * from './searchRecommendRulesParams';
|
|
70
71
|
export * from './searchRecommendRulesResponse';
|
|
72
|
+
export * from './semanticSearch';
|
|
71
73
|
export * from './snippetResult';
|
|
72
74
|
export * from './snippetResultOption';
|
|
73
75
|
export * from './sortRemainingBy';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../model/index.ts"],"names":[],"mappings":"AAEA,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC;A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cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,iCAAiC,CAAC;AAChD,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,SAAS,CAAC;AACxB,cAAc,qBAAqB,CAAC"}
|
|
@@ -3,12 +3,13 @@ import type { AlternativesAsExact } from './alternativesAsExact';
|
|
|
3
3
|
import type { Distinct } from './distinct';
|
|
4
4
|
import type { ExactOnSingleWordQuery } from './exactOnSingleWordQuery';
|
|
5
5
|
import type { IgnorePlurals } from './ignorePlurals';
|
|
6
|
-
import type { IndexSettingsAsSearchParamsSemanticSearch } from './indexSettingsAsSearchParamsSemanticSearch';
|
|
7
6
|
import type { Mode } from './mode';
|
|
8
7
|
import type { QueryType } from './queryType';
|
|
8
|
+
import type { ReRankingApplyFilter } from './reRankingApplyFilter';
|
|
9
9
|
import type { RemoveStopWords } from './removeStopWords';
|
|
10
10
|
import type { RemoveWordsIfNoResults } from './removeWordsIfNoResults';
|
|
11
11
|
import type { RenderingContent } from './renderingContent';
|
|
12
|
+
import type { SemanticSearch } from './semanticSearch';
|
|
12
13
|
import type { TypoTolerance } from './typoTolerance';
|
|
13
14
|
export type IndexSettingsAsSearchParams = {
|
|
14
15
|
/**
|
|
@@ -19,10 +20,6 @@ export type IndexSettingsAsSearchParams = {
|
|
|
19
20
|
* Attributes to include in the API response. To reduce the size of your response, you can retrieve only some of the attributes. By default, the response includes all attributes.
|
|
20
21
|
*/
|
|
21
22
|
attributesToRetrieve?: string[];
|
|
22
|
-
/**
|
|
23
|
-
* Restricts a query to only look at a subset of your [searchable attributes](https://www.algolia.com/doc/guides/managing-results/must-do/searchable-attributes/).
|
|
24
|
-
*/
|
|
25
|
-
restrictSearchableAttributes?: string[];
|
|
26
23
|
/**
|
|
27
24
|
* Determines the order in which Algolia [returns your results](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/).
|
|
28
25
|
*/
|
|
@@ -105,7 +102,7 @@ export type IndexSettingsAsSearchParams = {
|
|
|
105
102
|
queryType?: QueryType;
|
|
106
103
|
removeWordsIfNoResults?: RemoveWordsIfNoResults;
|
|
107
104
|
mode?: Mode;
|
|
108
|
-
semanticSearch?:
|
|
105
|
+
semanticSearch?: SemanticSearch;
|
|
109
106
|
/**
|
|
110
107
|
* Enables the [advanced query syntax](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/override-search-engine-defaults/#advanced-syntax).
|
|
111
108
|
*/
|
|
@@ -127,19 +124,11 @@ export type IndexSettingsAsSearchParams = {
|
|
|
127
124
|
* Allows you to specify which advanced syntax features are active when `advancedSyntax` is enabled.
|
|
128
125
|
*/
|
|
129
126
|
advancedSyntaxFeatures?: AdvancedSyntaxFeatures[];
|
|
130
|
-
/**
|
|
131
|
-
* Enriches the API\'s response with information about how the query was processed.
|
|
132
|
-
*/
|
|
133
|
-
explain?: string[];
|
|
134
127
|
distinct?: Distinct;
|
|
135
128
|
/**
|
|
136
129
|
* Name of the deduplication attribute to be used with Algolia\'s [_distinct_ feature](https://www.algolia.com/doc/guides/managing-results/refine-results/grouping/#introducing-algolias-distinct-feature).
|
|
137
130
|
*/
|
|
138
131
|
attributeForDistinct?: string;
|
|
139
|
-
/**
|
|
140
|
-
* Whether to take into account an index\'s synonyms for a particular search.
|
|
141
|
-
*/
|
|
142
|
-
synonyms?: boolean;
|
|
143
132
|
/**
|
|
144
133
|
* Whether to highlight and snippet the original word that matches the synonym or the synonym itself.
|
|
145
134
|
*/
|
|
@@ -156,10 +145,23 @@ export type IndexSettingsAsSearchParams = {
|
|
|
156
145
|
* Maximum number of facet hits to return when [searching for facet values](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#search-for-facet-values).
|
|
157
146
|
*/
|
|
158
147
|
maxFacetHits?: number;
|
|
148
|
+
/**
|
|
149
|
+
* Maximum number of facet values to return for each facet.
|
|
150
|
+
*/
|
|
151
|
+
maxValuesPerFacet?: number;
|
|
152
|
+
/**
|
|
153
|
+
* Controls how facet values are fetched.
|
|
154
|
+
*/
|
|
155
|
+
sortFacetValuesBy?: string;
|
|
159
156
|
/**
|
|
160
157
|
* When the [Attribute criterion is ranked above Proximity](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/#attribute-and-proximity-combinations) in your ranking formula, Proximity is used to select which searchable attribute is matched in the Attribute ranking stage.
|
|
161
158
|
*/
|
|
162
159
|
attributeCriteriaComputedByMinProximity?: boolean;
|
|
163
160
|
renderingContent?: RenderingContent;
|
|
161
|
+
/**
|
|
162
|
+
* Indicates whether this search will use [Dynamic Re-Ranking](https://www.algolia.com/doc/guides/algolia-ai/re-ranking/).
|
|
163
|
+
*/
|
|
164
|
+
enableReRanking?: boolean;
|
|
165
|
+
reRankingApplyFilter?: ReRankingApplyFilter | null;
|
|
164
166
|
};
|
|
165
167
|
//# sourceMappingURL=indexSettingsAsSearchParams.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"indexSettingsAsSearchParams.d.ts","sourceRoot":"","sources":["../../model/indexSettingsAsSearchParams.ts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
|
|
7
|
+
query?: string;
|
|
8
|
+
/**
|
|
9
|
+
* URL-encoded string of all search parameters.
|
|
10
|
+
*/
|
|
11
|
+
params?: string;
|
|
4
12
|
};
|
|
5
13
|
//# sourceMappingURL=recommendHits.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recommendHits.d.ts","sourceRoot":"","sources":["../../model/recommendHits.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,YAAY,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"recommendHits.d.ts","sourceRoot":"","sources":["../../model/recommendHits.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,YAAY,EAAE,CAAC;IAErB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Settings for the semantic search part of NeuralSearch. Only used when `mode` is _neuralSearch_.
|
|
3
3
|
*/
|
|
4
|
-
export type
|
|
4
|
+
export type SemanticSearch = {
|
|
5
5
|
/**
|
|
6
6
|
* Indices from which to collect click and conversion events. If null, the current index and replica group will be used as the event source.
|
|
7
7
|
*/
|
|
8
8
|
eventSources?: string[] | null;
|
|
9
9
|
};
|
|
10
|
-
//# sourceMappingURL=
|
|
10
|
+
//# sourceMappingURL=semanticSearch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"semanticSearch.d.ts","sourceRoot":"","sources":["../../model/semanticSearch.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;CAChC,CAAC"}
|
|
@@ -4,7 +4,7 @@ var clientCommon = require('@algolia/client-common');
|
|
|
4
4
|
var requesterNodeHttp = require('@algolia/requester-node-http');
|
|
5
5
|
|
|
6
6
|
// 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.
|
|
7
|
-
const apiClientVersion = '5.0.0-alpha.
|
|
7
|
+
const apiClientVersion = '5.0.0-alpha.78';
|
|
8
8
|
function getDefaultHosts(appId) {
|
|
9
9
|
return [
|
|
10
10
|
{
|
|
@@ -673,7 +673,7 @@ function createXhrRequester() {
|
|
|
673
673
|
}
|
|
674
674
|
|
|
675
675
|
// 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.
|
|
676
|
-
const apiClientVersion = '5.0.0-alpha.
|
|
676
|
+
const apiClientVersion = '5.0.0-alpha.78';
|
|
677
677
|
function getDefaultHosts(appId) {
|
|
678
678
|
return [
|
|
679
679
|
{
|
|
@@ -2,7 +2,7 @@ import { createAuth, createTransporter, getAlgoliaAgent, shuffle, DEFAULT_CONNEC
|
|
|
2
2
|
import { createHttpRequester } from '@algolia/requester-node-http';
|
|
3
3
|
|
|
4
4
|
// 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.
|
|
5
|
-
const apiClientVersion = '5.0.0-alpha.
|
|
5
|
+
const apiClientVersion = '5.0.0-alpha.78';
|
|
6
6
|
function getDefaultHosts(appId) {
|
|
7
7
|
return [
|
|
8
8
|
{
|
package/dist/recommend.umd.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! recommend.umd.js | 5.0.0-alpha.
|
|
2
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["@algolia/recommend"]={})}(this,(function(e){"use strict";function t(e){let t;const r=`algolia-client-js-${e.key}`;function a(){return void 0===t&&(t=e.localStorage||window.localStorage),t}function o(){return JSON.parse(a().getItem(r)||"{}")}return{get:(e,t,r={miss:()=>Promise.resolve()})=>Promise.resolve().then((()=>{const r=JSON.stringify(e),a=o()[r];return Promise.all([a||t(),void 0!==a])})).then((([e,t])=>Promise.all([e,t||r.miss(e)]))).then((([e])=>e)),set:(e,t)=>Promise.resolve().then((()=>{const s=o();return s[JSON.stringify(e)]=t,a().setItem(r,JSON.stringify(s)),t})),delete:e=>Promise.resolve().then((()=>{const t=o();delete t[JSON.stringify(e)],a().setItem(r,JSON.stringify(t))})),clear:()=>Promise.resolve().then((()=>{a().removeItem(r)}))}}function r(e){const t=[...e.caches],a=t.shift();return void 0===a?{get:(e,t,r={miss:()=>Promise.resolve()})=>t().then((e=>Promise.all([e,r.miss(e)]))).then((([e])=>e)),set:(e,t)=>Promise.resolve(t),delete:e=>Promise.resolve(),clear:()=>Promise.resolve()}:{get:(e,o,s={miss:()=>Promise.resolve()})=>a.get(e,o,s).catch((()=>r({caches:t}).get(e,o,s))),set:(e,o)=>a.set(e,o).catch((()=>r({caches:t}).set(e,o))),delete:e=>a.delete(e).catch((()=>r({caches:t}).delete(e))),clear:()=>a.clear().catch((()=>r({caches:t}).clear()))}}function a(e={serializable:!0}){let t={};return{get(r,a,o={miss:()=>Promise.resolve()}){const s=JSON.stringify(r);if(s in t)return Promise.resolve(e.serializable?JSON.parse(t[s]):t[s]);const n=a();return n.then((e=>o.miss(e))).then((()=>n))},set:(r,a)=>(t[JSON.stringify(r)]=e.serializable?JSON.stringify(a):a,Promise.resolve(a)),delete:e=>(delete t[JSON.stringify(e)],Promise.resolve()),clear:()=>(t={},Promise.resolve())}}const o=12e4;function s(e,t="up"){const r=Date.now();return{...e,status:t,lastUpdate:r,isUp:function(){return"up"===t||Date.now()-r>o},isTimedOut:function(){return"timed out"===t&&Date.now()-r<=o}}}function n(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var a=r.call(e,t||"default");if("object"!=typeof a)return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class i extends Error{constructor(e,t){super(e),n(this,"name","AlgoliaError"),t&&(this.name=t)}}class c extends i{constructor(e,t,r){super(e,r),n(this,"stackTrace",void 0),this.stackTrace=t}}class l extends c{constructor(e){super("Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.",e,"RetryError")}}class u extends c{constructor(e,t,r,a="ApiError"){super(e,r,a),n(this,"status",void 0),this.status=t}}class m extends i{constructor(e,t){super(e,"DeserializationError"),n(this,"response",void 0),this.response=t}}class d extends u{constructor(e,t,r,a){super(e,t,a,"DetailedApiError"),n(this,"error",void 0),this.error=r}}function h(e,t,r){const a=function(e){const t=e=>"[object Object]"===Object.prototype.toString.call(e)||"[object Array]"===Object.prototype.toString.call(e);return Object.keys(e).map((r=>`${r}=${encodeURIComponent(t(e[r])?JSON.stringify(e[r]):e[r])}`)).join("&")}(r);let o=`${e.protocol}://${e.url}/${"/"===t.charAt(0)?t.substr(1):t}`;return a.length&&(o+=`?${a}`),o}function p(e){const t=e.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return{...e,request:{...e.request,headers:{...e.request.headers,...t}}}}function g({hosts:e,hostsCache:t,baseHeaders:r,baseQueryParameters:a,algoliaAgent:o,timeouts:n,requester:i,requestsCache:c,responsesCache:g}){async function f(c,g,f=!0){const w=[],y=function(e,t){if("GET"===e.method||void 0===e.data&&void 0===t.data)return;const r=Array.isArray(e.data)?e.data:{...e.data,...t.data};return JSON.stringify(r)}(c,g),P=function(e,t,r){const a={Accept:"application/json",...e,...t,...r},o={};return Object.keys(a).forEach((e=>{const t=a[e];o[e.toLowerCase()]=t})),o}(r,c.headers,g.headers),q="GET"===c.method?{...c.data,...g.data}:{},b={...a,...c.queryParameters,...q};if(o.value&&(b["x-algolia-agent"]=o.value),g&&g.queryParameters)for(const e of Object.keys(g.queryParameters))g.queryParameters[e]&&"[object Object]"!==Object.prototype.toString.call(g.queryParameters[e])?b[e]=g.queryParameters[e].toString():b[e]=g.queryParameters[e];let v=0;const R=async(e,r)=>{const a=e.pop();if(void 0===a)throw new l(function(e){return e.map((e=>p(e)))}(w));let o=g.timeout;void 0===o&&(o=f?n.read:n.write);const q={data:y,headers:P,method:c.method,url:h(a,c.path,b),connectTimeout:r(v,n.connect),responseTimeout:r(v,o)},T=t=>{const r={request:q,response:t,host:a,triesLeft:e.length};return w.push(r),r},E=await i.send(q);if(function({isTimedOut:e,status:t}){return e||function({isTimedOut:e,status:t}){return!e&&0==~~t}({isTimedOut:e,status:t})||2!=~~(t/100)&&4!=~~(t/100)}(E)){const o=T(E);return E.isTimedOut&&v++,console.log("Retryable failure",p(o)),await t.set(a,s(a,E.isTimedOut?"timed out":"down")),R(e,r)}if(function({status:e}){return 2==~~(e/100)}(E))return function(e){try{return JSON.parse(e.content)}catch(t){throw new m(t.message,e)}}(E);throw T(E),function({content:e,status:t},r){try{const a=JSON.parse(e);return"error"in a?new d(a.message,t,a.error,r):new u(a.message,t,r)}catch(e){}return new u(e,t,r)}(E,w)},T=e.filter((e=>"readWrite"===e.accept||(f?"read"===e.accept:"write"===e.accept))),E=await async function(e){const r=await Promise.all(e.map((e=>t.get(e,(()=>Promise.resolve(s(e))))))),a=r.filter((e=>e.isUp())),o=r.filter((e=>e.isTimedOut())),n=[...a,...o];return{hosts:n.length>0?n:e,getTimeout:(e,t)=>(0===o.length&&0===e?1:o.length+3+e)*t}}(T);return R([...E.hosts].reverse(),E.getTimeout)}return{hostsCache:t,requester:i,timeouts:n,algoliaAgent:o,baseHeaders:r,baseQueryParameters:a,hosts:e,request:function(e,t={}){const o=e.useReadTransporter||"GET"===e.method;if(!o)return f(e,t,o);const s=()=>f(e,t);if(!0!==(t.cacheable||e.cacheable))return s();const n={request:e,requestOptions:t,transporter:{queryParameters:a,headers:r}};return g.get(n,(()=>c.get(n,(()=>c.set(n,s()).then((e=>Promise.all([c.delete(n),e])),(e=>Promise.all([c.delete(n),Promise.reject(e)]))).then((([e,t])=>t))))),{miss:e=>g.set(n,e)})},requestsCache:c,responsesCache:g}}function f({algoliaAgents:e,client:t,version:r}){const a=function(e){const t={value:`Algolia for JavaScript (${e})`,add(e){const r=`; ${e.segment}${void 0!==e.version?` (${e.version})`:""}`;return-1===t.value.indexOf(r)&&(t.value=`${t.value}${r}`),t}};return t}(r).add({segment:t,version:r});return e.forEach((e=>a.add(e))),a}const w="5.0.0-alpha.76";function y(e){return[{url:`${e}-dsn.algolia.net`,accept:"read",protocol:"https"},{url:`${e}.algolia.net`,accept:"write",protocol:"https"}].concat(function(e){const t=e;for(let r=e.length-1;r>0;r--){const a=Math.floor(Math.random()*(r+1)),o=e[r];t[r]=e[a],t[a]=o}return t}([{url:`${e}-1.algolianet.com`,accept:"readWrite",protocol:"https"},{url:`${e}-2.algolianet.com`,accept:"readWrite",protocol:"https"},{url:`${e}-3.algolianet.com`,accept:"readWrite",protocol:"https"}]))}e.apiClientVersion=w,e.recommendClient=function(e,o,s){if(!e||"string"!=typeof e)throw new Error("`appId` is missing.");if(!o||"string"!=typeof o)throw new Error("`apiKey` is missing.");return function({appId:e,apiKey:t,authMode:r,algoliaAgents:a,...o}){const s=function(e,t,r="WithinHeaders"){const a={"x-algolia-api-key":t,"x-algolia-application-id":e};return{headers:()=>"WithinHeaders"===r?a:{},queryParameters:()=>"WithinQueryParameters"===r?a:{}}}(e,t,r),n=g({hosts:y(e),...o,algoliaAgent:f({algoliaAgents:a,client:"Recommend",version:w}),baseHeaders:{"content-type":"text/plain",...s.headers(),...o.baseHeaders},baseQueryParameters:{...s.queryParameters(),...o.baseQueryParameters}});return{transporter:n,appId:e,clearCache:()=>Promise.all([n.requestsCache.clear(),n.responsesCache.clear()]).then((()=>{})),get _ua(){return n.algoliaAgent.value},addAlgoliaAgent(e,t){n.algoliaAgent.add({segment:e,version:t})},del({path:e,parameters:t},r){if(!e)throw new Error("Parameter `path` is required when calling `del`.");const a={method:"DELETE",path:"/1{path}".replace("{path}",e),queryParameters:t||{},headers:{}};return n.request(a,r)},deleteRecommendRule({indexName:e,model:t,objectID:r},a){if(!e)throw new Error("Parameter `indexName` is required when calling `deleteRecommendRule`.");if(!t)throw new Error("Parameter `model` is required when calling `deleteRecommendRule`.");if(!r)throw new Error("Parameter `objectID` is required when calling `deleteRecommendRule`.");const o={method:"DELETE",path:"/1/indexes/{indexName}/{model}/recommend/rules/{objectID}".replace("{indexName}",encodeURIComponent(e)).replace("{model}",encodeURIComponent(t)).replace("{objectID}",encodeURIComponent(r)),queryParameters:{},headers:{}};return n.request(o,a)},get({path:e,parameters:t},r){if(!e)throw new Error("Parameter `path` is required when calling `get`.");const a={method:"GET",path:"/1{path}".replace("{path}",e),queryParameters:t||{},headers:{}};return n.request(a,r)},getRecommendRule({indexName:e,model:t,objectID:r},a){if(!e)throw new Error("Parameter `indexName` is required when calling `getRecommendRule`.");if(!t)throw new Error("Parameter `model` is required when calling `getRecommendRule`.");if(!r)throw new Error("Parameter `objectID` is required when calling `getRecommendRule`.");const o={method:"GET",path:"/1/indexes/{indexName}/{model}/recommend/rules/{objectID}".replace("{indexName}",encodeURIComponent(e)).replace("{model}",encodeURIComponent(t)).replace("{objectID}",encodeURIComponent(r)),queryParameters:{},headers:{}};return n.request(o,a)},getRecommendStatus({indexName:e,model:t,taskID:r},a){if(!e)throw new Error("Parameter `indexName` is required when calling `getRecommendStatus`.");if(!t)throw new Error("Parameter `model` is required when calling `getRecommendStatus`.");if(!r)throw new Error("Parameter `taskID` is required when calling `getRecommendStatus`.");const o={method:"GET",path:"/1/indexes/{indexName}/{model}/task/{taskID}".replace("{indexName}",encodeURIComponent(e)).replace("{model}",encodeURIComponent(t)).replace("{taskID}",encodeURIComponent(r)),queryParameters:{},headers:{}};return n.request(o,a)},getRecommendations(e,t){if(!e)throw new Error("Parameter `getRecommendationsParams` is required when calling `getRecommendations`.");if(!e.requests)throw new Error("Parameter `getRecommendationsParams.requests` is required when calling `getRecommendations`.");const r={method:"POST",path:"/1/indexes/*/recommendations",queryParameters:{},headers:{},data:e,useReadTransporter:!0,cacheable:!0};return n.request(r,t)},post({path:e,parameters:t,body:r},a){if(!e)throw new Error("Parameter `path` is required when calling `post`.");const o={method:"POST",path:"/1{path}".replace("{path}",e),queryParameters:t||{},headers:{},data:r||{}};return n.request(o,a)},put({path:e,parameters:t,body:r},a){if(!e)throw new Error("Parameter `path` is required when calling `put`.");const o={method:"PUT",path:"/1{path}".replace("{path}",e),queryParameters:t||{},headers:{},data:r||{}};return n.request(o,a)},searchRecommendRules({indexName:e,model:t,searchRecommendRulesParams:r},a){if(!e)throw new Error("Parameter `indexName` is required when calling `searchRecommendRules`.");if(!t)throw new Error("Parameter `model` is required when calling `searchRecommendRules`.");const o={method:"POST",path:"/1/indexes/{indexName}/{model}/recommend/rules/search".replace("{indexName}",encodeURIComponent(e)).replace("{model}",encodeURIComponent(t)),queryParameters:{},headers:{},data:r||{},useReadTransporter:!0,cacheable:!0};return n.request(o,a)}}}({appId:e,apiKey:o,timeouts:{connect:1e3,read:2e3,write:3e4},requester:{send:function(e){return new Promise((t=>{const r=new XMLHttpRequest;r.open(e.method,e.url,!0),Object.keys(e.headers).forEach((t=>r.setRequestHeader(t,e.headers[t])));const a=(e,a)=>setTimeout((()=>{r.abort(),t({status:0,content:a,isTimedOut:!0})}),e),o=a(e.connectTimeout,"Connection timeout");let s;r.onreadystatechange=()=>{r.readyState>r.OPENED&&void 0===s&&(clearTimeout(o),s=a(e.responseTimeout,"Socket timeout"))},r.onerror=()=>{0===r.status&&(clearTimeout(o),clearTimeout(s),t({content:r.responseText||"Network request failed",status:r.status,isTimedOut:!1}))},r.onload=()=>{clearTimeout(o),clearTimeout(s),t({content:r.responseText,status:r.status,isTimedOut:!1})},r.send(e.data)}))}},algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:a(),requestsCache:a({serializable:!1}),hostsCache:r({caches:[t({key:`${w}-${e}`}),a()]}),...s})}}));
|
|
1
|
+
/*! recommend.umd.js | 5.0.0-alpha.78 | © Algolia, inc. | https://github.com/algolia/algoliasearch-client-javascript */
|
|
2
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["@algolia/recommend"]={})}(this,(function(e){"use strict";function t(e){let t;const r=`algolia-client-js-${e.key}`;function a(){return void 0===t&&(t=e.localStorage||window.localStorage),t}function o(){return JSON.parse(a().getItem(r)||"{}")}return{get:(e,t,r={miss:()=>Promise.resolve()})=>Promise.resolve().then((()=>{const r=JSON.stringify(e),a=o()[r];return Promise.all([a||t(),void 0!==a])})).then((([e,t])=>Promise.all([e,t||r.miss(e)]))).then((([e])=>e)),set:(e,t)=>Promise.resolve().then((()=>{const s=o();return s[JSON.stringify(e)]=t,a().setItem(r,JSON.stringify(s)),t})),delete:e=>Promise.resolve().then((()=>{const t=o();delete t[JSON.stringify(e)],a().setItem(r,JSON.stringify(t))})),clear:()=>Promise.resolve().then((()=>{a().removeItem(r)}))}}function r(e){const t=[...e.caches],a=t.shift();return void 0===a?{get:(e,t,r={miss:()=>Promise.resolve()})=>t().then((e=>Promise.all([e,r.miss(e)]))).then((([e])=>e)),set:(e,t)=>Promise.resolve(t),delete:e=>Promise.resolve(),clear:()=>Promise.resolve()}:{get:(e,o,s={miss:()=>Promise.resolve()})=>a.get(e,o,s).catch((()=>r({caches:t}).get(e,o,s))),set:(e,o)=>a.set(e,o).catch((()=>r({caches:t}).set(e,o))),delete:e=>a.delete(e).catch((()=>r({caches:t}).delete(e))),clear:()=>a.clear().catch((()=>r({caches:t}).clear()))}}function a(e={serializable:!0}){let t={};return{get(r,a,o={miss:()=>Promise.resolve()}){const s=JSON.stringify(r);if(s in t)return Promise.resolve(e.serializable?JSON.parse(t[s]):t[s]);const n=a();return n.then((e=>o.miss(e))).then((()=>n))},set:(r,a)=>(t[JSON.stringify(r)]=e.serializable?JSON.stringify(a):a,Promise.resolve(a)),delete:e=>(delete t[JSON.stringify(e)],Promise.resolve()),clear:()=>(t={},Promise.resolve())}}const o=12e4;function s(e,t="up"){const r=Date.now();return{...e,status:t,lastUpdate:r,isUp:function(){return"up"===t||Date.now()-r>o},isTimedOut:function(){return"timed out"===t&&Date.now()-r<=o}}}function n(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var a=r.call(e,t||"default");if("object"!=typeof a)return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class i extends Error{constructor(e,t){super(e),n(this,"name","AlgoliaError"),t&&(this.name=t)}}class c extends i{constructor(e,t,r){super(e,r),n(this,"stackTrace",void 0),this.stackTrace=t}}class l extends c{constructor(e){super("Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.",e,"RetryError")}}class u extends c{constructor(e,t,r,a="ApiError"){super(e,r,a),n(this,"status",void 0),this.status=t}}class m extends i{constructor(e,t){super(e,"DeserializationError"),n(this,"response",void 0),this.response=t}}class d extends u{constructor(e,t,r,a){super(e,t,a,"DetailedApiError"),n(this,"error",void 0),this.error=r}}function h(e,t,r){const a=function(e){const t=e=>"[object Object]"===Object.prototype.toString.call(e)||"[object Array]"===Object.prototype.toString.call(e);return Object.keys(e).map((r=>`${r}=${encodeURIComponent(t(e[r])?JSON.stringify(e[r]):e[r])}`)).join("&")}(r);let o=`${e.protocol}://${e.url}/${"/"===t.charAt(0)?t.substr(1):t}`;return a.length&&(o+=`?${a}`),o}function p(e){const t=e.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return{...e,request:{...e.request,headers:{...e.request.headers,...t}}}}function g({hosts:e,hostsCache:t,baseHeaders:r,baseQueryParameters:a,algoliaAgent:o,timeouts:n,requester:i,requestsCache:c,responsesCache:g}){async function f(c,g,f=!0){const w=[],y=function(e,t){if("GET"===e.method||void 0===e.data&&void 0===t.data)return;const r=Array.isArray(e.data)?e.data:{...e.data,...t.data};return JSON.stringify(r)}(c,g),P=function(e,t,r){const a={Accept:"application/json",...e,...t,...r},o={};return Object.keys(a).forEach((e=>{const t=a[e];o[e.toLowerCase()]=t})),o}(r,c.headers,g.headers),q="GET"===c.method?{...c.data,...g.data}:{},b={...a,...c.queryParameters,...q};if(o.value&&(b["x-algolia-agent"]=o.value),g&&g.queryParameters)for(const e of Object.keys(g.queryParameters))g.queryParameters[e]&&"[object Object]"!==Object.prototype.toString.call(g.queryParameters[e])?b[e]=g.queryParameters[e].toString():b[e]=g.queryParameters[e];let v=0;const R=async(e,r)=>{const a=e.pop();if(void 0===a)throw new l(function(e){return e.map((e=>p(e)))}(w));let o=g.timeout;void 0===o&&(o=f?n.read:n.write);const q={data:y,headers:P,method:c.method,url:h(a,c.path,b),connectTimeout:r(v,n.connect),responseTimeout:r(v,o)},T=t=>{const r={request:q,response:t,host:a,triesLeft:e.length};return w.push(r),r},E=await i.send(q);if(function({isTimedOut:e,status:t}){return e||function({isTimedOut:e,status:t}){return!e&&0==~~t}({isTimedOut:e,status:t})||2!=~~(t/100)&&4!=~~(t/100)}(E)){const o=T(E);return E.isTimedOut&&v++,console.log("Retryable failure",p(o)),await t.set(a,s(a,E.isTimedOut?"timed out":"down")),R(e,r)}if(function({status:e}){return 2==~~(e/100)}(E))return function(e){try{return JSON.parse(e.content)}catch(t){throw new m(t.message,e)}}(E);throw T(E),function({content:e,status:t},r){try{const a=JSON.parse(e);return"error"in a?new d(a.message,t,a.error,r):new u(a.message,t,r)}catch(e){}return new u(e,t,r)}(E,w)},T=e.filter((e=>"readWrite"===e.accept||(f?"read"===e.accept:"write"===e.accept))),E=await async function(e){const r=await Promise.all(e.map((e=>t.get(e,(()=>Promise.resolve(s(e))))))),a=r.filter((e=>e.isUp())),o=r.filter((e=>e.isTimedOut())),n=[...a,...o];return{hosts:n.length>0?n:e,getTimeout:(e,t)=>(0===o.length&&0===e?1:o.length+3+e)*t}}(T);return R([...E.hosts].reverse(),E.getTimeout)}return{hostsCache:t,requester:i,timeouts:n,algoliaAgent:o,baseHeaders:r,baseQueryParameters:a,hosts:e,request:function(e,t={}){const o=e.useReadTransporter||"GET"===e.method;if(!o)return f(e,t,o);const s=()=>f(e,t);if(!0!==(t.cacheable||e.cacheable))return s();const n={request:e,requestOptions:t,transporter:{queryParameters:a,headers:r}};return g.get(n,(()=>c.get(n,(()=>c.set(n,s()).then((e=>Promise.all([c.delete(n),e])),(e=>Promise.all([c.delete(n),Promise.reject(e)]))).then((([e,t])=>t))))),{miss:e=>g.set(n,e)})},requestsCache:c,responsesCache:g}}function f({algoliaAgents:e,client:t,version:r}){const a=function(e){const t={value:`Algolia for JavaScript (${e})`,add(e){const r=`; ${e.segment}${void 0!==e.version?` (${e.version})`:""}`;return-1===t.value.indexOf(r)&&(t.value=`${t.value}${r}`),t}};return t}(r).add({segment:t,version:r});return e.forEach((e=>a.add(e))),a}const w="5.0.0-alpha.78";function y(e){return[{url:`${e}-dsn.algolia.net`,accept:"read",protocol:"https"},{url:`${e}.algolia.net`,accept:"write",protocol:"https"}].concat(function(e){const t=e;for(let r=e.length-1;r>0;r--){const a=Math.floor(Math.random()*(r+1)),o=e[r];t[r]=e[a],t[a]=o}return t}([{url:`${e}-1.algolianet.com`,accept:"readWrite",protocol:"https"},{url:`${e}-2.algolianet.com`,accept:"readWrite",protocol:"https"},{url:`${e}-3.algolianet.com`,accept:"readWrite",protocol:"https"}]))}e.apiClientVersion=w,e.recommendClient=function(e,o,s){if(!e||"string"!=typeof e)throw new Error("`appId` is missing.");if(!o||"string"!=typeof o)throw new Error("`apiKey` is missing.");return function({appId:e,apiKey:t,authMode:r,algoliaAgents:a,...o}){const s=function(e,t,r="WithinHeaders"){const a={"x-algolia-api-key":t,"x-algolia-application-id":e};return{headers:()=>"WithinHeaders"===r?a:{},queryParameters:()=>"WithinQueryParameters"===r?a:{}}}(e,t,r),n=g({hosts:y(e),...o,algoliaAgent:f({algoliaAgents:a,client:"Recommend",version:w}),baseHeaders:{"content-type":"text/plain",...s.headers(),...o.baseHeaders},baseQueryParameters:{...s.queryParameters(),...o.baseQueryParameters}});return{transporter:n,appId:e,clearCache:()=>Promise.all([n.requestsCache.clear(),n.responsesCache.clear()]).then((()=>{})),get _ua(){return n.algoliaAgent.value},addAlgoliaAgent(e,t){n.algoliaAgent.add({segment:e,version:t})},del({path:e,parameters:t},r){if(!e)throw new Error("Parameter `path` is required when calling `del`.");const a={method:"DELETE",path:"/1{path}".replace("{path}",e),queryParameters:t||{},headers:{}};return n.request(a,r)},deleteRecommendRule({indexName:e,model:t,objectID:r},a){if(!e)throw new Error("Parameter `indexName` is required when calling `deleteRecommendRule`.");if(!t)throw new Error("Parameter `model` is required when calling `deleteRecommendRule`.");if(!r)throw new Error("Parameter `objectID` is required when calling `deleteRecommendRule`.");const o={method:"DELETE",path:"/1/indexes/{indexName}/{model}/recommend/rules/{objectID}".replace("{indexName}",encodeURIComponent(e)).replace("{model}",encodeURIComponent(t)).replace("{objectID}",encodeURIComponent(r)),queryParameters:{},headers:{}};return n.request(o,a)},get({path:e,parameters:t},r){if(!e)throw new Error("Parameter `path` is required when calling `get`.");const a={method:"GET",path:"/1{path}".replace("{path}",e),queryParameters:t||{},headers:{}};return n.request(a,r)},getRecommendRule({indexName:e,model:t,objectID:r},a){if(!e)throw new Error("Parameter `indexName` is required when calling `getRecommendRule`.");if(!t)throw new Error("Parameter `model` is required when calling `getRecommendRule`.");if(!r)throw new Error("Parameter `objectID` is required when calling `getRecommendRule`.");const o={method:"GET",path:"/1/indexes/{indexName}/{model}/recommend/rules/{objectID}".replace("{indexName}",encodeURIComponent(e)).replace("{model}",encodeURIComponent(t)).replace("{objectID}",encodeURIComponent(r)),queryParameters:{},headers:{}};return n.request(o,a)},getRecommendStatus({indexName:e,model:t,taskID:r},a){if(!e)throw new Error("Parameter `indexName` is required when calling `getRecommendStatus`.");if(!t)throw new Error("Parameter `model` is required when calling `getRecommendStatus`.");if(!r)throw new Error("Parameter `taskID` is required when calling `getRecommendStatus`.");const o={method:"GET",path:"/1/indexes/{indexName}/{model}/task/{taskID}".replace("{indexName}",encodeURIComponent(e)).replace("{model}",encodeURIComponent(t)).replace("{taskID}",encodeURIComponent(r)),queryParameters:{},headers:{}};return n.request(o,a)},getRecommendations(e,t){if(!e)throw new Error("Parameter `getRecommendationsParams` is required when calling `getRecommendations`.");if(!e.requests)throw new Error("Parameter `getRecommendationsParams.requests` is required when calling `getRecommendations`.");const r={method:"POST",path:"/1/indexes/*/recommendations",queryParameters:{},headers:{},data:e,useReadTransporter:!0,cacheable:!0};return n.request(r,t)},post({path:e,parameters:t,body:r},a){if(!e)throw new Error("Parameter `path` is required when calling `post`.");const o={method:"POST",path:"/1{path}".replace("{path}",e),queryParameters:t||{},headers:{},data:r||{}};return n.request(o,a)},put({path:e,parameters:t,body:r},a){if(!e)throw new Error("Parameter `path` is required when calling `put`.");const o={method:"PUT",path:"/1{path}".replace("{path}",e),queryParameters:t||{},headers:{},data:r||{}};return n.request(o,a)},searchRecommendRules({indexName:e,model:t,searchRecommendRulesParams:r},a){if(!e)throw new Error("Parameter `indexName` is required when calling `searchRecommendRules`.");if(!t)throw new Error("Parameter `model` is required when calling `searchRecommendRules`.");const o={method:"POST",path:"/1/indexes/{indexName}/{model}/recommend/rules/search".replace("{indexName}",encodeURIComponent(e)).replace("{model}",encodeURIComponent(t)),queryParameters:{},headers:{},data:r||{},useReadTransporter:!0,cacheable:!0};return n.request(o,a)}}}({appId:e,apiKey:o,timeouts:{connect:1e3,read:2e3,write:3e4},requester:{send:function(e){return new Promise((t=>{const r=new XMLHttpRequest;r.open(e.method,e.url,!0),Object.keys(e.headers).forEach((t=>r.setRequestHeader(t,e.headers[t])));const a=(e,a)=>setTimeout((()=>{r.abort(),t({status:0,content:a,isTimedOut:!0})}),e),o=a(e.connectTimeout,"Connection timeout");let s;r.onreadystatechange=()=>{r.readyState>r.OPENED&&void 0===s&&(clearTimeout(o),s=a(e.responseTimeout,"Socket timeout"))},r.onerror=()=>{0===r.status&&(clearTimeout(o),clearTimeout(s),t({content:r.responseText||"Network request failed",status:r.status,isTimedOut:!1}))},r.onload=()=>{clearTimeout(o),clearTimeout(s),t({content:r.responseText,status:r.status,isTimedOut:!1})},r.send(e.data)}))}},algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:a(),requestsCache:a({serializable:!1}),hostsCache:r({caches:[t({key:`${w}-${e}`}),a()]}),...s})}}));
|
|
@@ -6,7 +6,7 @@ import type { GetRecommendationsParams } from '../model/getRecommendationsParams
|
|
|
6
6
|
import type { GetRecommendationsResponse } from '../model/getRecommendationsResponse';
|
|
7
7
|
import type { RuleResponse } from '../model/ruleResponse';
|
|
8
8
|
import type { SearchRecommendRulesResponse } from '../model/searchRecommendRulesResponse';
|
|
9
|
-
export declare const apiClientVersion = "5.0.0-alpha.
|
|
9
|
+
export declare const apiClientVersion = "5.0.0-alpha.78";
|
|
10
10
|
export declare function createRecommendClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, ...options }: CreateClientOptions): {
|
|
11
11
|
transporter: import("@algolia/client-common").Transporter;
|
|
12
12
|
/**
|
package/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// eslint-disable-next-line import/no-commonjs,import/extensions
|
|
2
|
-
module.exports = require('./dist/recommend.cjs
|
|
2
|
+
module.exports = require('./dist/recommend.cjs');
|
|
@@ -0,0 +1,8 @@
|
|
|
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 { AroundPrecisionFromValueInner } from './aroundPrecisionFromValueInner';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Precision of a geographical search (in meters), to [group results that are more or less the same distance from a central point](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/in-depth/geo-ranking-precision/).
|
|
7
|
+
*/
|
|
8
|
+
export type AroundPrecision = AroundPrecisionFromValueInner[] | number;
|
|
@@ -0,0 +1,7 @@
|
|
|
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
|
+
export type AroundPrecisionFromValueInner = {
|
|
4
|
+
from?: number;
|
|
5
|
+
|
|
6
|
+
value?: number;
|
|
7
|
+
};
|
|
@@ -1,10 +1,10 @@
|
|
|
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 type { AroundPrecision } from './aroundPrecision';
|
|
3
4
|
import type { AroundRadius } from './aroundRadius';
|
|
4
5
|
import type { FacetFilters } from './facetFilters';
|
|
5
6
|
import type { NumericFilters } from './numericFilters';
|
|
6
7
|
import type { OptionalFilters } from './optionalFilters';
|
|
7
|
-
import type { ReRankingApplyFilter } from './reRankingApplyFilter';
|
|
8
8
|
import type { TagFilters } from './tagFilters';
|
|
9
9
|
|
|
10
10
|
export type BaseSearchParamsWithoutQuery = {
|
|
@@ -32,25 +32,20 @@ export type BaseSearchParamsWithoutQuery = {
|
|
|
32
32
|
sumOrFiltersScores?: boolean;
|
|
33
33
|
|
|
34
34
|
/**
|
|
35
|
-
*
|
|
35
|
+
* Restricts a query to only look at a subset of your [searchable attributes](https://www.algolia.com/doc/guides/managing-results/must-do/searchable-attributes/).
|
|
36
36
|
*/
|
|
37
|
-
|
|
37
|
+
restrictSearchableAttributes?: string[];
|
|
38
38
|
|
|
39
39
|
/**
|
|
40
|
-
*
|
|
40
|
+
* Returns [facets](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#contextual-facet-values-and-counts), their facet values, and the number of matching facet values.
|
|
41
41
|
*/
|
|
42
|
-
|
|
42
|
+
facets?: string[];
|
|
43
43
|
|
|
44
44
|
/**
|
|
45
45
|
* Forces faceting to be applied after [de-duplication](https://www.algolia.com/doc/guides/managing-results/refine-results/grouping/) (with the distinct feature). Alternatively, the `afterDistinct` [modifier](https://www.algolia.com/doc/api-reference/api-parameters/attributesForFaceting/#modifiers) of `attributesForFaceting` allows for more granular control.
|
|
46
46
|
*/
|
|
47
47
|
facetingAfterDistinct?: boolean;
|
|
48
48
|
|
|
49
|
-
/**
|
|
50
|
-
* Controls how facet values are fetched.
|
|
51
|
-
*/
|
|
52
|
-
sortFacetValuesBy?: string;
|
|
53
|
-
|
|
54
49
|
/**
|
|
55
50
|
* Page to retrieve (the first page is `0`, not `1`).
|
|
56
51
|
*/
|
|
@@ -78,10 +73,7 @@ export type BaseSearchParamsWithoutQuery = {
|
|
|
78
73
|
|
|
79
74
|
aroundRadius?: AroundRadius;
|
|
80
75
|
|
|
81
|
-
|
|
82
|
-
* Precision of a geographical search (in meters), to [group results that are more or less the same distance from a central point](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/in-depth/geo-ranking-precision/).
|
|
83
|
-
*/
|
|
84
|
-
aroundPrecision?: number;
|
|
76
|
+
aroundPrecision?: AroundPrecision;
|
|
85
77
|
|
|
86
78
|
/**
|
|
87
79
|
* Minimum radius (in meters) used for a geographical search when `aroundRadius` isn\'t set.
|
|
@@ -123,6 +115,16 @@ export type BaseSearchParamsWithoutQuery = {
|
|
|
123
115
|
*/
|
|
124
116
|
getRankingInfo?: boolean;
|
|
125
117
|
|
|
118
|
+
/**
|
|
119
|
+
* Enriches the API\'s response with information about how the query was processed.
|
|
120
|
+
*/
|
|
121
|
+
explain?: string[];
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Whether to take into account an index\'s synonyms for a particular search.
|
|
125
|
+
*/
|
|
126
|
+
synonyms?: boolean;
|
|
127
|
+
|
|
126
128
|
/**
|
|
127
129
|
* Indicates whether a query ID parameter is included in the search response. This is required for [tracking click and conversion events](https://www.algolia.com/doc/guides/sending-events/concepts/event-types/#events-related-to-algolia-requests).
|
|
128
130
|
*/
|
|
@@ -147,11 +149,4 @@ export type BaseSearchParamsWithoutQuery = {
|
|
|
147
149
|
* Incidates whether this search will be considered in A/B testing.
|
|
148
150
|
*/
|
|
149
151
|
enableABTest?: boolean;
|
|
150
|
-
|
|
151
|
-
/**
|
|
152
|
-
* Indicates whether this search will use [Dynamic Re-Ranking](https://www.algolia.com/doc/guides/algolia-ai/re-ranking/).
|
|
153
|
-
*/
|
|
154
|
-
enableReRanking?: boolean;
|
|
155
|
-
|
|
156
|
-
reRankingApplyFilter?: ReRankingApplyFilter | null;
|
|
157
152
|
};
|
|
@@ -90,11 +90,6 @@ export type BaseSearchResponse = {
|
|
|
90
90
|
*/
|
|
91
91
|
page: number;
|
|
92
92
|
|
|
93
|
-
/**
|
|
94
|
-
* URL-encoded string of all search parameters.
|
|
95
|
-
*/
|
|
96
|
-
params: string;
|
|
97
|
-
|
|
98
93
|
redirect?: BaseSearchResponseRedirect;
|
|
99
94
|
|
|
100
95
|
/**
|
|
@@ -107,11 +102,6 @@ export type BaseSearchResponse = {
|
|
|
107
102
|
*/
|
|
108
103
|
processingTimeMS: number;
|
|
109
104
|
|
|
110
|
-
/**
|
|
111
|
-
* Text to search for in an index.
|
|
112
|
-
*/
|
|
113
|
-
query: string;
|
|
114
|
-
|
|
115
105
|
/**
|
|
116
106
|
* Markup text indicating which parts of the original query have been removed to retrieve a non-empty result set.
|
|
117
107
|
*/
|
package/model/index.ts
CHANGED
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
export * from './advancedSyntaxFeatures';
|
|
4
4
|
export * from './alternativesAsExact';
|
|
5
5
|
export * from './anchoring';
|
|
6
|
+
export * from './aroundPrecision';
|
|
7
|
+
export * from './aroundPrecisionFromValueInner';
|
|
6
8
|
export * from './aroundRadius';
|
|
7
9
|
export * from './aroundRadiusAll';
|
|
8
10
|
export * from './automaticFacetFilter';
|
|
@@ -37,7 +39,6 @@ export * from './highlightResult';
|
|
|
37
39
|
export * from './highlightResultOption';
|
|
38
40
|
export * from './ignorePlurals';
|
|
39
41
|
export * from './indexSettingsAsSearchParams';
|
|
40
|
-
export * from './indexSettingsAsSearchParamsSemanticSearch';
|
|
41
42
|
export * from './matchLevel';
|
|
42
43
|
export * from './matchedGeoLocation';
|
|
43
44
|
export * from './mixedSearchFilters';
|
|
@@ -70,6 +71,7 @@ export * from './searchParamsObject';
|
|
|
70
71
|
export * from './searchParamsQuery';
|
|
71
72
|
export * from './searchRecommendRulesParams';
|
|
72
73
|
export * from './searchRecommendRulesResponse';
|
|
74
|
+
export * from './semanticSearch';
|
|
73
75
|
export * from './snippetResult';
|
|
74
76
|
export * from './snippetResultOption';
|
|
75
77
|
export * from './sortRemainingBy';
|
|
@@ -5,12 +5,13 @@ import type { AlternativesAsExact } from './alternativesAsExact';
|
|
|
5
5
|
import type { Distinct } from './distinct';
|
|
6
6
|
import type { ExactOnSingleWordQuery } from './exactOnSingleWordQuery';
|
|
7
7
|
import type { IgnorePlurals } from './ignorePlurals';
|
|
8
|
-
import type { IndexSettingsAsSearchParamsSemanticSearch } from './indexSettingsAsSearchParamsSemanticSearch';
|
|
9
8
|
import type { Mode } from './mode';
|
|
10
9
|
import type { QueryType } from './queryType';
|
|
10
|
+
import type { ReRankingApplyFilter } from './reRankingApplyFilter';
|
|
11
11
|
import type { RemoveStopWords } from './removeStopWords';
|
|
12
12
|
import type { RemoveWordsIfNoResults } from './removeWordsIfNoResults';
|
|
13
13
|
import type { RenderingContent } from './renderingContent';
|
|
14
|
+
import type { SemanticSearch } from './semanticSearch';
|
|
14
15
|
import type { TypoTolerance } from './typoTolerance';
|
|
15
16
|
|
|
16
17
|
export type IndexSettingsAsSearchParams = {
|
|
@@ -24,11 +25,6 @@ export type IndexSettingsAsSearchParams = {
|
|
|
24
25
|
*/
|
|
25
26
|
attributesToRetrieve?: string[];
|
|
26
27
|
|
|
27
|
-
/**
|
|
28
|
-
* Restricts a query to only look at a subset of your [searchable attributes](https://www.algolia.com/doc/guides/managing-results/must-do/searchable-attributes/).
|
|
29
|
-
*/
|
|
30
|
-
restrictSearchableAttributes?: string[];
|
|
31
|
-
|
|
32
28
|
/**
|
|
33
29
|
* Determines the order in which Algolia [returns your results](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/).
|
|
34
30
|
*/
|
|
@@ -136,7 +132,7 @@ export type IndexSettingsAsSearchParams = {
|
|
|
136
132
|
|
|
137
133
|
mode?: Mode;
|
|
138
134
|
|
|
139
|
-
semanticSearch?:
|
|
135
|
+
semanticSearch?: SemanticSearch;
|
|
140
136
|
|
|
141
137
|
/**
|
|
142
138
|
* Enables the [advanced query syntax](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/override-search-engine-defaults/#advanced-syntax).
|
|
@@ -165,11 +161,6 @@ export type IndexSettingsAsSearchParams = {
|
|
|
165
161
|
*/
|
|
166
162
|
advancedSyntaxFeatures?: AdvancedSyntaxFeatures[];
|
|
167
163
|
|
|
168
|
-
/**
|
|
169
|
-
* Enriches the API\'s response with information about how the query was processed.
|
|
170
|
-
*/
|
|
171
|
-
explain?: string[];
|
|
172
|
-
|
|
173
164
|
distinct?: Distinct;
|
|
174
165
|
|
|
175
166
|
/**
|
|
@@ -177,11 +168,6 @@ export type IndexSettingsAsSearchParams = {
|
|
|
177
168
|
*/
|
|
178
169
|
attributeForDistinct?: string;
|
|
179
170
|
|
|
180
|
-
/**
|
|
181
|
-
* Whether to take into account an index\'s synonyms for a particular search.
|
|
182
|
-
*/
|
|
183
|
-
synonyms?: boolean;
|
|
184
|
-
|
|
185
171
|
/**
|
|
186
172
|
* Whether to highlight and snippet the original word that matches the synonym or the synonym itself.
|
|
187
173
|
*/
|
|
@@ -202,10 +188,27 @@ export type IndexSettingsAsSearchParams = {
|
|
|
202
188
|
*/
|
|
203
189
|
maxFacetHits?: number;
|
|
204
190
|
|
|
191
|
+
/**
|
|
192
|
+
* Maximum number of facet values to return for each facet.
|
|
193
|
+
*/
|
|
194
|
+
maxValuesPerFacet?: number;
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Controls how facet values are fetched.
|
|
198
|
+
*/
|
|
199
|
+
sortFacetValuesBy?: string;
|
|
200
|
+
|
|
205
201
|
/**
|
|
206
202
|
* When the [Attribute criterion is ranked above Proximity](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/#attribute-and-proximity-combinations) in your ranking formula, Proximity is used to select which searchable attribute is matched in the Attribute ranking stage.
|
|
207
203
|
*/
|
|
208
204
|
attributeCriteriaComputedByMinProximity?: boolean;
|
|
209
205
|
|
|
210
206
|
renderingContent?: RenderingContent;
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* Indicates whether this search will use [Dynamic Re-Ranking](https://www.algolia.com/doc/guides/algolia-ai/re-ranking/).
|
|
210
|
+
*/
|
|
211
|
+
enableReRanking?: boolean;
|
|
212
|
+
|
|
213
|
+
reRankingApplyFilter?: ReRankingApplyFilter | null;
|
|
211
214
|
};
|
package/model/recommendHits.ts
CHANGED
|
@@ -4,4 +4,14 @@ import type { RecommendHit } from './recommendHit';
|
|
|
4
4
|
|
|
5
5
|
export type RecommendHits = {
|
|
6
6
|
hits: RecommendHit[];
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Text to search for in an index.
|
|
10
|
+
*/
|
|
11
|
+
query?: string;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* URL-encoded string of all search parameters.
|
|
15
|
+
*/
|
|
16
|
+
params?: string;
|
|
7
17
|
};
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
/**
|
|
4
4
|
* Settings for the semantic search part of NeuralSearch. Only used when `mode` is _neuralSearch_.
|
|
5
5
|
*/
|
|
6
|
-
export type
|
|
6
|
+
export type SemanticSearch = {
|
|
7
7
|
/**
|
|
8
8
|
* Indices from which to collect click and conversion events. If null, the current index and replica group will be used as the event source.
|
|
9
9
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@algolia/recommend",
|
|
3
|
-
"version": "5.0.0-alpha.
|
|
3
|
+
"version": "5.0.0-alpha.78",
|
|
4
4
|
"description": "JavaScript client for recommend",
|
|
5
5
|
"repository": "algolia/algoliasearch-client-javascript",
|
|
6
6
|
"license": "MIT",
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
"node": {
|
|
12
12
|
"import": "./dist/recommend.esm.node.js",
|
|
13
13
|
"module": "./dist/recommend.esm.node.js",
|
|
14
|
-
"require": "./dist/recommend.cjs
|
|
15
|
-
"default": "./dist/recommend.cjs
|
|
14
|
+
"require": "./dist/recommend.cjs",
|
|
15
|
+
"default": "./dist/recommend.cjs"
|
|
16
16
|
},
|
|
17
17
|
"default": {
|
|
18
18
|
"umd": "./dist/recommend.umd.js",
|
|
@@ -39,13 +39,13 @@
|
|
|
39
39
|
"clean": "rm -rf ./dist || true"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@algolia/client-common": "5.0.0-alpha.
|
|
43
|
-
"@algolia/requester-browser-xhr": "5.0.0-alpha.
|
|
44
|
-
"@algolia/requester-node-http": "5.0.0-alpha.
|
|
42
|
+
"@algolia/client-common": "5.0.0-alpha.78",
|
|
43
|
+
"@algolia/requester-browser-xhr": "5.0.0-alpha.78",
|
|
44
|
+
"@algolia/requester-node-http": "5.0.0-alpha.78"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@types/node": "18.17.
|
|
48
|
-
"rollup": "3.
|
|
47
|
+
"@types/node": "18.17.5",
|
|
48
|
+
"rollup": "3.28.0",
|
|
49
49
|
"typescript": "5.1.6"
|
|
50
50
|
},
|
|
51
51
|
"engines": {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"indexSettingsAsSearchParamsSemanticSearch.d.ts","sourceRoot":"","sources":["../../model/indexSettingsAsSearchParamsSemanticSearch.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,MAAM,yCAAyC,GAAG;IACtD;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;CAChC,CAAC"}
|