@wix/search 1.0.26 → 1.0.28
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/search",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.28",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"registry": "https://registry.npmjs.org/",
|
|
6
6
|
"access": "public"
|
|
@@ -18,8 +18,8 @@
|
|
|
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.19",
|
|
22
|
+
"@wix/search_wix-site-search": "1.0.7"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"glob": "^10.4.1",
|
|
@@ -43,5 +43,5 @@
|
|
|
43
43
|
"fqdn": ""
|
|
44
44
|
}
|
|
45
45
|
},
|
|
46
|
-
"falconPackageHash": "
|
|
46
|
+
"falconPackageHash": "f76a2bdf45e6153d596019d0f49d1bd1b2f645f6006a9a787aa74524"
|
|
47
47
|
}
|
|
@@ -1,316 +1,8 @@
|
|
|
1
|
-
interface SiteDocument {
|
|
2
|
-
/**
|
|
3
|
-
* Results ID.
|
|
4
|
-
* @readonly
|
|
5
|
-
*/
|
|
6
|
-
_id?: string;
|
|
7
|
-
/** The docuement payload. */
|
|
8
|
-
data?: Record<string, any> | null;
|
|
9
|
-
}
|
|
10
|
-
interface Search extends SearchPagingMethodOneOf {
|
|
11
|
-
/** Paging options to limit and skip the number of items. */
|
|
12
|
-
paging?: Paging;
|
|
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
|
-
*/
|
|
21
|
-
filter?: Record<string, any> | null;
|
|
22
|
-
/**
|
|
23
|
-
* Sort object in the following format:
|
|
24
|
-
* `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`
|
|
25
|
-
*/
|
|
26
|
-
sort?: Sorting[];
|
|
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
|
-
*/
|
|
31
|
-
aggregations?: Aggregation$1[];
|
|
32
|
-
/** Free text to match in searchable fields. */
|
|
33
|
-
search?: SearchDetails;
|
|
34
|
-
}
|
|
35
|
-
/** @oneof */
|
|
36
|
-
interface SearchPagingMethodOneOf {
|
|
37
|
-
/** Paging options to limit and skip the number of items. */
|
|
38
|
-
paging?: Paging;
|
|
39
|
-
}
|
|
40
|
-
interface Sorting {
|
|
41
|
-
/** Name of the field to sort by. */
|
|
42
|
-
fieldName?: string;
|
|
43
|
-
/** Sort order. */
|
|
44
|
-
order?: SortOrder;
|
|
45
|
-
}
|
|
46
|
-
declare enum SortOrder {
|
|
47
|
-
ASC = "ASC",
|
|
48
|
-
DESC = "DESC"
|
|
49
|
-
}
|
|
50
|
-
interface Aggregation$1 extends AggregationKindOneOf {
|
|
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. */
|
|
52
|
-
value?: ValueAggregation;
|
|
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. */
|
|
54
|
-
scalar?: ScalarAggregation;
|
|
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
|
-
*/
|
|
59
|
-
nested?: NestedAggregation;
|
|
60
|
-
/** Aggregation name displayed in the return. */
|
|
61
|
-
name?: string | null;
|
|
62
|
-
/** Type of aggregation to perform. */
|
|
63
|
-
type?: AggregationType;
|
|
64
|
-
/** Field to aggregate by. */
|
|
65
|
-
fieldPath?: string;
|
|
66
|
-
}
|
|
67
|
-
/** @oneof */
|
|
68
|
-
interface AggregationKindOneOf {
|
|
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. */
|
|
70
|
-
value?: ValueAggregation;
|
|
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. */
|
|
72
|
-
scalar?: ScalarAggregation;
|
|
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
|
-
*/
|
|
77
|
-
nested?: NestedAggregation;
|
|
78
|
-
}
|
|
79
|
-
declare enum ScalarType {
|
|
80
|
-
UNKNOWN_SCALAR_TYPE = "UNKNOWN_SCALAR_TYPE",
|
|
81
|
-
/** Minimum value */
|
|
82
|
-
MIN = "MIN",
|
|
83
|
-
/** Maximum value */
|
|
84
|
-
MAX = "MAX",
|
|
85
|
-
/** Sum of values */
|
|
86
|
-
SUM = "SUM"
|
|
87
|
-
}
|
|
88
|
-
declare enum NestedAggregationType {
|
|
89
|
-
UNKNOWN_AGGREGATION_TYPE = "UNKNOWN_AGGREGATION_TYPE",
|
|
90
|
-
/** An aggregation where result buckets are dynamically built - one per unique value */
|
|
91
|
-
VALUE = "VALUE",
|
|
92
|
-
/** A single-value metric aggregation - e.g. min, max, sum, avg */
|
|
93
|
-
SCALAR = "SCALAR"
|
|
94
|
-
}
|
|
95
|
-
interface ValueAggregation {
|
|
96
|
-
/**
|
|
97
|
-
* Number of aggregation results to return.
|
|
98
|
-
* Min: `1`
|
|
99
|
-
* Max: `250`
|
|
100
|
-
* Default: `10`
|
|
101
|
-
*/
|
|
102
|
-
limit?: number | null;
|
|
103
|
-
}
|
|
104
|
-
interface ScalarAggregation {
|
|
105
|
-
/** Operation type for the scalar aggregation. */
|
|
106
|
-
type?: ScalarType;
|
|
107
|
-
}
|
|
108
|
-
interface NestedAggregationItem extends NestedAggregationItemKindOneOf {
|
|
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. */
|
|
110
|
-
value?: ValueAggregation;
|
|
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. */
|
|
112
|
-
scalar?: ScalarAggregation;
|
|
113
|
-
/** Aggregation name displayed in the return. */
|
|
114
|
-
name?: string | null;
|
|
115
|
-
/** Type of aggregation to perform. */
|
|
116
|
-
type?: NestedAggregationType;
|
|
117
|
-
/** Field to aggregate by. */
|
|
118
|
-
fieldPath?: string;
|
|
119
|
-
}
|
|
120
|
-
/** @oneof */
|
|
121
|
-
interface NestedAggregationItemKindOneOf {
|
|
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. */
|
|
123
|
-
value?: ValueAggregation;
|
|
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. */
|
|
125
|
-
scalar?: ScalarAggregation;
|
|
126
|
-
}
|
|
127
|
-
declare enum AggregationType {
|
|
128
|
-
UNKNOWN_AGGREGATION_TYPE = "UNKNOWN_AGGREGATION_TYPE",
|
|
129
|
-
/** An aggregation where result buckets are dynamically built - one per unique value */
|
|
130
|
-
VALUE = "VALUE",
|
|
131
|
-
/** A single-value metric aggregation - e.g. min, max, sum, avg */
|
|
132
|
-
SCALAR = "SCALAR",
|
|
133
|
-
/** Multi-level aggregation, where each next aggregation is nested within previous one */
|
|
134
|
-
NESTED = "NESTED"
|
|
135
|
-
}
|
|
136
|
-
/** Nested aggregation expressed through a list of aggregation where each next aggregation is nested within previous one */
|
|
137
|
-
interface NestedAggregation {
|
|
138
|
-
/** Flattened list of aggregations, where each aggregation is nested within previous one. */
|
|
139
|
-
nestedAggregations?: NestedAggregationItem[];
|
|
140
|
-
}
|
|
141
|
-
interface SearchDetails {
|
|
142
|
-
/** Search term or expression. */
|
|
143
|
-
expression?: string | null;
|
|
144
|
-
/**
|
|
145
|
-
* Fields to search in.
|
|
146
|
-
* If the array is empty, all fields are searched.
|
|
147
|
-
*/
|
|
148
|
-
fields?: string[];
|
|
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
|
-
*/
|
|
153
|
-
fuzzy?: boolean;
|
|
154
|
-
}
|
|
155
|
-
interface Paging {
|
|
156
|
-
/** Number of items to load. */
|
|
157
|
-
limit?: number | null;
|
|
158
|
-
/** Number of items to skip in the current sort order. */
|
|
159
|
-
offset?: number | null;
|
|
160
|
-
}
|
|
161
|
-
declare enum DocumentType {
|
|
162
|
-
UNSPECIFIED = "UNSPECIFIED",
|
|
163
|
-
BLOG_POSTS = "BLOG_POSTS",
|
|
164
|
-
BOOKING_SERVICES = "BOOKING_SERVICES",
|
|
165
|
-
EVENTS = "EVENTS",
|
|
166
|
-
FORUM_CONTENT = "FORUM_CONTENT",
|
|
167
|
-
ONLINE_PROGRAMS = "ONLINE_PROGRAMS",
|
|
168
|
-
PROGALLERY_ITEM = "PROGALLERY_ITEM",
|
|
169
|
-
STORES_PRODUCTS = "STORES_PRODUCTS"
|
|
170
|
-
}
|
|
171
|
-
interface SearchResponse$1 extends SearchResponsePagingOneOf {
|
|
172
|
-
/** Paging metadata for the next page of results. */
|
|
173
|
-
pagingOffsetMetadata?: PagingMetadata;
|
|
174
|
-
/** Documents matching the search query. */
|
|
175
|
-
siteDocumentItems?: SiteDocument[];
|
|
176
|
-
/** Aggregated data. */
|
|
177
|
-
aggregationData?: AggregationData;
|
|
178
|
-
}
|
|
179
|
-
/** @oneof */
|
|
180
|
-
interface SearchResponsePagingOneOf {
|
|
181
|
-
/** Paging metadata for the next page of results. */
|
|
182
|
-
pagingOffsetMetadata?: PagingMetadata;
|
|
183
|
-
}
|
|
184
|
-
interface AggregationData {
|
|
185
|
-
/** List of the aggregated data results. */
|
|
186
|
-
results?: AggregationResults[];
|
|
187
|
-
}
|
|
188
|
-
interface ValueAggregationResult {
|
|
189
|
-
/** Value of the field */
|
|
190
|
-
value?: string;
|
|
191
|
-
count?: number;
|
|
192
|
-
}
|
|
193
|
-
interface ValueResults {
|
|
194
|
-
/** List of value aggregations */
|
|
195
|
-
results?: ValueAggregationResult[];
|
|
196
|
-
}
|
|
197
|
-
interface AggregationResultsScalarResult {
|
|
198
|
-
/** Type of scalar aggregation */
|
|
199
|
-
type?: ScalarType;
|
|
200
|
-
/** Value of the scalar aggregation */
|
|
201
|
-
value?: number;
|
|
202
|
-
}
|
|
203
|
-
interface ValueResult {
|
|
204
|
-
/** Value of the field */
|
|
205
|
-
value?: string;
|
|
206
|
-
/** Count of entities with this value */
|
|
207
|
-
count?: number | null;
|
|
208
|
-
}
|
|
209
|
-
interface ScalarResult {
|
|
210
|
-
/** Scalar aggregation results. */
|
|
211
|
-
value?: number;
|
|
212
|
-
}
|
|
213
|
-
interface NestedResultValue extends NestedResultValueResultOneOf {
|
|
214
|
-
/** Value aggregation results. */
|
|
215
|
-
value?: ValueResult;
|
|
216
|
-
/** Scalar aggregation results. */
|
|
217
|
-
scalar?: ScalarResult;
|
|
218
|
-
}
|
|
219
|
-
/** @oneof */
|
|
220
|
-
interface NestedResultValueResultOneOf {
|
|
221
|
-
/** Value aggregation results. */
|
|
222
|
-
value?: ValueResult;
|
|
223
|
-
/** Scalar aggregation results. */
|
|
224
|
-
scalar?: ScalarResult;
|
|
225
|
-
}
|
|
226
|
-
interface Results {
|
|
227
|
-
/** List of nested aggregation results. */
|
|
228
|
-
results?: Record<string, NestedResultValue>;
|
|
229
|
-
}
|
|
230
|
-
/**
|
|
231
|
-
* Results of `NESTED` aggregation type in a flattened form
|
|
232
|
-
* aggregations in resulting array are keyed by requested aggregation `name`.
|
|
233
|
-
*/
|
|
234
|
-
interface NestedResults {
|
|
235
|
-
/** List of nested aggregation results. */
|
|
236
|
-
results?: Results[];
|
|
237
|
-
}
|
|
238
|
-
interface AggregationResults extends AggregationResultsResultOneOf {
|
|
239
|
-
/** Value aggregation results. */
|
|
240
|
-
values?: ValueResults;
|
|
241
|
-
/** Scalar aggregation results. */
|
|
242
|
-
scalar?: AggregationResultsScalarResult;
|
|
243
|
-
/** Nested aggregation results. */
|
|
244
|
-
nested?: NestedResults;
|
|
245
|
-
/** Aggregation name defined in the request. */
|
|
246
|
-
name?: string;
|
|
247
|
-
/** Type of aggregation that was performed. */
|
|
248
|
-
type?: AggregationType;
|
|
249
|
-
/** Field the data was aggregated by. */
|
|
250
|
-
fieldPath?: string;
|
|
251
|
-
}
|
|
252
|
-
/** @oneof */
|
|
253
|
-
interface AggregationResultsResultOneOf {
|
|
254
|
-
/** Value aggregation results. */
|
|
255
|
-
values?: ValueResults;
|
|
256
|
-
/** Scalar aggregation results. */
|
|
257
|
-
scalar?: AggregationResultsScalarResult;
|
|
258
|
-
/** Nested aggregation results. */
|
|
259
|
-
nested?: NestedResults;
|
|
260
|
-
}
|
|
261
|
-
interface PagingMetadata {
|
|
262
|
-
/** Number of items returned in the response. */
|
|
263
|
-
count?: number | null;
|
|
264
|
-
/** Offset that was requested. */
|
|
265
|
-
offset?: number | null;
|
|
266
|
-
/** Total number of items that match the query. */
|
|
267
|
-
total?: number | null;
|
|
268
|
-
/** Flag that indicates the server failed to calculate the `total` field. */
|
|
269
|
-
tooManyToCount?: boolean | null;
|
|
270
|
-
}
|
|
271
|
-
interface SearchResponseNonNullableFields$1 {
|
|
272
|
-
siteDocumentItems: {
|
|
273
|
-
_id: string;
|
|
274
|
-
}[];
|
|
275
|
-
aggregationData?: {
|
|
276
|
-
results: {
|
|
277
|
-
values?: {
|
|
278
|
-
results: {
|
|
279
|
-
value: string;
|
|
280
|
-
count: number;
|
|
281
|
-
}[];
|
|
282
|
-
};
|
|
283
|
-
scalar?: {
|
|
284
|
-
type: ScalarType;
|
|
285
|
-
value: number;
|
|
286
|
-
};
|
|
287
|
-
nested?: {
|
|
288
|
-
results: {
|
|
289
|
-
results?: {
|
|
290
|
-
value?: {
|
|
291
|
-
value: string;
|
|
292
|
-
};
|
|
293
|
-
scalar?: {
|
|
294
|
-
value: number;
|
|
295
|
-
};
|
|
296
|
-
};
|
|
297
|
-
}[];
|
|
298
|
-
};
|
|
299
|
-
name: string;
|
|
300
|
-
type: AggregationType;
|
|
301
|
-
fieldPath: string;
|
|
302
|
-
}[];
|
|
303
|
-
};
|
|
304
|
-
}
|
|
305
|
-
interface SearchOptions$1 {
|
|
306
|
-
/** Search query and aggregation information. */
|
|
307
|
-
search: Search;
|
|
308
|
-
}
|
|
309
|
-
|
|
310
1
|
type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
|
|
311
2
|
interface HttpClient {
|
|
312
3
|
request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
|
|
313
|
-
fetchWithAuth:
|
|
4
|
+
fetchWithAuth: typeof fetch;
|
|
5
|
+
wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
|
|
314
6
|
}
|
|
315
7
|
type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
|
|
316
8
|
type HttpResponse<T = any> = {
|
|
@@ -340,438 +32,24 @@ declare global {
|
|
|
340
32
|
}
|
|
341
33
|
}
|
|
342
34
|
|
|
343
|
-
declare function
|
|
35
|
+
declare function createRESTModule$1<T extends RESTFunctionDescriptor>(descriptor: T, elevated?: boolean): BuildRESTFunction<T> & T;
|
|
344
36
|
|
|
345
|
-
declare const search$
|
|
37
|
+
declare const search$1: ReturnType<typeof createRESTModule$1<typeof publicSearch>>;
|
|
346
38
|
|
|
347
39
|
declare namespace context$1 {
|
|
348
|
-
export { search$
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
interface OrderingClauses {
|
|
352
|
-
ordering?: OrderingClause[];
|
|
353
|
-
}
|
|
354
|
-
interface OrderingClause {
|
|
355
|
-
fieldName?: string | null;
|
|
356
|
-
direction?: Direction;
|
|
357
|
-
}
|
|
358
|
-
declare enum Direction {
|
|
359
|
-
UninitializedDirection = "UninitializedDirection",
|
|
360
|
-
ASC = "ASC",
|
|
361
|
-
DESC = "DESC"
|
|
362
|
-
}
|
|
363
|
-
interface SearchPaging {
|
|
364
|
-
/**
|
|
365
|
-
* Number of items to skip in the result set.
|
|
366
|
-
* @deprecated
|
|
367
|
-
*/
|
|
368
|
-
skip?: number;
|
|
369
|
-
/** Number of items to fetch (effectively page size). */
|
|
370
|
-
limit?: number;
|
|
371
|
-
/** Number of items to skip in the result set. */
|
|
372
|
-
offset?: number;
|
|
373
|
-
}
|
|
374
|
-
interface FacetClauses {
|
|
375
|
-
/** Each entry represents a single facet with parameters. */
|
|
376
|
-
clauses?: FacetClause[];
|
|
377
|
-
}
|
|
378
|
-
interface FacetClause extends FacetClauseClauseOneOf {
|
|
379
|
-
term?: TermFacet;
|
|
380
|
-
aggregation?: AggregationFacet;
|
|
381
|
-
hierarchical?: HierarchicalFacet;
|
|
382
|
-
}
|
|
383
|
-
/** @oneof */
|
|
384
|
-
interface FacetClauseClauseOneOf {
|
|
385
|
-
term?: TermFacet;
|
|
386
|
-
aggregation?: AggregationFacet;
|
|
387
|
-
hierarchical?: HierarchicalFacet;
|
|
388
|
-
}
|
|
389
|
-
declare enum Aggregation {
|
|
390
|
-
MIN = "MIN",
|
|
391
|
-
MAX = "MAX",
|
|
392
|
-
SUM = "SUM"
|
|
393
|
-
}
|
|
394
|
-
interface HierarchicalFacet extends HierarchicalFacetClauseOneOf {
|
|
395
|
-
term?: TermFacet;
|
|
396
|
-
aggregation?: AggregationFacet;
|
|
397
|
-
nestedAggregation?: HierarchicalFacet;
|
|
398
|
-
}
|
|
399
|
-
/** @oneof */
|
|
400
|
-
interface HierarchicalFacetClauseOneOf {
|
|
401
|
-
term?: TermFacet;
|
|
402
|
-
aggregation?: AggregationFacet;
|
|
403
|
-
}
|
|
404
|
-
interface TermFacet {
|
|
405
|
-
/** The name of the faceted attribute. */
|
|
406
|
-
name?: string;
|
|
407
|
-
/** Limit the number of facet values returned. Default is 10. */
|
|
408
|
-
limit?: number | null;
|
|
409
|
-
}
|
|
410
|
-
interface AggregationFacet {
|
|
411
|
-
/** The name of the faceted attribute. */
|
|
412
|
-
name?: string;
|
|
413
|
-
/** Aggregation type. */
|
|
414
|
-
aggregation?: Aggregation;
|
|
415
|
-
}
|
|
416
|
-
interface SearchProperty {
|
|
417
|
-
name?: string;
|
|
418
|
-
value?: any;
|
|
419
|
-
}
|
|
420
|
-
interface SearchResponse {
|
|
421
|
-
/** Documents matching filter and query. */
|
|
422
|
-
documents?: Record<string, any>[] | null;
|
|
423
|
-
nextPage?: NextPageResponse;
|
|
424
|
-
/**
|
|
425
|
-
* Facets provide "counts in categories" view. For example searching for "Nike" would return
|
|
426
|
-
* (Shoes, 5), (Socks, 2) indicating numbers for matching by each faceted field.
|
|
427
|
-
*/
|
|
428
|
-
facets?: FacetsResponse[];
|
|
429
|
-
}
|
|
430
|
-
interface NextPageResponse {
|
|
431
|
-
/** Total number of items across all pages */
|
|
432
|
-
total?: number;
|
|
433
|
-
/** The number of items to skip */
|
|
434
|
-
skip?: number;
|
|
435
|
-
/** The number of items to retrieve in one page */
|
|
436
|
-
limit?: number;
|
|
437
|
-
}
|
|
438
|
-
interface FacetsResponse extends FacetsResponseResponseOneOf {
|
|
439
|
-
terms?: TermAggregationResponse;
|
|
440
|
-
minAggregation?: MinAggregationResponse;
|
|
441
|
-
maxAggregation?: MaxAggregationResponse;
|
|
442
|
-
minMaxAggregation?: MinMaxAggregationResponse;
|
|
443
|
-
hierarchicalAggregation?: HierarchicalAggregationResponse;
|
|
444
|
-
sumAggregation?: SumAggregationResponse;
|
|
445
|
-
}
|
|
446
|
-
/** @oneof */
|
|
447
|
-
interface FacetsResponseResponseOneOf {
|
|
448
|
-
terms?: TermAggregationResponse;
|
|
449
|
-
minAggregation?: MinAggregationResponse;
|
|
450
|
-
maxAggregation?: MaxAggregationResponse;
|
|
451
|
-
minMaxAggregation?: MinMaxAggregationResponse;
|
|
452
|
-
hierarchicalAggregation?: HierarchicalAggregationResponse;
|
|
453
|
-
sumAggregation?: SumAggregationResponse;
|
|
454
|
-
}
|
|
455
|
-
interface FacetCountResponse {
|
|
456
|
-
/** Facet field value (for example "Shoes", "Socks") */
|
|
457
|
-
facetValue?: string;
|
|
458
|
-
/** Document count within the group */
|
|
459
|
-
count?: number;
|
|
460
|
-
}
|
|
461
|
-
interface Value {
|
|
462
|
-
value?: string;
|
|
463
|
-
facets?: FacetsResponse;
|
|
464
|
-
count?: number;
|
|
465
|
-
}
|
|
466
|
-
interface TermAggregationResponse {
|
|
467
|
-
/** Facet field (for example productCategory) */
|
|
468
|
-
facet?: string;
|
|
469
|
-
/** Facet values and document counts */
|
|
470
|
-
facets?: FacetCountResponse[];
|
|
471
|
-
}
|
|
472
|
-
interface MinAggregationResponse {
|
|
473
|
-
/** Facet field (for example productPrice) */
|
|
474
|
-
facet?: string;
|
|
475
|
-
/** The minimum value across all documents */
|
|
476
|
-
minValue?: number | null;
|
|
477
|
-
}
|
|
478
|
-
interface MaxAggregationResponse {
|
|
479
|
-
/** Facet field (for example productPrice) */
|
|
480
|
-
facet?: string;
|
|
481
|
-
/** The maximum value across all documents */
|
|
482
|
-
maxValue?: number | null;
|
|
483
|
-
}
|
|
484
|
-
interface MinMaxAggregationResponse {
|
|
485
|
-
/** Facet field (for example productPrice) */
|
|
486
|
-
facet?: string;
|
|
487
|
-
/** The minimum value across all documents */
|
|
488
|
-
minValue?: number | null;
|
|
489
|
-
/** The maximum value across all documents */
|
|
490
|
-
maxValue?: number | null;
|
|
491
|
-
}
|
|
492
|
-
interface HierarchicalAggregationResponse {
|
|
493
|
-
facet?: string;
|
|
494
|
-
values?: Value[];
|
|
495
|
-
}
|
|
496
|
-
interface SumAggregationResponse {
|
|
497
|
-
/** Facet field (for example productPrice) */
|
|
498
|
-
facet?: string;
|
|
499
|
-
/** The sum value across all documents */
|
|
500
|
-
value?: number | null;
|
|
501
|
-
}
|
|
502
|
-
interface FederatedSearchResponse {
|
|
503
|
-
/** Search results from multiple indexes. */
|
|
504
|
-
results?: FederatedSearchDocuments[];
|
|
505
|
-
}
|
|
506
|
-
interface FederatedSearchDocuments {
|
|
507
|
-
/** Document type of documents */
|
|
508
|
-
documentType?: string | null;
|
|
509
|
-
/** Documents of document type */
|
|
510
|
-
documents?: Record<string, any>[] | null;
|
|
511
|
-
/** Total count of matching documents for document type */
|
|
512
|
-
total?: number;
|
|
513
|
-
}
|
|
514
|
-
interface SuggestResponse {
|
|
515
|
-
/** Suggested documents. */
|
|
516
|
-
documents?: Record<string, any>[] | null;
|
|
517
|
-
}
|
|
518
|
-
interface FederatedSuggestResponse {
|
|
519
|
-
/** Suggest results from multiple indexes. */
|
|
520
|
-
results?: FederatedSuggestDocuments[];
|
|
521
|
-
}
|
|
522
|
-
interface FederatedSuggestDocuments {
|
|
523
|
-
/** Document type of documents */
|
|
524
|
-
documentType?: string | null;
|
|
525
|
-
/** Documents of document type */
|
|
526
|
-
documents?: Record<string, any>[] | null;
|
|
527
|
-
}
|
|
528
|
-
interface RelatedResponse {
|
|
529
|
-
/** Documents matching filter and query. */
|
|
530
|
-
documents?: Record<string, any>[] | null;
|
|
531
|
-
}
|
|
532
|
-
interface AutocompleteResponse {
|
|
533
|
-
/** Suggested phrases. */
|
|
534
|
-
values?: AutocompleteResponseValue[];
|
|
535
|
-
}
|
|
536
|
-
interface AutocompleteResponseValue {
|
|
537
|
-
/** Suggested phrase. */
|
|
538
|
-
query?: string;
|
|
539
|
-
}
|
|
540
|
-
interface FederatedAutocompleteResponse {
|
|
541
|
-
/** Suggested phrases from multiple indexes */
|
|
542
|
-
results?: FederatedAutocompleteResults[];
|
|
543
|
-
}
|
|
544
|
-
interface FederatedAutocompleteResults {
|
|
545
|
-
/** Document type of queries */
|
|
546
|
-
documentType?: string | null;
|
|
547
|
-
/** Suggested phrases */
|
|
548
|
-
values?: AutocompleteResponseValue[];
|
|
549
|
-
}
|
|
550
|
-
interface TrendingResponse {
|
|
551
|
-
results?: TrendingItems[];
|
|
552
|
-
}
|
|
553
|
-
interface TrendingItems {
|
|
554
|
-
documentType?: string;
|
|
555
|
-
documents?: Record<string, any>[] | null;
|
|
556
|
-
}
|
|
557
|
-
interface SearchResponseNonNullableFields {
|
|
558
|
-
nextPage?: {
|
|
559
|
-
total: number;
|
|
560
|
-
skip: number;
|
|
561
|
-
limit: number;
|
|
562
|
-
};
|
|
563
|
-
facets: {
|
|
564
|
-
terms?: {
|
|
565
|
-
facet: string;
|
|
566
|
-
facets: {
|
|
567
|
-
facetValue: string;
|
|
568
|
-
count: number;
|
|
569
|
-
}[];
|
|
570
|
-
};
|
|
571
|
-
minAggregation?: {
|
|
572
|
-
facet: string;
|
|
573
|
-
};
|
|
574
|
-
maxAggregation?: {
|
|
575
|
-
facet: string;
|
|
576
|
-
};
|
|
577
|
-
minMaxAggregation?: {
|
|
578
|
-
facet: string;
|
|
579
|
-
};
|
|
580
|
-
hierarchicalAggregation?: {
|
|
581
|
-
facet: string;
|
|
582
|
-
values: {
|
|
583
|
-
value: string;
|
|
584
|
-
count: number;
|
|
585
|
-
}[];
|
|
586
|
-
};
|
|
587
|
-
sumAggregation?: {
|
|
588
|
-
facet: string;
|
|
589
|
-
};
|
|
590
|
-
}[];
|
|
591
|
-
}
|
|
592
|
-
interface FederatedSearchResponseNonNullableFields {
|
|
593
|
-
results: {
|
|
594
|
-
total: number;
|
|
595
|
-
}[];
|
|
596
|
-
}
|
|
597
|
-
interface FederatedSuggestResponseNonNullableFields {
|
|
598
|
-
results: FederatedSuggestDocuments[];
|
|
599
|
-
}
|
|
600
|
-
interface AutocompleteResponseNonNullableFields {
|
|
601
|
-
values: {
|
|
602
|
-
query: string;
|
|
603
|
-
}[];
|
|
604
|
-
}
|
|
605
|
-
interface FederatedAutocompleteResponseNonNullableFields {
|
|
606
|
-
results: {
|
|
607
|
-
values: {
|
|
608
|
-
query: string;
|
|
609
|
-
}[];
|
|
610
|
-
}[];
|
|
611
|
-
}
|
|
612
|
-
interface TrendingResponseNonNullableFields {
|
|
613
|
-
results: {
|
|
614
|
-
documentType: string;
|
|
615
|
-
}[];
|
|
616
|
-
}
|
|
617
|
-
interface SearchOptions {
|
|
618
|
-
/** Text to search for. All searchable fields will be searched. */
|
|
619
|
-
query?: string | null;
|
|
620
|
-
/** Document type of documents to search for. All document types are searched if not provided. */
|
|
621
|
-
documentType?: string | null;
|
|
622
|
-
/** Fields to order by. */
|
|
623
|
-
ordering?: OrderingClauses;
|
|
624
|
-
/** Paging parameters. */
|
|
625
|
-
paging?: SearchPaging;
|
|
626
|
-
/** Language to search in. */
|
|
627
|
-
language?: string | null;
|
|
628
|
-
/** Filter in platformized query language (for example {'field': {'$eq': 'value'}}) */
|
|
629
|
-
filter?: Record<string, any> | null;
|
|
630
|
-
/** The facets to retrieve. */
|
|
631
|
-
facets?: FacetClauses;
|
|
632
|
-
/** Enable fuzzy search (eg. query 'kalvin clein' will match document with 'calvin klein' in title). */
|
|
633
|
-
fuzzy?: boolean | null;
|
|
634
|
-
/** Highlight texts matching the query. Highlighted text will be wrapped with <mark/> tag. Defaults to true if not provided. */
|
|
635
|
-
highlight?: boolean | null;
|
|
636
|
-
/** Searchable fields to search in. If not provided, search is executed on all searchable fields in schema */
|
|
637
|
-
searchFields?: string[];
|
|
638
|
-
/** A list of fields to include in the result set. If not provided, all fields of schema will be included. */
|
|
639
|
-
fields?: string[];
|
|
640
|
-
/** The properties/overrides/experiments to enable for this request. Currently supported: `scoring_profile`. */
|
|
641
|
-
properties?: SearchProperty[];
|
|
642
|
-
/** Include seo hidden documents. Defaults to false if not provided. */
|
|
643
|
-
includeSeoHidden?: boolean | null;
|
|
644
|
-
}
|
|
645
|
-
interface FederatedSearchOptions {
|
|
646
|
-
/** Query phrase to use. */
|
|
647
|
-
query?: string | null;
|
|
648
|
-
/** Language to search in. */
|
|
649
|
-
language?: string | null;
|
|
650
|
-
/** Limit of documents to return per document type. */
|
|
651
|
-
limit?: number | null;
|
|
652
|
-
/** Enable fuzzy search (for example query 'kalvin clein' will match document with 'calvin klein' in title). */
|
|
653
|
-
fuzzy?: boolean | null;
|
|
654
|
-
/** Highlight texts matching the query. Highlighted text will be wrapped with <mark/> tag. Defaults to true if not provided. */
|
|
655
|
-
highlight?: boolean | null;
|
|
656
|
-
/** Searchable fields to search in. If not provided, search is executed on all searchable fields in schemas */
|
|
657
|
-
searchFields?: string[];
|
|
658
|
-
/** Document types to search in. If not provided, search is executed on all document types enabled for the site */
|
|
659
|
-
documentTypes?: string[];
|
|
660
|
-
/** Include seo hidden documents. Defaults to false if not provided. */
|
|
661
|
-
includeSeoHidden?: boolean | null;
|
|
662
|
-
}
|
|
663
|
-
interface SuggestOptions {
|
|
664
|
-
/** Text to search for. Fields configured in suggester configuration will be searched. */
|
|
665
|
-
query?: string | null;
|
|
666
|
-
/** Document type of documents to search for. All document types are searched if not provided. */
|
|
667
|
-
documentType?: string | null;
|
|
668
|
-
/** Fields to order by. */
|
|
669
|
-
ordering?: OrderingClauses;
|
|
670
|
-
/** Number of suggested document to return. */
|
|
671
|
-
limit?: number;
|
|
672
|
-
/** Language to search in. */
|
|
673
|
-
language?: string | null;
|
|
674
|
-
/** Filter in platformized query language (for example {'field': {'$eq': 'value'}}) */
|
|
675
|
-
filter?: Record<string, any> | null;
|
|
676
|
-
/** Searchable fields to search in. If not provided, search is executed on all suggestable fields in schema */
|
|
677
|
-
searchFields?: string[];
|
|
678
|
-
/** A list of fields to include in the result set. If not provided, all fields of schema will be included. */
|
|
679
|
-
fields?: string[];
|
|
680
|
-
/** Include seo hidden documents. Defaults to false if not provided. */
|
|
681
|
-
includeSeoHidden?: boolean | null;
|
|
682
|
-
/** The properties/overrides/experiments to enable for this request. Currently supported: `scoring_profile`. */
|
|
683
|
-
properties?: SearchProperty[];
|
|
684
|
-
}
|
|
685
|
-
interface FederatedSuggestOptions {
|
|
686
|
-
/** Text to search for. Fields configured in suggester configuration will be searched. */
|
|
687
|
-
query?: string | null;
|
|
688
|
-
/** Language to search in. */
|
|
689
|
-
language?: string | null;
|
|
690
|
-
/** Number of suggested document to return per document type. */
|
|
691
|
-
limit?: number;
|
|
692
|
-
/** Searchable fields to search in. If not provided, search is executed on all suggestable fields in schemas */
|
|
693
|
-
searchFields?: string[];
|
|
694
|
-
/** Document types to search in. If not provided, search is executed on all document types enabled for the site */
|
|
695
|
-
documentTypes?: string[];
|
|
696
|
-
/** Include seo hidden documents. Defaults to false if not provided. */
|
|
697
|
-
includeSeoHidden?: boolean | null;
|
|
698
|
-
}
|
|
699
|
-
interface RelatedOptions {
|
|
700
|
-
/** ID of the document to fetch related documents for. */
|
|
701
|
-
documentId?: string | null;
|
|
702
|
-
/** Document type of the document. */
|
|
703
|
-
documentType?: string | null;
|
|
704
|
-
/** Fields to order by. */
|
|
705
|
-
ordering?: OrderingClauses;
|
|
706
|
-
/** Language to search in. */
|
|
707
|
-
language?: string | null;
|
|
708
|
-
/** Filter in platformized query language (for example {'field': {'$eq': 'value'}}). */
|
|
709
|
-
filter?: Record<string, any> | null;
|
|
710
|
-
/** Searchable fields to compare documents by. If not provided, all searchable fields in schema are used */
|
|
711
|
-
searchFields?: string[];
|
|
712
|
-
/** A list of fields to include in the result set. If not provided, all fields of schema will be included. */
|
|
713
|
-
fields?: string[];
|
|
714
|
-
/** Number of related documents to return */
|
|
715
|
-
limit?: number;
|
|
716
|
-
/** The properties/overrides/experiments to enable for this request. Currently supported: `scoring_profile`. */
|
|
717
|
-
properties?: SearchProperty[];
|
|
718
|
-
/** Include seo hidden documents. Defaults to false if not provided. */
|
|
719
|
-
includeSeoHidden?: boolean | null;
|
|
720
|
-
}
|
|
721
|
-
interface AutocompleteOptions {
|
|
722
|
-
/** Query phrase to fetch completions for. */
|
|
723
|
-
query?: string | null;
|
|
724
|
-
/** Document type to use to search for phrases. */
|
|
725
|
-
documentType?: string | null;
|
|
726
|
-
/** Limit of phrases to fetch. */
|
|
727
|
-
limit?: number;
|
|
728
|
-
/** Language to search in. */
|
|
729
|
-
language?: string | null;
|
|
730
|
-
/** Filter in platfromized query language (for example {'field': {'$eq': 'value'}}) */
|
|
731
|
-
filter?: Record<string, any> | null;
|
|
732
|
-
/** Searchable fields to use for query completion. If not provided, all searchable fields in schema are used */
|
|
733
|
-
searchFields?: string[];
|
|
734
|
-
/** Include seo hidden documents. Defaults to false if not provided. */
|
|
735
|
-
includeSeoHidden?: boolean | null;
|
|
736
|
-
}
|
|
737
|
-
interface FederatedAutocompleteOptions {
|
|
738
|
-
/** Query phrase to fetch completions for. */
|
|
739
|
-
query?: string | null;
|
|
740
|
-
/** Language to search in. */
|
|
741
|
-
language?: string | null;
|
|
742
|
-
/** Number of queries to return per document type. */
|
|
743
|
-
limit?: number;
|
|
744
|
-
/** Searchable fields to search in. If not provided, search is executed on all autocompletable fields in schemas */
|
|
745
|
-
searchFields?: string[];
|
|
746
|
-
/** Document types to autocomplete in. If not provided, autocomplete is executed on all document types enabled for the site */
|
|
747
|
-
documentTypes?: string[];
|
|
748
|
-
/** Include seo hidden documents. Defaults to false if not provided. */
|
|
749
|
-
includeSeoHidden?: boolean | null;
|
|
750
|
-
}
|
|
751
|
-
interface TrendingOptions {
|
|
752
|
-
documentTypes?: string[];
|
|
753
|
-
language?: string | null;
|
|
754
|
-
/** Include seo hidden documents. Defaults to false if not provided. */
|
|
755
|
-
includeSeoHidden?: boolean | null;
|
|
40
|
+
export { search$1 as search };
|
|
756
41
|
}
|
|
757
42
|
|
|
758
|
-
declare function
|
|
759
|
-
declare function federatedSearch$1(httpClient: HttpClient): (options?: FederatedSearchOptions) => Promise<FederatedSearchResponse & FederatedSearchResponseNonNullableFields>;
|
|
760
|
-
declare function suggest$1(httpClient: HttpClient): (options?: SuggestOptions) => Promise<SuggestResponse>;
|
|
761
|
-
declare function federatedSuggest$1(httpClient: HttpClient): (options?: FederatedSuggestOptions) => Promise<FederatedSuggestResponse & FederatedSuggestResponseNonNullableFields>;
|
|
762
|
-
declare function related$1(httpClient: HttpClient): (options?: RelatedOptions) => Promise<RelatedResponse>;
|
|
763
|
-
declare function autocomplete$1(httpClient: HttpClient): (options?: AutocompleteOptions) => Promise<AutocompleteResponse & AutocompleteResponseNonNullableFields>;
|
|
764
|
-
declare function federatedAutocomplete$1(httpClient: HttpClient): (options?: FederatedAutocompleteOptions) => Promise<FederatedAutocompleteResponse & FederatedAutocompleteResponseNonNullableFields>;
|
|
765
|
-
declare function trending$1(httpClient: HttpClient): (options?: TrendingOptions) => Promise<TrendingResponse & TrendingResponseNonNullableFields>;
|
|
43
|
+
declare function createRESTModule<T extends RESTFunctionDescriptor>(descriptor: T, elevated?: boolean): BuildRESTFunction<T> & T;
|
|
766
44
|
|
|
767
|
-
declare const search:
|
|
768
|
-
declare const federatedSearch:
|
|
769
|
-
declare const suggest:
|
|
770
|
-
declare const federatedSuggest:
|
|
771
|
-
declare const related:
|
|
772
|
-
declare const autocomplete:
|
|
773
|
-
declare const federatedAutocomplete:
|
|
774
|
-
declare const trending:
|
|
45
|
+
declare const search: ReturnType<typeof createRESTModule<typeof publicSearch>>;
|
|
46
|
+
declare const federatedSearch: ReturnType<typeof createRESTModule<typeof publicFederatedSearch>>;
|
|
47
|
+
declare const suggest: ReturnType<typeof createRESTModule<typeof publicSuggest>>;
|
|
48
|
+
declare const federatedSuggest: ReturnType<typeof createRESTModule<typeof publicFederatedSuggest>>;
|
|
49
|
+
declare const related: ReturnType<typeof createRESTModule<typeof publicRelated>>;
|
|
50
|
+
declare const autocomplete: ReturnType<typeof createRESTModule<typeof publicAutocomplete>>;
|
|
51
|
+
declare const federatedAutocomplete: ReturnType<typeof createRESTModule<typeof publicFederatedAutocomplete>>;
|
|
52
|
+
declare const trending: ReturnType<typeof createRESTModule<typeof publicTrending>>;
|
|
775
53
|
|
|
776
54
|
declare const context_autocomplete: typeof autocomplete;
|
|
777
55
|
declare const context_federatedAutocomplete: typeof federatedAutocomplete;
|
|
@@ -311,13 +311,14 @@ interface SearchResponseNonNullableFields$1 {
|
|
|
311
311
|
};
|
|
312
312
|
}
|
|
313
313
|
interface SearchOptions$1 {
|
|
314
|
-
/**
|
|
315
|
-
|
|
314
|
+
/** Language to search in. */
|
|
315
|
+
language?: string | null;
|
|
316
316
|
}
|
|
317
317
|
|
|
318
318
|
interface HttpClient {
|
|
319
319
|
request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
|
|
320
|
-
fetchWithAuth:
|
|
320
|
+
fetchWithAuth: typeof fetch;
|
|
321
|
+
wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
|
|
321
322
|
}
|
|
322
323
|
type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
|
|
323
324
|
type HttpResponse<T = any> = {
|
|
@@ -349,7 +350,7 @@ declare global {
|
|
|
349
350
|
declare const __metadata$1: {
|
|
350
351
|
PACKAGE_NAME: string;
|
|
351
352
|
};
|
|
352
|
-
declare function search$1(httpClient: HttpClient): (
|
|
353
|
+
declare function search$1(httpClient: HttpClient): (search: Search, documentType: DocumentType, options?: SearchOptions$1) => Promise<SearchResponse$1 & SearchResponseNonNullableFields$1>;
|
|
353
354
|
|
|
354
355
|
type index_d$1_AggregationData = AggregationData;
|
|
355
356
|
type index_d$1_AggregationKindOneOf = AggregationKindOneOf;
|