@wix/search 1.0.22 → 1.0.24

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