@wix/search 1.0.24 → 1.0.26
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/package.json +4 -5
- package/type-bundles/context.bundle.d.ts +96 -57
- package/type-bundles/index.bundle.d.ts +98 -59
- package/type-bundles/meta.bundle.d.ts +174 -108
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/search",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.26",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"registry": "https://registry.npmjs.org/",
|
|
6
6
|
"access": "public"
|
|
@@ -18,11 +18,10 @@
|
|
|
18
18
|
"type-bundles"
|
|
19
19
|
],
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@wix/search_site-search": "1.0.
|
|
22
|
-
"@wix/search_wix-site-search": "1.0.
|
|
21
|
+
"@wix/search_site-search": "1.0.18",
|
|
22
|
+
"@wix/search_wix-site-search": "1.0.5"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@wix/sdk": "https://cdn.dev.wixpress.com/@wix/sdk/02e8069ab2fd783e0e6a080fc7d590e76cb26ab93c8389574286305b.tar.gz",
|
|
26
25
|
"glob": "^10.4.1",
|
|
27
26
|
"rollup": "^4.18.0",
|
|
28
27
|
"rollup-plugin-dts": "^6.1.1",
|
|
@@ -44,5 +43,5 @@
|
|
|
44
43
|
"fqdn": ""
|
|
45
44
|
}
|
|
46
45
|
},
|
|
47
|
-
"falconPackageHash": "
|
|
46
|
+
"falconPackageHash": "c99c829af6b73405b814dbc570e8fc40a712c72b25967fc25454c1fa"
|
|
48
47
|
}
|
|
@@ -1,24 +1,40 @@
|
|
|
1
1
|
interface SiteDocument {
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* Results ID.
|
|
4
|
+
* @readonly
|
|
5
|
+
*/
|
|
3
6
|
_id?: string;
|
|
4
|
-
/**
|
|
5
|
-
|
|
7
|
+
/** The docuement payload. */
|
|
8
|
+
data?: Record<string, any> | null;
|
|
6
9
|
}
|
|
7
10
|
interface Search extends SearchPagingMethodOneOf {
|
|
8
|
-
/**
|
|
11
|
+
/** Paging options to limit and skip the number of items. */
|
|
9
12
|
paging?: Paging;
|
|
10
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* Filter object in the following format:
|
|
15
|
+
* `"filter" : {
|
|
16
|
+
* "fieldName1": "value1",
|
|
17
|
+
* "fieldName2":{"$operator":"value2"}
|
|
18
|
+
* }`
|
|
19
|
+
* Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`
|
|
20
|
+
*/
|
|
11
21
|
filter?: Record<string, any> | null;
|
|
12
|
-
/**
|
|
22
|
+
/**
|
|
23
|
+
* Sort object in the following format:
|
|
24
|
+
* `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`
|
|
25
|
+
*/
|
|
13
26
|
sort?: Sorting[];
|
|
14
|
-
/**
|
|
27
|
+
/**
|
|
28
|
+
* A search method for grouping data into various categories (facets) and providing summaries for each category.
|
|
29
|
+
* For example, use aggregations to allow site visitors to narrow down their search results by selecting specific categories such as price ranges, brand names, and ratings.
|
|
30
|
+
*/
|
|
15
31
|
aggregations?: Aggregation$1[];
|
|
16
|
-
/** Free text to match in searchable fields */
|
|
32
|
+
/** Free text to match in searchable fields. */
|
|
17
33
|
search?: SearchDetails;
|
|
18
34
|
}
|
|
19
35
|
/** @oneof */
|
|
20
36
|
interface SearchPagingMethodOneOf {
|
|
21
|
-
/**
|
|
37
|
+
/** Paging options to limit and skip the number of items. */
|
|
22
38
|
paging?: Paging;
|
|
23
39
|
}
|
|
24
40
|
interface Sorting {
|
|
@@ -32,26 +48,32 @@ declare enum SortOrder {
|
|
|
32
48
|
DESC = "DESC"
|
|
33
49
|
}
|
|
34
50
|
interface Aggregation$1 extends AggregationKindOneOf {
|
|
35
|
-
/**
|
|
51
|
+
/** A value aggregation calculates metrics such as count for specific fields within a dataset, providing insights into the overall distribution and key statistics of those values. For example, use a value aggregation to get the number of products (count) for each price listed in the store. */
|
|
36
52
|
value?: ValueAggregation;
|
|
37
|
-
/**
|
|
53
|
+
/** A scalar aggregation calculates a single numerical value from a dataset, such as the total sum, average, min, or max, summarizing the dataset into one key metric. For example, use a scalar aggregation to get the minimum price listed in the store. */
|
|
38
54
|
scalar?: ScalarAggregation;
|
|
39
|
-
/**
|
|
55
|
+
/**
|
|
56
|
+
* A nested aggregation is applied within the results of another aggregation. Rather than aggregating directly on the primary dataset, first group data using one aggregation and then apply another aggregation within each group. It allows for more complex analyses where you can summarize data at different levels of detail or hierarchy.
|
|
57
|
+
* For example, to get the number of products that are in stock and out of stock for each price listed, first perform a value aggregation on `discountedPriceNumeric`, and a second value aggregation on `inStock`.
|
|
58
|
+
*/
|
|
40
59
|
nested?: NestedAggregation;
|
|
41
|
-
/**
|
|
60
|
+
/** Aggregation name displayed in the return. */
|
|
42
61
|
name?: string | null;
|
|
43
|
-
/** Type of aggregation
|
|
62
|
+
/** Type of aggregation to perform. */
|
|
44
63
|
type?: AggregationType;
|
|
45
|
-
/** Field to aggregate by
|
|
64
|
+
/** Field to aggregate by. */
|
|
46
65
|
fieldPath?: string;
|
|
47
66
|
}
|
|
48
67
|
/** @oneof */
|
|
49
68
|
interface AggregationKindOneOf {
|
|
50
|
-
/**
|
|
69
|
+
/** A value aggregation calculates metrics such as count for specific fields within a dataset, providing insights into the overall distribution and key statistics of those values. For example, use a value aggregation to get the number of products (count) for each price listed in the store. */
|
|
51
70
|
value?: ValueAggregation;
|
|
52
|
-
/**
|
|
71
|
+
/** A scalar aggregation calculates a single numerical value from a dataset, such as the total sum, average, min, or max, summarizing the dataset into one key metric. For example, use a scalar aggregation to get the minimum price listed in the store. */
|
|
53
72
|
scalar?: ScalarAggregation;
|
|
54
|
-
/**
|
|
73
|
+
/**
|
|
74
|
+
* A nested aggregation is applied within the results of another aggregation. Rather than aggregating directly on the primary dataset, first group data using one aggregation and then apply another aggregation within each group. It allows for more complex analyses where you can summarize data at different levels of detail or hierarchy.
|
|
75
|
+
* For example, to get the number of products that are in stock and out of stock for each price listed, first perform a value aggregation on `discountedPriceNumeric`, and a second value aggregation on `inStock`.
|
|
76
|
+
*/
|
|
55
77
|
nested?: NestedAggregation;
|
|
56
78
|
}
|
|
57
79
|
declare enum ScalarType {
|
|
@@ -71,30 +93,35 @@ declare enum NestedAggregationType {
|
|
|
71
93
|
SCALAR = "SCALAR"
|
|
72
94
|
}
|
|
73
95
|
interface ValueAggregation {
|
|
74
|
-
/**
|
|
96
|
+
/**
|
|
97
|
+
* Number of aggregation results to return.
|
|
98
|
+
* Min: `1`
|
|
99
|
+
* Max: `250`
|
|
100
|
+
* Default: `10`
|
|
101
|
+
*/
|
|
75
102
|
limit?: number | null;
|
|
76
103
|
}
|
|
77
104
|
interface ScalarAggregation {
|
|
78
|
-
/**
|
|
105
|
+
/** Operation type for the scalar aggregation. */
|
|
79
106
|
type?: ScalarType;
|
|
80
107
|
}
|
|
81
108
|
interface NestedAggregationItem extends NestedAggregationItemKindOneOf {
|
|
82
|
-
/**
|
|
109
|
+
/** A value aggregation calculates metrics such as count for specific fields within a dataset, providing insights into the overall distribution and key statistics of those values. For example, use a value aggregation to get the number of products (count) for each price listed in the store. */
|
|
83
110
|
value?: ValueAggregation;
|
|
84
|
-
/**
|
|
111
|
+
/** A scalar aggregation calculates a single numerical value from a dataset, such as the total sum, average, min, or max, summarizing the dataset into one key metric. For example, use a scalar aggregation to get the minimum price listed in the store. */
|
|
85
112
|
scalar?: ScalarAggregation;
|
|
86
|
-
/**
|
|
113
|
+
/** Aggregation name displayed in the return. */
|
|
87
114
|
name?: string | null;
|
|
88
|
-
/** Type of aggregation
|
|
115
|
+
/** Type of aggregation to perform. */
|
|
89
116
|
type?: NestedAggregationType;
|
|
90
|
-
/** Field to aggregate by
|
|
117
|
+
/** Field to aggregate by. */
|
|
91
118
|
fieldPath?: string;
|
|
92
119
|
}
|
|
93
120
|
/** @oneof */
|
|
94
121
|
interface NestedAggregationItemKindOneOf {
|
|
95
|
-
/**
|
|
122
|
+
/** A value aggregation calculates metrics such as count for specific fields within a dataset, providing insights into the overall distribution and key statistics of those values. For example, use a value aggregation to get the number of products (count) for each price listed in the store. */
|
|
96
123
|
value?: ValueAggregation;
|
|
97
|
-
/**
|
|
124
|
+
/** A scalar aggregation calculates a single numerical value from a dataset, such as the total sum, average, min, or max, summarizing the dataset into one key metric. For example, use a scalar aggregation to get the minimum price listed in the store. */
|
|
98
125
|
scalar?: ScalarAggregation;
|
|
99
126
|
}
|
|
100
127
|
declare enum AggregationType {
|
|
@@ -108,15 +135,21 @@ declare enum AggregationType {
|
|
|
108
135
|
}
|
|
109
136
|
/** Nested aggregation expressed through a list of aggregation where each next aggregation is nested within previous one */
|
|
110
137
|
interface NestedAggregation {
|
|
111
|
-
/** Flattened list of aggregations, where each
|
|
138
|
+
/** Flattened list of aggregations, where each aggregation is nested within previous one. */
|
|
112
139
|
nestedAggregations?: NestedAggregationItem[];
|
|
113
140
|
}
|
|
114
141
|
interface SearchDetails {
|
|
115
|
-
/** Search term or expression */
|
|
142
|
+
/** Search term or expression. */
|
|
116
143
|
expression?: string | null;
|
|
117
|
-
/**
|
|
144
|
+
/**
|
|
145
|
+
* Fields to search in.
|
|
146
|
+
* If the array is empty, all fields are searched.
|
|
147
|
+
*/
|
|
118
148
|
fields?: string[];
|
|
119
|
-
/**
|
|
149
|
+
/**
|
|
150
|
+
* Whether to allow the search function to automatically correct typos or minor mistakes in the search expression.
|
|
151
|
+
* The search function uses an algorithm to find results that are close to what the site visitor typed.
|
|
152
|
+
*/
|
|
120
153
|
fuzzy?: boolean;
|
|
121
154
|
}
|
|
122
155
|
interface Paging {
|
|
@@ -138,9 +171,9 @@ declare enum DocumentType {
|
|
|
138
171
|
interface SearchResponse$1 extends SearchResponsePagingOneOf {
|
|
139
172
|
/** Paging metadata for the next page of results. */
|
|
140
173
|
pagingOffsetMetadata?: PagingMetadata;
|
|
141
|
-
/** Documents matching
|
|
142
|
-
|
|
143
|
-
/**
|
|
174
|
+
/** Documents matching the search query. */
|
|
175
|
+
siteDocumentItems?: SiteDocument[];
|
|
176
|
+
/** Aggregated data. */
|
|
144
177
|
aggregationData?: AggregationData;
|
|
145
178
|
}
|
|
146
179
|
/** @oneof */
|
|
@@ -149,7 +182,7 @@ interface SearchResponsePagingOneOf {
|
|
|
149
182
|
pagingOffsetMetadata?: PagingMetadata;
|
|
150
183
|
}
|
|
151
184
|
interface AggregationData {
|
|
152
|
-
/**
|
|
185
|
+
/** List of the aggregated data results. */
|
|
153
186
|
results?: AggregationResults[];
|
|
154
187
|
}
|
|
155
188
|
interface ValueAggregationResult {
|
|
@@ -174,24 +207,24 @@ interface ValueResult {
|
|
|
174
207
|
count?: number | null;
|
|
175
208
|
}
|
|
176
209
|
interface ScalarResult {
|
|
177
|
-
/**
|
|
210
|
+
/** Scalar aggregation results. */
|
|
178
211
|
value?: number;
|
|
179
212
|
}
|
|
180
213
|
interface NestedResultValue extends NestedResultValueResultOneOf {
|
|
181
|
-
/** Value aggregation
|
|
214
|
+
/** Value aggregation results. */
|
|
182
215
|
value?: ValueResult;
|
|
183
|
-
/** Scalar aggregation
|
|
216
|
+
/** Scalar aggregation results. */
|
|
184
217
|
scalar?: ScalarResult;
|
|
185
218
|
}
|
|
186
219
|
/** @oneof */
|
|
187
220
|
interface NestedResultValueResultOneOf {
|
|
188
|
-
/** Value aggregation
|
|
221
|
+
/** Value aggregation results. */
|
|
189
222
|
value?: ValueResult;
|
|
190
|
-
/** Scalar aggregation
|
|
223
|
+
/** Scalar aggregation results. */
|
|
191
224
|
scalar?: ScalarResult;
|
|
192
225
|
}
|
|
193
226
|
interface Results {
|
|
194
|
-
/** List of nested
|
|
227
|
+
/** List of nested aggregation results. */
|
|
195
228
|
results?: Record<string, NestedResultValue>;
|
|
196
229
|
}
|
|
197
230
|
/**
|
|
@@ -199,30 +232,30 @@ interface Results {
|
|
|
199
232
|
* aggregations in resulting array are keyed by requested aggregation `name`.
|
|
200
233
|
*/
|
|
201
234
|
interface NestedResults {
|
|
202
|
-
/** List of nested
|
|
235
|
+
/** List of nested aggregation results. */
|
|
203
236
|
results?: Results[];
|
|
204
237
|
}
|
|
205
238
|
interface AggregationResults extends AggregationResultsResultOneOf {
|
|
206
|
-
/** Value aggregation results */
|
|
239
|
+
/** Value aggregation results. */
|
|
207
240
|
values?: ValueResults;
|
|
208
|
-
/** Scalar aggregation results */
|
|
241
|
+
/** Scalar aggregation results. */
|
|
209
242
|
scalar?: AggregationResultsScalarResult;
|
|
210
|
-
/** Nested aggregation results */
|
|
243
|
+
/** Nested aggregation results. */
|
|
211
244
|
nested?: NestedResults;
|
|
212
|
-
/**
|
|
245
|
+
/** Aggregation name defined in the request. */
|
|
213
246
|
name?: string;
|
|
214
|
-
/** Type of aggregation that
|
|
247
|
+
/** Type of aggregation that was performed. */
|
|
215
248
|
type?: AggregationType;
|
|
216
|
-
/** Field
|
|
249
|
+
/** Field the data was aggregated by. */
|
|
217
250
|
fieldPath?: string;
|
|
218
251
|
}
|
|
219
252
|
/** @oneof */
|
|
220
253
|
interface AggregationResultsResultOneOf {
|
|
221
|
-
/** Value aggregation results */
|
|
254
|
+
/** Value aggregation results. */
|
|
222
255
|
values?: ValueResults;
|
|
223
|
-
/** Scalar aggregation results */
|
|
256
|
+
/** Scalar aggregation results. */
|
|
224
257
|
scalar?: AggregationResultsScalarResult;
|
|
225
|
-
/** Nested aggregation results */
|
|
258
|
+
/** Nested aggregation results. */
|
|
226
259
|
nested?: NestedResults;
|
|
227
260
|
}
|
|
228
261
|
interface PagingMetadata {
|
|
@@ -236,7 +269,7 @@ interface PagingMetadata {
|
|
|
236
269
|
tooManyToCount?: boolean | null;
|
|
237
270
|
}
|
|
238
271
|
interface SearchResponseNonNullableFields$1 {
|
|
239
|
-
|
|
272
|
+
siteDocumentItems: {
|
|
240
273
|
_id: string;
|
|
241
274
|
}[];
|
|
242
275
|
aggregationData?: {
|
|
@@ -270,15 +303,14 @@ interface SearchResponseNonNullableFields$1 {
|
|
|
270
303
|
};
|
|
271
304
|
}
|
|
272
305
|
interface SearchOptions$1 {
|
|
273
|
-
/**
|
|
274
|
-
|
|
275
|
-
/** Language to search in. */
|
|
276
|
-
language?: string | null;
|
|
306
|
+
/** Search query and aggregation information. */
|
|
307
|
+
search: Search;
|
|
277
308
|
}
|
|
278
309
|
|
|
279
310
|
type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
|
|
280
311
|
interface HttpClient {
|
|
281
312
|
request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
|
|
313
|
+
fetchWithAuth: (url: string | URL, init?: RequestInit) => Promise<Response>;
|
|
282
314
|
}
|
|
283
315
|
type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
|
|
284
316
|
type HttpResponse<T = any> = {
|
|
@@ -301,7 +333,14 @@ type APIMetadata = {
|
|
|
301
333
|
};
|
|
302
334
|
type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
|
|
303
335
|
|
|
304
|
-
declare
|
|
336
|
+
declare global {
|
|
337
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
338
|
+
interface SymbolConstructor {
|
|
339
|
+
readonly observable: symbol;
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
declare function search$3(httpClient: HttpClient): (documentType: DocumentType, language: string | null, options: SearchOptions$1) => Promise<SearchResponse$1 & SearchResponseNonNullableFields$1>;
|
|
305
344
|
|
|
306
345
|
declare const search$2: BuildRESTFunction<typeof search$3>;
|
|
307
346
|
|
|
@@ -1,32 +1,48 @@
|
|
|
1
1
|
interface SiteDocument$1 {
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* Results ID.
|
|
4
|
+
* @readonly
|
|
5
|
+
*/
|
|
3
6
|
_id?: string;
|
|
4
|
-
/**
|
|
5
|
-
|
|
7
|
+
/** The docuement payload. */
|
|
8
|
+
data?: Record<string, any> | null;
|
|
6
9
|
}
|
|
7
10
|
interface SearchRequest$1 {
|
|
8
|
-
/** Search query */
|
|
11
|
+
/** Search query and aggregation information. */
|
|
9
12
|
search: Search;
|
|
10
|
-
/** Document type of documents to search
|
|
13
|
+
/** Document type of the documents to search in. */
|
|
11
14
|
documentType: DocumentType;
|
|
12
15
|
/** Language to search in. */
|
|
13
16
|
language?: string | null;
|
|
14
17
|
}
|
|
15
18
|
interface Search extends SearchPagingMethodOneOf {
|
|
16
|
-
/**
|
|
19
|
+
/** Paging options to limit and skip the number of items. */
|
|
17
20
|
paging?: Paging;
|
|
18
|
-
/**
|
|
21
|
+
/**
|
|
22
|
+
* Filter object in the following format:
|
|
23
|
+
* `"filter" : {
|
|
24
|
+
* "fieldName1": "value1",
|
|
25
|
+
* "fieldName2":{"$operator":"value2"}
|
|
26
|
+
* }`
|
|
27
|
+
* Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`
|
|
28
|
+
*/
|
|
19
29
|
filter?: Record<string, any> | null;
|
|
20
|
-
/**
|
|
30
|
+
/**
|
|
31
|
+
* Sort object in the following format:
|
|
32
|
+
* `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`
|
|
33
|
+
*/
|
|
21
34
|
sort?: Sorting[];
|
|
22
|
-
/**
|
|
35
|
+
/**
|
|
36
|
+
* A search method for grouping data into various categories (facets) and providing summaries for each category.
|
|
37
|
+
* For example, use aggregations to allow site visitors to narrow down their search results by selecting specific categories such as price ranges, brand names, and ratings.
|
|
38
|
+
*/
|
|
23
39
|
aggregations?: Aggregation$1[];
|
|
24
|
-
/** Free text to match in searchable fields */
|
|
40
|
+
/** Free text to match in searchable fields. */
|
|
25
41
|
search?: SearchDetails;
|
|
26
42
|
}
|
|
27
43
|
/** @oneof */
|
|
28
44
|
interface SearchPagingMethodOneOf {
|
|
29
|
-
/**
|
|
45
|
+
/** Paging options to limit and skip the number of items. */
|
|
30
46
|
paging?: Paging;
|
|
31
47
|
}
|
|
32
48
|
interface Sorting {
|
|
@@ -40,26 +56,32 @@ declare enum SortOrder {
|
|
|
40
56
|
DESC = "DESC"
|
|
41
57
|
}
|
|
42
58
|
interface Aggregation$1 extends AggregationKindOneOf {
|
|
43
|
-
/**
|
|
59
|
+
/** A value aggregation calculates metrics such as count for specific fields within a dataset, providing insights into the overall distribution and key statistics of those values. For example, use a value aggregation to get the number of products (count) for each price listed in the store. */
|
|
44
60
|
value?: ValueAggregation;
|
|
45
|
-
/**
|
|
61
|
+
/** A scalar aggregation calculates a single numerical value from a dataset, such as the total sum, average, min, or max, summarizing the dataset into one key metric. For example, use a scalar aggregation to get the minimum price listed in the store. */
|
|
46
62
|
scalar?: ScalarAggregation;
|
|
47
|
-
/**
|
|
63
|
+
/**
|
|
64
|
+
* A nested aggregation is applied within the results of another aggregation. Rather than aggregating directly on the primary dataset, first group data using one aggregation and then apply another aggregation within each group. It allows for more complex analyses where you can summarize data at different levels of detail or hierarchy.
|
|
65
|
+
* For example, to get the number of products that are in stock and out of stock for each price listed, first perform a value aggregation on `discountedPriceNumeric`, and a second value aggregation on `inStock`.
|
|
66
|
+
*/
|
|
48
67
|
nested?: NestedAggregation;
|
|
49
|
-
/**
|
|
68
|
+
/** Aggregation name displayed in the return. */
|
|
50
69
|
name?: string | null;
|
|
51
|
-
/** Type of aggregation
|
|
70
|
+
/** Type of aggregation to perform. */
|
|
52
71
|
type?: AggregationType;
|
|
53
|
-
/** Field to aggregate by
|
|
72
|
+
/** Field to aggregate by. */
|
|
54
73
|
fieldPath?: string;
|
|
55
74
|
}
|
|
56
75
|
/** @oneof */
|
|
57
76
|
interface AggregationKindOneOf {
|
|
58
|
-
/**
|
|
77
|
+
/** A value aggregation calculates metrics such as count for specific fields within a dataset, providing insights into the overall distribution and key statistics of those values. For example, use a value aggregation to get the number of products (count) for each price listed in the store. */
|
|
59
78
|
value?: ValueAggregation;
|
|
60
|
-
/**
|
|
79
|
+
/** A scalar aggregation calculates a single numerical value from a dataset, such as the total sum, average, min, or max, summarizing the dataset into one key metric. For example, use a scalar aggregation to get the minimum price listed in the store. */
|
|
61
80
|
scalar?: ScalarAggregation;
|
|
62
|
-
/**
|
|
81
|
+
/**
|
|
82
|
+
* A nested aggregation is applied within the results of another aggregation. Rather than aggregating directly on the primary dataset, first group data using one aggregation and then apply another aggregation within each group. It allows for more complex analyses where you can summarize data at different levels of detail or hierarchy.
|
|
83
|
+
* For example, to get the number of products that are in stock and out of stock for each price listed, first perform a value aggregation on `discountedPriceNumeric`, and a second value aggregation on `inStock`.
|
|
84
|
+
*/
|
|
63
85
|
nested?: NestedAggregation;
|
|
64
86
|
}
|
|
65
87
|
declare enum ScalarType {
|
|
@@ -79,30 +101,35 @@ declare enum NestedAggregationType {
|
|
|
79
101
|
SCALAR = "SCALAR"
|
|
80
102
|
}
|
|
81
103
|
interface ValueAggregation {
|
|
82
|
-
/**
|
|
104
|
+
/**
|
|
105
|
+
* Number of aggregation results to return.
|
|
106
|
+
* Min: `1`
|
|
107
|
+
* Max: `250`
|
|
108
|
+
* Default: `10`
|
|
109
|
+
*/
|
|
83
110
|
limit?: number | null;
|
|
84
111
|
}
|
|
85
112
|
interface ScalarAggregation {
|
|
86
|
-
/**
|
|
113
|
+
/** Operation type for the scalar aggregation. */
|
|
87
114
|
type?: ScalarType;
|
|
88
115
|
}
|
|
89
116
|
interface NestedAggregationItem extends NestedAggregationItemKindOneOf {
|
|
90
|
-
/**
|
|
117
|
+
/** A value aggregation calculates metrics such as count for specific fields within a dataset, providing insights into the overall distribution and key statistics of those values. For example, use a value aggregation to get the number of products (count) for each price listed in the store. */
|
|
91
118
|
value?: ValueAggregation;
|
|
92
|
-
/**
|
|
119
|
+
/** A scalar aggregation calculates a single numerical value from a dataset, such as the total sum, average, min, or max, summarizing the dataset into one key metric. For example, use a scalar aggregation to get the minimum price listed in the store. */
|
|
93
120
|
scalar?: ScalarAggregation;
|
|
94
|
-
/**
|
|
121
|
+
/** Aggregation name displayed in the return. */
|
|
95
122
|
name?: string | null;
|
|
96
|
-
/** Type of aggregation
|
|
123
|
+
/** Type of aggregation to perform. */
|
|
97
124
|
type?: NestedAggregationType;
|
|
98
|
-
/** Field to aggregate by
|
|
125
|
+
/** Field to aggregate by. */
|
|
99
126
|
fieldPath?: string;
|
|
100
127
|
}
|
|
101
128
|
/** @oneof */
|
|
102
129
|
interface NestedAggregationItemKindOneOf {
|
|
103
|
-
/**
|
|
130
|
+
/** A value aggregation calculates metrics such as count for specific fields within a dataset, providing insights into the overall distribution and key statistics of those values. For example, use a value aggregation to get the number of products (count) for each price listed in the store. */
|
|
104
131
|
value?: ValueAggregation;
|
|
105
|
-
/**
|
|
132
|
+
/** A scalar aggregation calculates a single numerical value from a dataset, such as the total sum, average, min, or max, summarizing the dataset into one key metric. For example, use a scalar aggregation to get the minimum price listed in the store. */
|
|
106
133
|
scalar?: ScalarAggregation;
|
|
107
134
|
}
|
|
108
135
|
declare enum AggregationType {
|
|
@@ -116,15 +143,21 @@ declare enum AggregationType {
|
|
|
116
143
|
}
|
|
117
144
|
/** Nested aggregation expressed through a list of aggregation where each next aggregation is nested within previous one */
|
|
118
145
|
interface NestedAggregation {
|
|
119
|
-
/** Flattened list of aggregations, where each
|
|
146
|
+
/** Flattened list of aggregations, where each aggregation is nested within previous one. */
|
|
120
147
|
nestedAggregations?: NestedAggregationItem[];
|
|
121
148
|
}
|
|
122
149
|
interface SearchDetails {
|
|
123
|
-
/** Search term or expression */
|
|
150
|
+
/** Search term or expression. */
|
|
124
151
|
expression?: string | null;
|
|
125
|
-
/**
|
|
152
|
+
/**
|
|
153
|
+
* Fields to search in.
|
|
154
|
+
* If the array is empty, all fields are searched.
|
|
155
|
+
*/
|
|
126
156
|
fields?: string[];
|
|
127
|
-
/**
|
|
157
|
+
/**
|
|
158
|
+
* Whether to allow the search function to automatically correct typos or minor mistakes in the search expression.
|
|
159
|
+
* The search function uses an algorithm to find results that are close to what the site visitor typed.
|
|
160
|
+
*/
|
|
128
161
|
fuzzy?: boolean;
|
|
129
162
|
}
|
|
130
163
|
interface Paging {
|
|
@@ -146,9 +179,9 @@ declare enum DocumentType {
|
|
|
146
179
|
interface SearchResponse$1 extends SearchResponsePagingOneOf {
|
|
147
180
|
/** Paging metadata for the next page of results. */
|
|
148
181
|
pagingOffsetMetadata?: PagingMetadata;
|
|
149
|
-
/** Documents matching
|
|
150
|
-
|
|
151
|
-
/**
|
|
182
|
+
/** Documents matching the search query. */
|
|
183
|
+
siteDocumentItems?: SiteDocument$1[];
|
|
184
|
+
/** Aggregated data. */
|
|
152
185
|
aggregationData?: AggregationData;
|
|
153
186
|
}
|
|
154
187
|
/** @oneof */
|
|
@@ -157,7 +190,7 @@ interface SearchResponsePagingOneOf {
|
|
|
157
190
|
pagingOffsetMetadata?: PagingMetadata;
|
|
158
191
|
}
|
|
159
192
|
interface AggregationData {
|
|
160
|
-
/**
|
|
193
|
+
/** List of the aggregated data results. */
|
|
161
194
|
results?: AggregationResults[];
|
|
162
195
|
}
|
|
163
196
|
interface ValueAggregationResult {
|
|
@@ -182,24 +215,24 @@ interface ValueResult {
|
|
|
182
215
|
count?: number | null;
|
|
183
216
|
}
|
|
184
217
|
interface ScalarResult {
|
|
185
|
-
/**
|
|
218
|
+
/** Scalar aggregation results. */
|
|
186
219
|
value?: number;
|
|
187
220
|
}
|
|
188
221
|
interface NestedResultValue extends NestedResultValueResultOneOf {
|
|
189
|
-
/** Value aggregation
|
|
222
|
+
/** Value aggregation results. */
|
|
190
223
|
value?: ValueResult;
|
|
191
|
-
/** Scalar aggregation
|
|
224
|
+
/** Scalar aggregation results. */
|
|
192
225
|
scalar?: ScalarResult;
|
|
193
226
|
}
|
|
194
227
|
/** @oneof */
|
|
195
228
|
interface NestedResultValueResultOneOf {
|
|
196
|
-
/** Value aggregation
|
|
229
|
+
/** Value aggregation results. */
|
|
197
230
|
value?: ValueResult;
|
|
198
|
-
/** Scalar aggregation
|
|
231
|
+
/** Scalar aggregation results. */
|
|
199
232
|
scalar?: ScalarResult;
|
|
200
233
|
}
|
|
201
234
|
interface Results {
|
|
202
|
-
/** List of nested
|
|
235
|
+
/** List of nested aggregation results. */
|
|
203
236
|
results?: Record<string, NestedResultValue>;
|
|
204
237
|
}
|
|
205
238
|
/**
|
|
@@ -207,30 +240,30 @@ interface Results {
|
|
|
207
240
|
* aggregations in resulting array are keyed by requested aggregation `name`.
|
|
208
241
|
*/
|
|
209
242
|
interface NestedResults {
|
|
210
|
-
/** List of nested
|
|
243
|
+
/** List of nested aggregation results. */
|
|
211
244
|
results?: Results[];
|
|
212
245
|
}
|
|
213
246
|
interface AggregationResults extends AggregationResultsResultOneOf {
|
|
214
|
-
/** Value aggregation results */
|
|
247
|
+
/** Value aggregation results. */
|
|
215
248
|
values?: ValueResults;
|
|
216
|
-
/** Scalar aggregation results */
|
|
249
|
+
/** Scalar aggregation results. */
|
|
217
250
|
scalar?: AggregationResultsScalarResult;
|
|
218
|
-
/** Nested aggregation results */
|
|
251
|
+
/** Nested aggregation results. */
|
|
219
252
|
nested?: NestedResults;
|
|
220
|
-
/**
|
|
253
|
+
/** Aggregation name defined in the request. */
|
|
221
254
|
name?: string;
|
|
222
|
-
/** Type of aggregation that
|
|
255
|
+
/** Type of aggregation that was performed. */
|
|
223
256
|
type?: AggregationType;
|
|
224
|
-
/** Field
|
|
257
|
+
/** Field the data was aggregated by. */
|
|
225
258
|
fieldPath?: string;
|
|
226
259
|
}
|
|
227
260
|
/** @oneof */
|
|
228
261
|
interface AggregationResultsResultOneOf {
|
|
229
|
-
/** Value aggregation results */
|
|
262
|
+
/** Value aggregation results. */
|
|
230
263
|
values?: ValueResults;
|
|
231
|
-
/** Scalar aggregation results */
|
|
264
|
+
/** Scalar aggregation results. */
|
|
232
265
|
scalar?: AggregationResultsScalarResult;
|
|
233
|
-
/** Nested aggregation results */
|
|
266
|
+
/** Nested aggregation results. */
|
|
234
267
|
nested?: NestedResults;
|
|
235
268
|
}
|
|
236
269
|
interface PagingMetadata {
|
|
@@ -244,7 +277,7 @@ interface PagingMetadata {
|
|
|
244
277
|
tooManyToCount?: boolean | null;
|
|
245
278
|
}
|
|
246
279
|
interface SearchResponseNonNullableFields$1 {
|
|
247
|
-
|
|
280
|
+
siteDocumentItems: {
|
|
248
281
|
_id: string;
|
|
249
282
|
}[];
|
|
250
283
|
aggregationData?: {
|
|
@@ -278,14 +311,13 @@ interface SearchResponseNonNullableFields$1 {
|
|
|
278
311
|
};
|
|
279
312
|
}
|
|
280
313
|
interface SearchOptions$1 {
|
|
281
|
-
/**
|
|
282
|
-
|
|
283
|
-
/** Language to search in. */
|
|
284
|
-
language?: string | null;
|
|
314
|
+
/** Search query and aggregation information. */
|
|
315
|
+
search: Search;
|
|
285
316
|
}
|
|
286
317
|
|
|
287
318
|
interface HttpClient {
|
|
288
319
|
request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
|
|
320
|
+
fetchWithAuth: (url: string | URL, init?: RequestInit) => Promise<Response>;
|
|
289
321
|
}
|
|
290
322
|
type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
|
|
291
323
|
type HttpResponse<T = any> = {
|
|
@@ -307,10 +339,17 @@ type APIMetadata = {
|
|
|
307
339
|
packageName?: string;
|
|
308
340
|
};
|
|
309
341
|
|
|
342
|
+
declare global {
|
|
343
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
344
|
+
interface SymbolConstructor {
|
|
345
|
+
readonly observable: symbol;
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
|
|
310
349
|
declare const __metadata$1: {
|
|
311
350
|
PACKAGE_NAME: string;
|
|
312
351
|
};
|
|
313
|
-
declare function search$1(httpClient: HttpClient): (
|
|
352
|
+
declare function search$1(httpClient: HttpClient): (documentType: DocumentType, language: string | null, options: SearchOptions$1) => Promise<SearchResponse$1 & SearchResponseNonNullableFields$1>;
|
|
314
353
|
|
|
315
354
|
type index_d$1_AggregationData = AggregationData;
|
|
316
355
|
type index_d$1_AggregationKindOneOf = AggregationKindOneOf;
|
|
@@ -1,32 +1,48 @@
|
|
|
1
1
|
interface SiteDocument$1 {
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* Results ID.
|
|
4
|
+
* @readonly
|
|
5
|
+
*/
|
|
3
6
|
id?: string;
|
|
4
|
-
/**
|
|
5
|
-
|
|
7
|
+
/** The docuement payload. */
|
|
8
|
+
data?: Record<string, any> | null;
|
|
6
9
|
}
|
|
7
10
|
interface SearchRequest$3 {
|
|
8
|
-
/** Search query */
|
|
11
|
+
/** Search query and aggregation information. */
|
|
9
12
|
search: Search$1;
|
|
10
|
-
/** Document type of documents to search
|
|
13
|
+
/** Document type of the documents to search in. */
|
|
11
14
|
documentType: DocumentType$1;
|
|
12
15
|
/** Language to search in. */
|
|
13
16
|
language?: string | null;
|
|
14
17
|
}
|
|
15
18
|
interface Search$1 extends SearchPagingMethodOneOf$1 {
|
|
16
|
-
/**
|
|
19
|
+
/** Paging options to limit and skip the number of items. */
|
|
17
20
|
paging?: Paging$1;
|
|
18
|
-
/**
|
|
21
|
+
/**
|
|
22
|
+
* Filter object in the following format:
|
|
23
|
+
* `"filter" : {
|
|
24
|
+
* "fieldName1": "value1",
|
|
25
|
+
* "fieldName2":{"$operator":"value2"}
|
|
26
|
+
* }`
|
|
27
|
+
* Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`
|
|
28
|
+
*/
|
|
19
29
|
filter?: Record<string, any> | null;
|
|
20
|
-
/**
|
|
30
|
+
/**
|
|
31
|
+
* Sort object in the following format:
|
|
32
|
+
* `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`
|
|
33
|
+
*/
|
|
21
34
|
sort?: Sorting$1[];
|
|
22
|
-
/**
|
|
35
|
+
/**
|
|
36
|
+
* A search method for grouping data into various categories (facets) and providing summaries for each category.
|
|
37
|
+
* For example, use aggregations to allow site visitors to narrow down their search results by selecting specific categories such as price ranges, brand names, and ratings.
|
|
38
|
+
*/
|
|
23
39
|
aggregations?: Aggregation$3[];
|
|
24
|
-
/** Free text to match in searchable fields */
|
|
40
|
+
/** Free text to match in searchable fields. */
|
|
25
41
|
search?: SearchDetails$1;
|
|
26
42
|
}
|
|
27
43
|
/** @oneof */
|
|
28
44
|
interface SearchPagingMethodOneOf$1 {
|
|
29
|
-
/**
|
|
45
|
+
/** Paging options to limit and skip the number of items. */
|
|
30
46
|
paging?: Paging$1;
|
|
31
47
|
}
|
|
32
48
|
interface Sorting$1 {
|
|
@@ -40,26 +56,32 @@ declare enum SortOrder$1 {
|
|
|
40
56
|
DESC = "DESC"
|
|
41
57
|
}
|
|
42
58
|
interface Aggregation$3 extends AggregationKindOneOf$1 {
|
|
43
|
-
/**
|
|
59
|
+
/** A value aggregation calculates metrics such as count for specific fields within a dataset, providing insights into the overall distribution and key statistics of those values. For example, use a value aggregation to get the number of products (count) for each price listed in the store. */
|
|
44
60
|
value?: ValueAggregation$1;
|
|
45
|
-
/**
|
|
61
|
+
/** A scalar aggregation calculates a single numerical value from a dataset, such as the total sum, average, min, or max, summarizing the dataset into one key metric. For example, use a scalar aggregation to get the minimum price listed in the store. */
|
|
46
62
|
scalar?: ScalarAggregation$1;
|
|
47
|
-
/**
|
|
63
|
+
/**
|
|
64
|
+
* A nested aggregation is applied within the results of another aggregation. Rather than aggregating directly on the primary dataset, first group data using one aggregation and then apply another aggregation within each group. It allows for more complex analyses where you can summarize data at different levels of detail or hierarchy.
|
|
65
|
+
* For example, to get the number of products that are in stock and out of stock for each price listed, first perform a value aggregation on `discountedPriceNumeric`, and a second value aggregation on `inStock`.
|
|
66
|
+
*/
|
|
48
67
|
nested?: NestedAggregation$1;
|
|
49
|
-
/**
|
|
68
|
+
/** Aggregation name displayed in the return. */
|
|
50
69
|
name?: string | null;
|
|
51
|
-
/** Type of aggregation
|
|
70
|
+
/** Type of aggregation to perform. */
|
|
52
71
|
type?: AggregationType$1;
|
|
53
|
-
/** Field to aggregate by
|
|
72
|
+
/** Field to aggregate by. */
|
|
54
73
|
fieldPath?: string;
|
|
55
74
|
}
|
|
56
75
|
/** @oneof */
|
|
57
76
|
interface AggregationKindOneOf$1 {
|
|
58
|
-
/**
|
|
77
|
+
/** A value aggregation calculates metrics such as count for specific fields within a dataset, providing insights into the overall distribution and key statistics of those values. For example, use a value aggregation to get the number of products (count) for each price listed in the store. */
|
|
59
78
|
value?: ValueAggregation$1;
|
|
60
|
-
/**
|
|
79
|
+
/** A scalar aggregation calculates a single numerical value from a dataset, such as the total sum, average, min, or max, summarizing the dataset into one key metric. For example, use a scalar aggregation to get the minimum price listed in the store. */
|
|
61
80
|
scalar?: ScalarAggregation$1;
|
|
62
|
-
/**
|
|
81
|
+
/**
|
|
82
|
+
* A nested aggregation is applied within the results of another aggregation. Rather than aggregating directly on the primary dataset, first group data using one aggregation and then apply another aggregation within each group. It allows for more complex analyses where you can summarize data at different levels of detail or hierarchy.
|
|
83
|
+
* For example, to get the number of products that are in stock and out of stock for each price listed, first perform a value aggregation on `discountedPriceNumeric`, and a second value aggregation on `inStock`.
|
|
84
|
+
*/
|
|
63
85
|
nested?: NestedAggregation$1;
|
|
64
86
|
}
|
|
65
87
|
declare enum ScalarType$1 {
|
|
@@ -79,30 +101,35 @@ declare enum NestedAggregationType$1 {
|
|
|
79
101
|
SCALAR = "SCALAR"
|
|
80
102
|
}
|
|
81
103
|
interface ValueAggregation$1 {
|
|
82
|
-
/**
|
|
104
|
+
/**
|
|
105
|
+
* Number of aggregation results to return.
|
|
106
|
+
* Min: `1`
|
|
107
|
+
* Max: `250`
|
|
108
|
+
* Default: `10`
|
|
109
|
+
*/
|
|
83
110
|
limit?: number | null;
|
|
84
111
|
}
|
|
85
112
|
interface ScalarAggregation$1 {
|
|
86
|
-
/**
|
|
113
|
+
/** Operation type for the scalar aggregation. */
|
|
87
114
|
type?: ScalarType$1;
|
|
88
115
|
}
|
|
89
116
|
interface NestedAggregationItem$1 extends NestedAggregationItemKindOneOf$1 {
|
|
90
|
-
/**
|
|
117
|
+
/** A value aggregation calculates metrics such as count for specific fields within a dataset, providing insights into the overall distribution and key statistics of those values. For example, use a value aggregation to get the number of products (count) for each price listed in the store. */
|
|
91
118
|
value?: ValueAggregation$1;
|
|
92
|
-
/**
|
|
119
|
+
/** A scalar aggregation calculates a single numerical value from a dataset, such as the total sum, average, min, or max, summarizing the dataset into one key metric. For example, use a scalar aggregation to get the minimum price listed in the store. */
|
|
93
120
|
scalar?: ScalarAggregation$1;
|
|
94
|
-
/**
|
|
121
|
+
/** Aggregation name displayed in the return. */
|
|
95
122
|
name?: string | null;
|
|
96
|
-
/** Type of aggregation
|
|
123
|
+
/** Type of aggregation to perform. */
|
|
97
124
|
type?: NestedAggregationType$1;
|
|
98
|
-
/** Field to aggregate by
|
|
125
|
+
/** Field to aggregate by. */
|
|
99
126
|
fieldPath?: string;
|
|
100
127
|
}
|
|
101
128
|
/** @oneof */
|
|
102
129
|
interface NestedAggregationItemKindOneOf$1 {
|
|
103
|
-
/**
|
|
130
|
+
/** A value aggregation calculates metrics such as count for specific fields within a dataset, providing insights into the overall distribution and key statistics of those values. For example, use a value aggregation to get the number of products (count) for each price listed in the store. */
|
|
104
131
|
value?: ValueAggregation$1;
|
|
105
|
-
/**
|
|
132
|
+
/** A scalar aggregation calculates a single numerical value from a dataset, such as the total sum, average, min, or max, summarizing the dataset into one key metric. For example, use a scalar aggregation to get the minimum price listed in the store. */
|
|
106
133
|
scalar?: ScalarAggregation$1;
|
|
107
134
|
}
|
|
108
135
|
declare enum AggregationType$1 {
|
|
@@ -116,15 +143,21 @@ declare enum AggregationType$1 {
|
|
|
116
143
|
}
|
|
117
144
|
/** Nested aggregation expressed through a list of aggregation where each next aggregation is nested within previous one */
|
|
118
145
|
interface NestedAggregation$1 {
|
|
119
|
-
/** Flattened list of aggregations, where each
|
|
146
|
+
/** Flattened list of aggregations, where each aggregation is nested within previous one. */
|
|
120
147
|
nestedAggregations?: NestedAggregationItem$1[];
|
|
121
148
|
}
|
|
122
149
|
interface SearchDetails$1 {
|
|
123
|
-
/** Search term or expression */
|
|
150
|
+
/** Search term or expression. */
|
|
124
151
|
expression?: string | null;
|
|
125
|
-
/**
|
|
152
|
+
/**
|
|
153
|
+
* Fields to search in.
|
|
154
|
+
* If the array is empty, all fields are searched.
|
|
155
|
+
*/
|
|
126
156
|
fields?: string[];
|
|
127
|
-
/**
|
|
157
|
+
/**
|
|
158
|
+
* Whether to allow the search function to automatically correct typos or minor mistakes in the search expression.
|
|
159
|
+
* The search function uses an algorithm to find results that are close to what the site visitor typed.
|
|
160
|
+
*/
|
|
128
161
|
fuzzy?: boolean;
|
|
129
162
|
}
|
|
130
163
|
interface Paging$1 {
|
|
@@ -146,9 +179,9 @@ declare enum DocumentType$1 {
|
|
|
146
179
|
interface SearchResponse$3 extends SearchResponsePagingOneOf$1 {
|
|
147
180
|
/** Paging metadata for the next page of results. */
|
|
148
181
|
pagingOffsetMetadata?: PagingMetadata$1;
|
|
149
|
-
/** Documents matching
|
|
150
|
-
|
|
151
|
-
/**
|
|
182
|
+
/** Documents matching the search query. */
|
|
183
|
+
siteDocumentItems?: SiteDocument$1[];
|
|
184
|
+
/** Aggregated data. */
|
|
152
185
|
aggregationData?: AggregationData$1;
|
|
153
186
|
}
|
|
154
187
|
/** @oneof */
|
|
@@ -157,7 +190,7 @@ interface SearchResponsePagingOneOf$1 {
|
|
|
157
190
|
pagingOffsetMetadata?: PagingMetadata$1;
|
|
158
191
|
}
|
|
159
192
|
interface AggregationData$1 {
|
|
160
|
-
/**
|
|
193
|
+
/** List of the aggregated data results. */
|
|
161
194
|
results?: AggregationResults$1[];
|
|
162
195
|
}
|
|
163
196
|
interface ValueAggregationResult$1 {
|
|
@@ -182,24 +215,24 @@ interface ValueResult$1 {
|
|
|
182
215
|
count?: number | null;
|
|
183
216
|
}
|
|
184
217
|
interface ScalarResult$1 {
|
|
185
|
-
/**
|
|
218
|
+
/** Scalar aggregation results. */
|
|
186
219
|
value?: number;
|
|
187
220
|
}
|
|
188
221
|
interface NestedResultValue$1 extends NestedResultValueResultOneOf$1 {
|
|
189
|
-
/** Value aggregation
|
|
222
|
+
/** Value aggregation results. */
|
|
190
223
|
value?: ValueResult$1;
|
|
191
|
-
/** Scalar aggregation
|
|
224
|
+
/** Scalar aggregation results. */
|
|
192
225
|
scalar?: ScalarResult$1;
|
|
193
226
|
}
|
|
194
227
|
/** @oneof */
|
|
195
228
|
interface NestedResultValueResultOneOf$1 {
|
|
196
|
-
/** Value aggregation
|
|
229
|
+
/** Value aggregation results. */
|
|
197
230
|
value?: ValueResult$1;
|
|
198
|
-
/** Scalar aggregation
|
|
231
|
+
/** Scalar aggregation results. */
|
|
199
232
|
scalar?: ScalarResult$1;
|
|
200
233
|
}
|
|
201
234
|
interface Results$1 {
|
|
202
|
-
/** List of nested
|
|
235
|
+
/** List of nested aggregation results. */
|
|
203
236
|
results?: Record<string, NestedResultValue$1>;
|
|
204
237
|
}
|
|
205
238
|
/**
|
|
@@ -207,30 +240,30 @@ interface Results$1 {
|
|
|
207
240
|
* aggregations in resulting array are keyed by requested aggregation `name`.
|
|
208
241
|
*/
|
|
209
242
|
interface NestedResults$1 {
|
|
210
|
-
/** List of nested
|
|
243
|
+
/** List of nested aggregation results. */
|
|
211
244
|
results?: Results$1[];
|
|
212
245
|
}
|
|
213
246
|
interface AggregationResults$1 extends AggregationResultsResultOneOf$1 {
|
|
214
|
-
/** Value aggregation results */
|
|
247
|
+
/** Value aggregation results. */
|
|
215
248
|
values?: ValueResults$1;
|
|
216
|
-
/** Scalar aggregation results */
|
|
249
|
+
/** Scalar aggregation results. */
|
|
217
250
|
scalar?: AggregationResultsScalarResult$1;
|
|
218
|
-
/** Nested aggregation results */
|
|
251
|
+
/** Nested aggregation results. */
|
|
219
252
|
nested?: NestedResults$1;
|
|
220
|
-
/**
|
|
253
|
+
/** Aggregation name defined in the request. */
|
|
221
254
|
name?: string;
|
|
222
|
-
/** Type of aggregation that
|
|
255
|
+
/** Type of aggregation that was performed. */
|
|
223
256
|
type?: AggregationType$1;
|
|
224
|
-
/** Field
|
|
257
|
+
/** Field the data was aggregated by. */
|
|
225
258
|
fieldPath?: string;
|
|
226
259
|
}
|
|
227
260
|
/** @oneof */
|
|
228
261
|
interface AggregationResultsResultOneOf$1 {
|
|
229
|
-
/** Value aggregation results */
|
|
262
|
+
/** Value aggregation results. */
|
|
230
263
|
values?: ValueResults$1;
|
|
231
|
-
/** Scalar aggregation results */
|
|
264
|
+
/** Scalar aggregation results. */
|
|
232
265
|
scalar?: AggregationResultsScalarResult$1;
|
|
233
|
-
/** Nested aggregation results */
|
|
266
|
+
/** Nested aggregation results. */
|
|
234
267
|
nested?: NestedResults$1;
|
|
235
268
|
}
|
|
236
269
|
interface PagingMetadata$1 {
|
|
@@ -244,7 +277,7 @@ interface PagingMetadata$1 {
|
|
|
244
277
|
tooManyToCount?: boolean | null;
|
|
245
278
|
}
|
|
246
279
|
interface SearchResponseNonNullableFields$3 {
|
|
247
|
-
|
|
280
|
+
siteDocumentItems: {
|
|
248
281
|
id: string;
|
|
249
282
|
}[];
|
|
250
283
|
aggregationData?: {
|
|
@@ -279,34 +312,50 @@ interface SearchResponseNonNullableFields$3 {
|
|
|
279
312
|
}
|
|
280
313
|
|
|
281
314
|
interface SiteDocument {
|
|
282
|
-
/**
|
|
315
|
+
/**
|
|
316
|
+
* Results ID.
|
|
317
|
+
* @readonly
|
|
318
|
+
*/
|
|
283
319
|
_id?: string;
|
|
284
|
-
/**
|
|
285
|
-
|
|
320
|
+
/** The docuement payload. */
|
|
321
|
+
data?: Record<string, any> | null;
|
|
286
322
|
}
|
|
287
323
|
interface SearchRequest$2 {
|
|
288
|
-
/** Search query */
|
|
324
|
+
/** Search query and aggregation information. */
|
|
289
325
|
search: Search;
|
|
290
|
-
/** Document type of documents to search
|
|
326
|
+
/** Document type of the documents to search in. */
|
|
291
327
|
documentType: DocumentType;
|
|
292
328
|
/** Language to search in. */
|
|
293
329
|
language?: string | null;
|
|
294
330
|
}
|
|
295
331
|
interface Search extends SearchPagingMethodOneOf {
|
|
296
|
-
/**
|
|
332
|
+
/** Paging options to limit and skip the number of items. */
|
|
297
333
|
paging?: Paging;
|
|
298
|
-
/**
|
|
334
|
+
/**
|
|
335
|
+
* Filter object in the following format:
|
|
336
|
+
* `"filter" : {
|
|
337
|
+
* "fieldName1": "value1",
|
|
338
|
+
* "fieldName2":{"$operator":"value2"}
|
|
339
|
+
* }`
|
|
340
|
+
* Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`
|
|
341
|
+
*/
|
|
299
342
|
filter?: Record<string, any> | null;
|
|
300
|
-
/**
|
|
343
|
+
/**
|
|
344
|
+
* Sort object in the following format:
|
|
345
|
+
* `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`
|
|
346
|
+
*/
|
|
301
347
|
sort?: Sorting[];
|
|
302
|
-
/**
|
|
348
|
+
/**
|
|
349
|
+
* A search method for grouping data into various categories (facets) and providing summaries for each category.
|
|
350
|
+
* For example, use aggregations to allow site visitors to narrow down their search results by selecting specific categories such as price ranges, brand names, and ratings.
|
|
351
|
+
*/
|
|
303
352
|
aggregations?: Aggregation$2[];
|
|
304
|
-
/** Free text to match in searchable fields */
|
|
353
|
+
/** Free text to match in searchable fields. */
|
|
305
354
|
search?: SearchDetails;
|
|
306
355
|
}
|
|
307
356
|
/** @oneof */
|
|
308
357
|
interface SearchPagingMethodOneOf {
|
|
309
|
-
/**
|
|
358
|
+
/** Paging options to limit and skip the number of items. */
|
|
310
359
|
paging?: Paging;
|
|
311
360
|
}
|
|
312
361
|
interface Sorting {
|
|
@@ -320,26 +369,32 @@ declare enum SortOrder {
|
|
|
320
369
|
DESC = "DESC"
|
|
321
370
|
}
|
|
322
371
|
interface Aggregation$2 extends AggregationKindOneOf {
|
|
323
|
-
/**
|
|
372
|
+
/** A value aggregation calculates metrics such as count for specific fields within a dataset, providing insights into the overall distribution and key statistics of those values. For example, use a value aggregation to get the number of products (count) for each price listed in the store. */
|
|
324
373
|
value?: ValueAggregation;
|
|
325
|
-
/**
|
|
374
|
+
/** A scalar aggregation calculates a single numerical value from a dataset, such as the total sum, average, min, or max, summarizing the dataset into one key metric. For example, use a scalar aggregation to get the minimum price listed in the store. */
|
|
326
375
|
scalar?: ScalarAggregation;
|
|
327
|
-
/**
|
|
376
|
+
/**
|
|
377
|
+
* A nested aggregation is applied within the results of another aggregation. Rather than aggregating directly on the primary dataset, first group data using one aggregation and then apply another aggregation within each group. It allows for more complex analyses where you can summarize data at different levels of detail or hierarchy.
|
|
378
|
+
* For example, to get the number of products that are in stock and out of stock for each price listed, first perform a value aggregation on `discountedPriceNumeric`, and a second value aggregation on `inStock`.
|
|
379
|
+
*/
|
|
328
380
|
nested?: NestedAggregation;
|
|
329
|
-
/**
|
|
381
|
+
/** Aggregation name displayed in the return. */
|
|
330
382
|
name?: string | null;
|
|
331
|
-
/** Type of aggregation
|
|
383
|
+
/** Type of aggregation to perform. */
|
|
332
384
|
type?: AggregationType;
|
|
333
|
-
/** Field to aggregate by
|
|
385
|
+
/** Field to aggregate by. */
|
|
334
386
|
fieldPath?: string;
|
|
335
387
|
}
|
|
336
388
|
/** @oneof */
|
|
337
389
|
interface AggregationKindOneOf {
|
|
338
|
-
/**
|
|
390
|
+
/** A value aggregation calculates metrics such as count for specific fields within a dataset, providing insights into the overall distribution and key statistics of those values. For example, use a value aggregation to get the number of products (count) for each price listed in the store. */
|
|
339
391
|
value?: ValueAggregation;
|
|
340
|
-
/**
|
|
392
|
+
/** A scalar aggregation calculates a single numerical value from a dataset, such as the total sum, average, min, or max, summarizing the dataset into one key metric. For example, use a scalar aggregation to get the minimum price listed in the store. */
|
|
341
393
|
scalar?: ScalarAggregation;
|
|
342
|
-
/**
|
|
394
|
+
/**
|
|
395
|
+
* A nested aggregation is applied within the results of another aggregation. Rather than aggregating directly on the primary dataset, first group data using one aggregation and then apply another aggregation within each group. It allows for more complex analyses where you can summarize data at different levels of detail or hierarchy.
|
|
396
|
+
* For example, to get the number of products that are in stock and out of stock for each price listed, first perform a value aggregation on `discountedPriceNumeric`, and a second value aggregation on `inStock`.
|
|
397
|
+
*/
|
|
343
398
|
nested?: NestedAggregation;
|
|
344
399
|
}
|
|
345
400
|
declare enum ScalarType {
|
|
@@ -359,30 +414,35 @@ declare enum NestedAggregationType {
|
|
|
359
414
|
SCALAR = "SCALAR"
|
|
360
415
|
}
|
|
361
416
|
interface ValueAggregation {
|
|
362
|
-
/**
|
|
417
|
+
/**
|
|
418
|
+
* Number of aggregation results to return.
|
|
419
|
+
* Min: `1`
|
|
420
|
+
* Max: `250`
|
|
421
|
+
* Default: `10`
|
|
422
|
+
*/
|
|
363
423
|
limit?: number | null;
|
|
364
424
|
}
|
|
365
425
|
interface ScalarAggregation {
|
|
366
|
-
/**
|
|
426
|
+
/** Operation type for the scalar aggregation. */
|
|
367
427
|
type?: ScalarType;
|
|
368
428
|
}
|
|
369
429
|
interface NestedAggregationItem extends NestedAggregationItemKindOneOf {
|
|
370
|
-
/**
|
|
430
|
+
/** A value aggregation calculates metrics such as count for specific fields within a dataset, providing insights into the overall distribution and key statistics of those values. For example, use a value aggregation to get the number of products (count) for each price listed in the store. */
|
|
371
431
|
value?: ValueAggregation;
|
|
372
|
-
/**
|
|
432
|
+
/** A scalar aggregation calculates a single numerical value from a dataset, such as the total sum, average, min, or max, summarizing the dataset into one key metric. For example, use a scalar aggregation to get the minimum price listed in the store. */
|
|
373
433
|
scalar?: ScalarAggregation;
|
|
374
|
-
/**
|
|
434
|
+
/** Aggregation name displayed in the return. */
|
|
375
435
|
name?: string | null;
|
|
376
|
-
/** Type of aggregation
|
|
436
|
+
/** Type of aggregation to perform. */
|
|
377
437
|
type?: NestedAggregationType;
|
|
378
|
-
/** Field to aggregate by
|
|
438
|
+
/** Field to aggregate by. */
|
|
379
439
|
fieldPath?: string;
|
|
380
440
|
}
|
|
381
441
|
/** @oneof */
|
|
382
442
|
interface NestedAggregationItemKindOneOf {
|
|
383
|
-
/**
|
|
443
|
+
/** A value aggregation calculates metrics such as count for specific fields within a dataset, providing insights into the overall distribution and key statistics of those values. For example, use a value aggregation to get the number of products (count) for each price listed in the store. */
|
|
384
444
|
value?: ValueAggregation;
|
|
385
|
-
/**
|
|
445
|
+
/** A scalar aggregation calculates a single numerical value from a dataset, such as the total sum, average, min, or max, summarizing the dataset into one key metric. For example, use a scalar aggregation to get the minimum price listed in the store. */
|
|
386
446
|
scalar?: ScalarAggregation;
|
|
387
447
|
}
|
|
388
448
|
declare enum AggregationType {
|
|
@@ -396,15 +456,21 @@ declare enum AggregationType {
|
|
|
396
456
|
}
|
|
397
457
|
/** Nested aggregation expressed through a list of aggregation where each next aggregation is nested within previous one */
|
|
398
458
|
interface NestedAggregation {
|
|
399
|
-
/** Flattened list of aggregations, where each
|
|
459
|
+
/** Flattened list of aggregations, where each aggregation is nested within previous one. */
|
|
400
460
|
nestedAggregations?: NestedAggregationItem[];
|
|
401
461
|
}
|
|
402
462
|
interface SearchDetails {
|
|
403
|
-
/** Search term or expression */
|
|
463
|
+
/** Search term or expression. */
|
|
404
464
|
expression?: string | null;
|
|
405
|
-
/**
|
|
465
|
+
/**
|
|
466
|
+
* Fields to search in.
|
|
467
|
+
* If the array is empty, all fields are searched.
|
|
468
|
+
*/
|
|
406
469
|
fields?: string[];
|
|
407
|
-
/**
|
|
470
|
+
/**
|
|
471
|
+
* Whether to allow the search function to automatically correct typos or minor mistakes in the search expression.
|
|
472
|
+
* The search function uses an algorithm to find results that are close to what the site visitor typed.
|
|
473
|
+
*/
|
|
408
474
|
fuzzy?: boolean;
|
|
409
475
|
}
|
|
410
476
|
interface Paging {
|
|
@@ -426,9 +492,9 @@ declare enum DocumentType {
|
|
|
426
492
|
interface SearchResponse$2 extends SearchResponsePagingOneOf {
|
|
427
493
|
/** Paging metadata for the next page of results. */
|
|
428
494
|
pagingOffsetMetadata?: PagingMetadata;
|
|
429
|
-
/** Documents matching
|
|
430
|
-
|
|
431
|
-
/**
|
|
495
|
+
/** Documents matching the search query. */
|
|
496
|
+
siteDocumentItems?: SiteDocument[];
|
|
497
|
+
/** Aggregated data. */
|
|
432
498
|
aggregationData?: AggregationData;
|
|
433
499
|
}
|
|
434
500
|
/** @oneof */
|
|
@@ -437,7 +503,7 @@ interface SearchResponsePagingOneOf {
|
|
|
437
503
|
pagingOffsetMetadata?: PagingMetadata;
|
|
438
504
|
}
|
|
439
505
|
interface AggregationData {
|
|
440
|
-
/**
|
|
506
|
+
/** List of the aggregated data results. */
|
|
441
507
|
results?: AggregationResults[];
|
|
442
508
|
}
|
|
443
509
|
interface ValueAggregationResult {
|
|
@@ -462,24 +528,24 @@ interface ValueResult {
|
|
|
462
528
|
count?: number | null;
|
|
463
529
|
}
|
|
464
530
|
interface ScalarResult {
|
|
465
|
-
/**
|
|
531
|
+
/** Scalar aggregation results. */
|
|
466
532
|
value?: number;
|
|
467
533
|
}
|
|
468
534
|
interface NestedResultValue extends NestedResultValueResultOneOf {
|
|
469
|
-
/** Value aggregation
|
|
535
|
+
/** Value aggregation results. */
|
|
470
536
|
value?: ValueResult;
|
|
471
|
-
/** Scalar aggregation
|
|
537
|
+
/** Scalar aggregation results. */
|
|
472
538
|
scalar?: ScalarResult;
|
|
473
539
|
}
|
|
474
540
|
/** @oneof */
|
|
475
541
|
interface NestedResultValueResultOneOf {
|
|
476
|
-
/** Value aggregation
|
|
542
|
+
/** Value aggregation results. */
|
|
477
543
|
value?: ValueResult;
|
|
478
|
-
/** Scalar aggregation
|
|
544
|
+
/** Scalar aggregation results. */
|
|
479
545
|
scalar?: ScalarResult;
|
|
480
546
|
}
|
|
481
547
|
interface Results {
|
|
482
|
-
/** List of nested
|
|
548
|
+
/** List of nested aggregation results. */
|
|
483
549
|
results?: Record<string, NestedResultValue>;
|
|
484
550
|
}
|
|
485
551
|
/**
|
|
@@ -487,30 +553,30 @@ interface Results {
|
|
|
487
553
|
* aggregations in resulting array are keyed by requested aggregation `name`.
|
|
488
554
|
*/
|
|
489
555
|
interface NestedResults {
|
|
490
|
-
/** List of nested
|
|
556
|
+
/** List of nested aggregation results. */
|
|
491
557
|
results?: Results[];
|
|
492
558
|
}
|
|
493
559
|
interface AggregationResults extends AggregationResultsResultOneOf {
|
|
494
|
-
/** Value aggregation results */
|
|
560
|
+
/** Value aggregation results. */
|
|
495
561
|
values?: ValueResults;
|
|
496
|
-
/** Scalar aggregation results */
|
|
562
|
+
/** Scalar aggregation results. */
|
|
497
563
|
scalar?: AggregationResultsScalarResult;
|
|
498
|
-
/** Nested aggregation results */
|
|
564
|
+
/** Nested aggregation results. */
|
|
499
565
|
nested?: NestedResults;
|
|
500
|
-
/**
|
|
566
|
+
/** Aggregation name defined in the request. */
|
|
501
567
|
name?: string;
|
|
502
|
-
/** Type of aggregation that
|
|
568
|
+
/** Type of aggregation that was performed. */
|
|
503
569
|
type?: AggregationType;
|
|
504
|
-
/** Field
|
|
570
|
+
/** Field the data was aggregated by. */
|
|
505
571
|
fieldPath?: string;
|
|
506
572
|
}
|
|
507
573
|
/** @oneof */
|
|
508
574
|
interface AggregationResultsResultOneOf {
|
|
509
|
-
/** Value aggregation results */
|
|
575
|
+
/** Value aggregation results. */
|
|
510
576
|
values?: ValueResults;
|
|
511
|
-
/** Scalar aggregation results */
|
|
577
|
+
/** Scalar aggregation results. */
|
|
512
578
|
scalar?: AggregationResultsScalarResult;
|
|
513
|
-
/** Nested aggregation results */
|
|
579
|
+
/** Nested aggregation results. */
|
|
514
580
|
nested?: NestedResults;
|
|
515
581
|
}
|
|
516
582
|
interface PagingMetadata {
|
|
@@ -524,7 +590,7 @@ interface PagingMetadata {
|
|
|
524
590
|
tooManyToCount?: boolean | null;
|
|
525
591
|
}
|
|
526
592
|
interface SearchResponseNonNullableFields$2 {
|
|
527
|
-
|
|
593
|
+
siteDocumentItems: {
|
|
528
594
|
_id: string;
|
|
529
595
|
}[];
|
|
530
596
|
aggregationData?: {
|