@wix/search 1.0.23 → 1.0.25
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 +310 -58
- package/type-bundles/index.bundle.d.ts +262 -60
- package/type-bundles/meta.bundle.d.ts +573 -109
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/search",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.25",
|
|
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.4"
|
|
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": "469ebc4218260f95acc4f48c4ae5a57a5c02452aa071e276ae639f4a"
|
|
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
|
|
|
@@ -460,6 +499,61 @@ interface SumAggregationResponse {
|
|
|
460
499
|
/** The sum value across all documents */
|
|
461
500
|
value?: number | null;
|
|
462
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
|
+
}
|
|
463
557
|
interface SearchResponseNonNullableFields {
|
|
464
558
|
nextPage?: {
|
|
465
559
|
total: number;
|
|
@@ -495,6 +589,31 @@ interface SearchResponseNonNullableFields {
|
|
|
495
589
|
};
|
|
496
590
|
}[];
|
|
497
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
|
+
}
|
|
498
617
|
interface SearchOptions {
|
|
499
618
|
/** Text to search for. All searchable fields will be searched. */
|
|
500
619
|
query?: string | null;
|
|
@@ -523,14 +642,147 @@ interface SearchOptions {
|
|
|
523
642
|
/** Include seo hidden documents. Defaults to false if not provided. */
|
|
524
643
|
includeSeoHidden?: boolean | null;
|
|
525
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;
|
|
756
|
+
}
|
|
526
757
|
|
|
527
758
|
declare function search$1(httpClient: HttpClient): (options?: SearchOptions) => Promise<SearchResponse & SearchResponseNonNullableFields>;
|
|
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>;
|
|
528
766
|
|
|
529
767
|
declare const search: BuildRESTFunction<typeof search$1>;
|
|
768
|
+
declare const federatedSearch: BuildRESTFunction<typeof federatedSearch$1>;
|
|
769
|
+
declare const suggest: BuildRESTFunction<typeof suggest$1>;
|
|
770
|
+
declare const federatedSuggest: BuildRESTFunction<typeof federatedSuggest$1>;
|
|
771
|
+
declare const related: BuildRESTFunction<typeof related$1>;
|
|
772
|
+
declare const autocomplete: BuildRESTFunction<typeof autocomplete$1>;
|
|
773
|
+
declare const federatedAutocomplete: BuildRESTFunction<typeof federatedAutocomplete$1>;
|
|
774
|
+
declare const trending: BuildRESTFunction<typeof trending$1>;
|
|
530
775
|
|
|
776
|
+
declare const context_autocomplete: typeof autocomplete;
|
|
777
|
+
declare const context_federatedAutocomplete: typeof federatedAutocomplete;
|
|
778
|
+
declare const context_federatedSearch: typeof federatedSearch;
|
|
779
|
+
declare const context_federatedSuggest: typeof federatedSuggest;
|
|
780
|
+
declare const context_related: typeof related;
|
|
531
781
|
declare const context_search: typeof search;
|
|
782
|
+
declare const context_suggest: typeof suggest;
|
|
783
|
+
declare const context_trending: typeof trending;
|
|
532
784
|
declare namespace context {
|
|
533
|
-
export { context_search as search };
|
|
785
|
+
export { context_autocomplete as autocomplete, context_federatedAutocomplete as federatedAutocomplete, context_federatedSearch as federatedSearch, context_federatedSuggest as federatedSuggest, context_related as related, context_search as search, context_suggest as suggest, context_trending as trending };
|
|
534
786
|
}
|
|
535
787
|
|
|
536
788
|
export { context as siteSearch, context$1 as wixSiteSearch };
|