@wix/search 1.0.11 → 1.0.13

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.
Files changed (61) hide show
  1. package/build/cjs/context.d.ts +1 -1
  2. package/build/cjs/context.js +1 -1
  3. package/build/cjs/context.js.map +1 -1
  4. package/build/cjs/index.d.ts +1 -1
  5. package/build/cjs/index.js +1 -1
  6. package/build/cjs/index.js.map +1 -1
  7. package/build/cjs/meta.d.ts +1 -1
  8. package/build/cjs/meta.js +1 -1
  9. package/build/cjs/meta.js.map +1 -1
  10. package/build/es/context.d.ts +1 -1
  11. package/build/es/context.js +1 -1
  12. package/build/es/context.js.map +1 -1
  13. package/build/es/index.d.ts +1 -1
  14. package/build/es/index.js +1 -1
  15. package/build/es/index.js.map +1 -1
  16. package/build/es/meta.d.ts +1 -1
  17. package/build/es/meta.js +1 -1
  18. package/build/es/meta.js.map +1 -1
  19. package/package.json +11 -9
  20. package/build/cjs/index.typings.d.ts +0 -1
  21. package/build/cjs/index.typings.js +0 -28
  22. package/build/cjs/index.typings.js.map +0 -1
  23. package/build/cjs/src/search-v1-sitedocument.context.d.ts +0 -3
  24. package/build/cjs/src/search-v1-sitedocument.context.js +0 -16
  25. package/build/cjs/src/search-v1-sitedocument.context.js.map +0 -1
  26. package/build/cjs/src/search-v1-sitedocument.http.d.ts +0 -7
  27. package/build/cjs/src/search-v1-sitedocument.http.js +0 -106
  28. package/build/cjs/src/search-v1-sitedocument.http.js.map +0 -1
  29. package/build/cjs/src/search-v1-sitedocument.meta.d.ts +0 -13
  30. package/build/cjs/src/search-v1-sitedocument.meta.js +0 -47
  31. package/build/cjs/src/search-v1-sitedocument.meta.js.map +0 -1
  32. package/build/cjs/src/search-v1-sitedocument.public.d.ts +0 -8
  33. package/build/cjs/src/search-v1-sitedocument.public.js +0 -17
  34. package/build/cjs/src/search-v1-sitedocument.public.js.map +0 -1
  35. package/build/cjs/src/search-v1-sitedocument.types.d.ts +0 -575
  36. package/build/cjs/src/search-v1-sitedocument.types.js +0 -40
  37. package/build/cjs/src/search-v1-sitedocument.types.js.map +0 -1
  38. package/build/cjs/src/search-v1-sitedocument.universal.d.ts +0 -610
  39. package/build/cjs/src/search-v1-sitedocument.universal.js +0 -166
  40. package/build/cjs/src/search-v1-sitedocument.universal.js.map +0 -1
  41. package/build/es/index.typings.d.ts +0 -1
  42. package/build/es/index.typings.js +0 -2
  43. package/build/es/index.typings.js.map +0 -1
  44. package/build/es/src/search-v1-sitedocument.context.d.ts +0 -3
  45. package/build/es/src/search-v1-sitedocument.context.js +0 -12
  46. package/build/es/src/search-v1-sitedocument.context.js.map +0 -1
  47. package/build/es/src/search-v1-sitedocument.http.d.ts +0 -7
  48. package/build/es/src/search-v1-sitedocument.http.js +0 -102
  49. package/build/es/src/search-v1-sitedocument.http.js.map +0 -1
  50. package/build/es/src/search-v1-sitedocument.meta.d.ts +0 -13
  51. package/build/es/src/search-v1-sitedocument.meta.js +0 -20
  52. package/build/es/src/search-v1-sitedocument.meta.js.map +0 -1
  53. package/build/es/src/search-v1-sitedocument.public.d.ts +0 -8
  54. package/build/es/src/search-v1-sitedocument.public.js +0 -9
  55. package/build/es/src/search-v1-sitedocument.public.js.map +0 -1
  56. package/build/es/src/search-v1-sitedocument.types.d.ts +0 -575
  57. package/build/es/src/search-v1-sitedocument.types.js +0 -37
  58. package/build/es/src/search-v1-sitedocument.types.js.map +0 -1
  59. package/build/es/src/search-v1-sitedocument.universal.d.ts +0 -610
  60. package/build/es/src/search-v1-sitedocument.universal.js +0 -139
  61. package/build/es/src/search-v1-sitedocument.universal.js.map +0 -1
@@ -1,610 +0,0 @@
1
- /** API is not yet fully migrated to FQDN entity */
2
- export interface SiteDocument {
3
- /** the document payload */
4
- document?: Record<string, any> | null;
5
- }
6
- export interface UpdateInternalDocumentsEvent extends UpdateInternalDocumentsEventOperationOneOf {
7
- /** insert/update documents */
8
- update?: InternalDocumentUpdateOperation;
9
- /** delete by document ids */
10
- deleteByIds?: DeleteByIdsOperation;
11
- /** delete documents matching filter */
12
- deleteByFilter?: DeleteByFilterOperation;
13
- /** update internal documents matching filter */
14
- updateByFilter?: InternalDocumentUpdateByFilterOperation;
15
- /** update only existing documents */
16
- updateExisting?: InternalUpdateExistingOperation;
17
- /** insert/update documents with versioning */
18
- versionedUpdate?: VersionedDocumentUpdateOperation;
19
- /** delete by document ids with versioning */
20
- versionedDeleteByIds?: VersionedDeleteByIdsOperation;
21
- /** type of the documents */
22
- documentType?: string;
23
- /** language of the documents (mandatory) */
24
- language?: string | null;
25
- /** one or more search documents */
26
- addDocuments?: InternalDocument[];
27
- /** one or more ids of indexed documents to be removed. Removal will happen before addition (if both provided) */
28
- removeDocumentIds?: string[];
29
- /** id to pass to processing notification */
30
- correlationId?: string | null;
31
- }
32
- /** @oneof */
33
- export interface UpdateInternalDocumentsEventOperationOneOf {
34
- /** insert/update documents */
35
- update?: InternalDocumentUpdateOperation;
36
- /** delete by document ids */
37
- deleteByIds?: DeleteByIdsOperation;
38
- /** delete documents matching filter */
39
- deleteByFilter?: DeleteByFilterOperation;
40
- /** update internal documents matching filter */
41
- updateByFilter?: InternalDocumentUpdateByFilterOperation;
42
- /** update only existing documents */
43
- updateExisting?: InternalUpdateExistingOperation;
44
- /** insert/update documents with versioning */
45
- versionedUpdate?: VersionedDocumentUpdateOperation;
46
- /** delete by document ids with versioning */
47
- versionedDeleteByIds?: VersionedDeleteByIdsOperation;
48
- }
49
- export interface InternalDocument {
50
- /** document with mandatory fields (id) and with fields specific to the type of the document */
51
- document?: Record<string, any> | null;
52
- }
53
- export interface InternalDocumentUpdateOperation {
54
- /** documents to index or update */
55
- documents?: InternalDocument[];
56
- }
57
- export interface DeleteByIdsOperation {
58
- /** ids of the documents to delete */
59
- documentIds?: string[];
60
- }
61
- export interface DeleteByFilterOperation {
62
- /** documents matching this filter wil be deleted. only filterable documents defined in document_type can be used for filtering */
63
- filter?: Record<string, any> | null;
64
- }
65
- export interface InternalDocumentUpdateByFilterOperation {
66
- /** documents matching this filter will be updated */
67
- filter?: Record<string, any> | null;
68
- /** partial document to apply */
69
- document?: InternalDocument;
70
- }
71
- export interface InternalUpdateExistingOperation {
72
- /** documents to update */
73
- documents?: InternalDocument[];
74
- }
75
- export interface VersionedDocumentUpdateOperation {
76
- /** documents to create or overwrite */
77
- documents?: InternalDocument[];
78
- /** versioning mode to use instead of default */
79
- versioningMode?: VersioningMode;
80
- }
81
- export declare enum VersioningMode {
82
- /** use default versioning mode agreed with search team */
83
- DEFAULT = "DEFAULT",
84
- /** execute only if version is greater than existing */
85
- GREATER_THAN = "GREATER_THAN",
86
- /** execute only if version is greater or equal to existing */
87
- GREATER_OR_EQUAL = "GREATER_OR_EQUAL"
88
- }
89
- export interface VersionedDeleteByIdsOperation {
90
- /** ids with version of the documents to delete */
91
- documentIds?: VersionedDocumentId[];
92
- }
93
- export interface VersionedDocumentId {
94
- /** document id */
95
- documentId?: string;
96
- /** document version */
97
- version?: string;
98
- /** versioning mode to use instead of default */
99
- versioningMode?: VersioningMode;
100
- }
101
- export interface UpdateDocumentsEvent extends UpdateDocumentsEventOperationOneOf {
102
- /** insert/update documents */
103
- update?: DocumentUpdateOperation;
104
- /** delete by document ids */
105
- deleteByIds?: V1DeleteByIdsOperation;
106
- /** delete documents matching filter */
107
- deleteByFilter?: V1DeleteByFilterOperation;
108
- /** update documents matching filter */
109
- updateByFilter?: UpdateByFilterOperation;
110
- /** update only existing documents */
111
- updateExisting?: UpdateExistingOperation;
112
- /** application which owns documents */
113
- appDefId?: string | null;
114
- /** type of the documents */
115
- documentType?: string | null;
116
- /** language of the documents */
117
- language?: string | null;
118
- /** site documents belong to */
119
- msId?: string | null;
120
- }
121
- /** @oneof */
122
- export interface UpdateDocumentsEventOperationOneOf {
123
- /** insert/update documents */
124
- update?: DocumentUpdateOperation;
125
- /** delete by document ids */
126
- deleteByIds?: V1DeleteByIdsOperation;
127
- /** delete documents matching filter */
128
- deleteByFilter?: V1DeleteByFilterOperation;
129
- /** update documents matching filter */
130
- updateByFilter?: UpdateByFilterOperation;
131
- /** update only existing documents */
132
- updateExisting?: UpdateExistingOperation;
133
- }
134
- export interface DocumentUpdateOperation {
135
- /** documents to index or update */
136
- documents?: IndexDocument[];
137
- }
138
- export interface IndexDocument {
139
- /** data bag with non-searchable fields (url, image) */
140
- payload?: DocumentPayload;
141
- /** what type of users should documents be visible to */
142
- exposure?: Enum;
143
- /** document with mandatory fields (id, title, description) and with fields specific to the type of the document */
144
- document?: Record<string, any> | null;
145
- /** what member groups is the document exposed to. Used only with GROUP_PROTECTED exposure */
146
- permittedMemberGroups?: string[];
147
- /** if true SEO is disabled for this document */
148
- seoHidden?: boolean | null;
149
- /** if true the page is a lightbox popup */
150
- isPopup?: boolean | null;
151
- }
152
- export interface DocumentPayload {
153
- /** url of the page representing the document */
154
- url?: string | null;
155
- /** image which represents the document */
156
- documentImage?: DocumentImage;
157
- }
158
- export interface DocumentImage {
159
- /** the name of the image */
160
- name?: string;
161
- /** the width of the image */
162
- width?: number;
163
- /** the height of the image */
164
- height?: number;
165
- }
166
- export declare enum Enum {
167
- /** Default value. Means that permission not set */
168
- UNKNOWN = "UNKNOWN",
169
- /** Protected exposure. Exposed to members and owners */
170
- PROTECTED = "PROTECTED",
171
- /** Private exposure. Exposed to owners */
172
- PRIVATE = "PRIVATE",
173
- /** Public exposure. Visible to everyone */
174
- PUBLIC = "PUBLIC",
175
- /** Used for partial updates, to state that exposure is not changing */
176
- UNCHANGED = "UNCHANGED",
177
- /** Protected to members of permitted groups and owners */
178
- GROUP_PROTECTED = "GROUP_PROTECTED"
179
- }
180
- export interface V1DeleteByIdsOperation {
181
- /** ids of the documents to delete */
182
- documentIds?: string[];
183
- }
184
- export interface V1DeleteByFilterOperation {
185
- /** documents matching this filter wil be deleted. only filterable documents defined in document_type can be used for filtering */
186
- filter?: Record<string, any> | null;
187
- }
188
- export interface UpdateByFilterOperation {
189
- /** documents matching this filter will be updated */
190
- filter?: Record<string, any> | null;
191
- /** partial document to apply */
192
- document?: IndexDocument;
193
- }
194
- export interface UpdateExistingOperation {
195
- /** documents to update */
196
- documents?: IndexDocument[];
197
- }
198
- export interface Empty {
199
- }
200
- export interface SearchRequest {
201
- /** Text to search for. All searchable fields will be searched. */
202
- query?: string | null;
203
- /** Document type of documents to search for. All document types are searched if not provided. */
204
- documentType?: string | null;
205
- /** Fields to order by. */
206
- ordering?: OrderingClauses;
207
- /** Paging parameters. */
208
- paging?: SearchPaging;
209
- /** Language to search in. */
210
- language?: string | null;
211
- /** Filter in platformized query language (for example {'field': {'$eq': 'value'}}) */
212
- filter?: Record<string, any> | null;
213
- /** The facets to retrieve. */
214
- facets?: FacetClauses;
215
- /** Enable fuzzy search (eg. query 'kalvin clein' will match document with 'calvin klein' in title). */
216
- fuzzy?: boolean | null;
217
- /** Highlight texts matching the query. Highlighted text will be wrapped with <mark/> tag. Defaults to true if not provided. */
218
- highlight?: boolean | null;
219
- /** Searchable fields to search in. If not provided, search is executed on all searchable fields in schema */
220
- searchFields?: string[];
221
- /** A list of fields to include in the result set. If not provided, all fields of schema will be included. */
222
- fields?: string[];
223
- /** The properties/overrides/experiments to enable for this request. Currently supported: `scoring_profile`. */
224
- properties?: SearchProperty[];
225
- /** Include seo hidden documents. Defaults to false if not provided. */
226
- includeSeoHidden?: boolean | null;
227
- }
228
- export interface OrderingClauses {
229
- ordering?: OrderingClause[];
230
- }
231
- export interface OrderingClause {
232
- fieldName?: string | null;
233
- direction?: Direction;
234
- }
235
- export declare enum Direction {
236
- UninitializedDirection = "UninitializedDirection",
237
- ASC = "ASC",
238
- DESC = "DESC"
239
- }
240
- export interface SearchPaging {
241
- /** Number of items to skip in the result set. */
242
- skip?: number;
243
- /** Number of items to fetch (effectively page size). */
244
- limit?: number;
245
- /** Number of items to skip in the result set. */
246
- offset?: number;
247
- }
248
- export interface FacetClauses {
249
- /** Each entry represents a single facet with parameters. */
250
- clauses?: FacetClause[];
251
- }
252
- export interface FacetClause extends FacetClauseClauseOneOf {
253
- term?: TermFacet;
254
- aggregation?: AggregationFacet;
255
- hierarchical?: HierarchicalFacet;
256
- }
257
- /** @oneof */
258
- export interface FacetClauseClauseOneOf {
259
- term?: TermFacet;
260
- aggregation?: AggregationFacet;
261
- hierarchical?: HierarchicalFacet;
262
- }
263
- export declare enum Aggregation {
264
- MIN = "MIN",
265
- MAX = "MAX",
266
- SUM = "SUM"
267
- }
268
- export interface HierarchicalFacet extends HierarchicalFacetClauseOneOf {
269
- term?: TermFacet;
270
- aggregation?: AggregationFacet;
271
- nestedAggregation?: HierarchicalFacet;
272
- }
273
- /** @oneof */
274
- export interface HierarchicalFacetClauseOneOf {
275
- term?: TermFacet;
276
- aggregation?: AggregationFacet;
277
- }
278
- export interface TermFacet {
279
- /** The name of the faceted attribute. */
280
- name?: string;
281
- /** Limit the number of facet values returned. Default is 10. */
282
- limit?: number | null;
283
- }
284
- export interface AggregationFacet {
285
- /** The name of the faceted attribute. */
286
- name?: string;
287
- /** Aggregation type. */
288
- aggregation?: Aggregation;
289
- }
290
- export interface SearchProperty {
291
- name?: string;
292
- value?: any;
293
- }
294
- export interface SearchResponse {
295
- /** Documents matching filter and query. */
296
- documents?: Record<string, any>[] | null;
297
- nextPage?: NextPageResponse;
298
- /**
299
- * Facets provide "counts in categories" view. For example searching for "Nike" would return
300
- * (Shoes, 5), (Socks, 2) indicating numbers for matching by each faceted field.
301
- */
302
- facets?: FacetsResponse[];
303
- }
304
- export interface NextPageResponse {
305
- /** Total number of items across all pages */
306
- total?: number;
307
- /** The number of items to skip */
308
- skip?: number;
309
- /** The number of items to retrieve in one page */
310
- limit?: number;
311
- }
312
- export interface FacetsResponse extends FacetsResponseResponseOneOf {
313
- terms?: TermAggregationResponse;
314
- minAggregation?: MinAggregationResponse;
315
- maxAggregation?: MaxAggregationResponse;
316
- minMaxAggregation?: MinMaxAggregationResponse;
317
- hierarchicalAggregation?: HierarchicalAggregationResponse;
318
- sumAggregation?: SumAggregationResponse;
319
- }
320
- /** @oneof */
321
- export interface FacetsResponseResponseOneOf {
322
- terms?: TermAggregationResponse;
323
- minAggregation?: MinAggregationResponse;
324
- maxAggregation?: MaxAggregationResponse;
325
- minMaxAggregation?: MinMaxAggregationResponse;
326
- hierarchicalAggregation?: HierarchicalAggregationResponse;
327
- sumAggregation?: SumAggregationResponse;
328
- }
329
- export interface FacetCountResponse {
330
- /** Facet field value (for example "Shoes", "Socks") */
331
- facetValue?: string;
332
- /** Document count within the group */
333
- count?: number;
334
- }
335
- export interface Value {
336
- value?: string;
337
- facets?: FacetsResponse;
338
- }
339
- export interface TermAggregationResponse {
340
- /** Facet field (for example productCategory) */
341
- facet?: string;
342
- /** Facet values and document counts */
343
- facets?: FacetCountResponse[];
344
- }
345
- export interface MinAggregationResponse {
346
- /** Facet field (for example productPrice) */
347
- facet?: string;
348
- /** The minimum value across all documents */
349
- minValue?: number | null;
350
- }
351
- export interface MaxAggregationResponse {
352
- /** Facet field (for example productPrice) */
353
- facet?: string;
354
- /** The maximum value across all documents */
355
- maxValue?: number | null;
356
- }
357
- export interface MinMaxAggregationResponse {
358
- /** Facet field (for example productPrice) */
359
- facet?: string;
360
- /** The minimum value across all documents */
361
- minValue?: number | null;
362
- /** The maximum value across all documents */
363
- maxValue?: number | null;
364
- }
365
- export interface HierarchicalAggregationResponse {
366
- facet?: string;
367
- values?: Value[];
368
- }
369
- export interface SumAggregationResponse {
370
- /** Facet field (for example productPrice) */
371
- facet?: string;
372
- /** The sum value across all documents */
373
- value?: number | null;
374
- }
375
- export interface FederatedSearchRequest {
376
- /** Query phrase to use. */
377
- query?: string | null;
378
- /** Language to search in. */
379
- language?: string | null;
380
- /** Limit of documents to return per document type. */
381
- limit?: number | null;
382
- /** Enable fuzzy search (for example query 'kalvin clein' will match document with 'calvin klein' in title). */
383
- fuzzy?: boolean | null;
384
- /** Highlight texts matching the query. Highlighted text will be wrapped with <mark/> tag. Defaults to true if not provided. */
385
- highlight?: boolean | null;
386
- /** Searchable fields to search in. If not provided, search is executed on all searchable fields in schemas */
387
- searchFields?: string[];
388
- /** Document types to search in. If not provided, search is executed on all document types enabled for the site */
389
- documentTypes?: string[];
390
- /** Include seo hidden documents. Defaults to false if not provided. */
391
- includeSeoHidden?: boolean | null;
392
- }
393
- export interface FederatedSearchResponse {
394
- /** Search results from multiple indexes. */
395
- results?: FederatedSearchDocuments[];
396
- }
397
- export interface FederatedSearchDocuments {
398
- /** Document type of documents */
399
- documentType?: string | null;
400
- /** Documents of document type */
401
- documents?: Record<string, any>[] | null;
402
- /** Total count of matching documents for document type */
403
- total?: number;
404
- }
405
- export interface SuggestRequest {
406
- /** Text to search for. Fields configured in suggester configuration will be searched. */
407
- query?: string | null;
408
- /** Document type of documents to search for. All document types are searched if not provided. */
409
- documentType?: string | null;
410
- /** Fields to order by. */
411
- ordering?: OrderingClauses;
412
- /** Number of suggested document to return. */
413
- limit?: number;
414
- /** Language to search in. */
415
- language?: string | null;
416
- /** Filter in platformized query language (for example {'field': {'$eq': 'value'}}) */
417
- filter?: Record<string, any> | null;
418
- /** Searchable fields to search in. If not provided, search is executed on all suggestable fields in schema */
419
- searchFields?: string[];
420
- /** A list of fields to include in the result set. If not provided, all fields of schema will be included. */
421
- fields?: string[];
422
- /** Include seo hidden documents. Defaults to false if not provided. */
423
- includeSeoHidden?: boolean | null;
424
- /** The properties/overrides/experiments to enable for this request. Currently supported: `scoring_profile`. */
425
- properties?: SearchProperty[];
426
- }
427
- export interface SuggestResponse {
428
- /** Suggested documents. */
429
- documents?: Record<string, any>[] | null;
430
- }
431
- export interface FederatedSuggestRequest {
432
- /** Text to search for. Fields configured in suggester configuration will be searched. */
433
- query?: string | null;
434
- /** Language to search in. */
435
- language?: string | null;
436
- /** Number of suggested document to return per document type. */
437
- limit?: number;
438
- /** Searchable fields to search in. If not provided, search is executed on all suggestable fields in schemas */
439
- searchFields?: string[];
440
- /** Document types to search in. If not provided, search is executed on all document types enabled for the site */
441
- documentTypes?: string[];
442
- /** Include seo hidden documents. Defaults to false if not provided. */
443
- includeSeoHidden?: boolean | null;
444
- }
445
- export interface FederatedSuggestResponse {
446
- /** Suggest results from multiple indexes. */
447
- results?: FederatedSuggestDocuments[];
448
- }
449
- export interface FederatedSuggestDocuments {
450
- /** Document type of documents */
451
- documentType?: string | null;
452
- /** Documents of document type */
453
- documents?: Record<string, any>[] | null;
454
- }
455
- export interface RelatedRequest {
456
- /** ID of the document to fetch related documents for. */
457
- documentId?: string | null;
458
- /** Document type of the document. */
459
- documentType?: string | null;
460
- /** Fields to order by. */
461
- ordering?: OrderingClauses;
462
- /** Language to search in. */
463
- language?: string | null;
464
- /** Filter in platformized query language (for example {'field': {'$eq': 'value'}}). */
465
- filter?: Record<string, any> | null;
466
- /** Searchable fields to compare documents by. If not provided, all searchable fields in schema are used */
467
- searchFields?: string[];
468
- /** A list of fields to include in the result set. If not provided, all fields of schema will be included. */
469
- fields?: string[];
470
- /** Number of related documents to return */
471
- limit?: number;
472
- /** The properties/overrides/experiments to enable for this request. Currently supported: `scoring_profile`. */
473
- properties?: SearchProperty[];
474
- /** Include seo hidden documents. Defaults to false if not provided. */
475
- includeSeoHidden?: boolean | null;
476
- }
477
- export interface RelatedResponse {
478
- /** Documents matching filter and query. */
479
- documents?: Record<string, any>[] | null;
480
- }
481
- export interface AutocompleteRequest {
482
- /** Query phrase to fetch completions for. */
483
- query?: string | null;
484
- /** Document type to use to search for phrases. */
485
- documentType?: string | null;
486
- /** Limit of phrases to fetch. */
487
- limit?: number;
488
- /** Language to search in. */
489
- language?: string | null;
490
- /** Filter in platfromized query language (for example {'field': {'$eq': 'value'}}) */
491
- filter?: Record<string, any> | null;
492
- /** Searchable fields to use for query completion. If not provided, all searchable fields in schema are used */
493
- searchFields?: string[];
494
- /** Include seo hidden documents. Defaults to false if not provided. */
495
- includeSeoHidden?: boolean | null;
496
- }
497
- export interface AutocompleteResponse {
498
- /** Suggested phrases. */
499
- values?: AutocompleteResponseValue[];
500
- }
501
- export interface AutocompleteResponseValue {
502
- /** Suggested phrase. */
503
- query?: string;
504
- }
505
- export interface FederatedAutocompleteRequest {
506
- /** Query phrase to fetch completions for. */
507
- query?: string | null;
508
- /** Language to search in. */
509
- language?: string | null;
510
- /** Number of queries to return per document type. */
511
- limit?: number;
512
- /** Searchable fields to search in. If not provided, search is executed on all autocompletable fields in schemas */
513
- searchFields?: string[];
514
- /** Document types to autocomplete in. If not provided, autocomplete is executed on all document types enabled for the site */
515
- documentTypes?: string[];
516
- /** Include seo hidden documents. Defaults to false if not provided. */
517
- includeSeoHidden?: boolean | null;
518
- }
519
- export interface FederatedAutocompleteResponse {
520
- /** Suggested phrases from multiple indexes */
521
- results?: FederatedAutocompleteResults[];
522
- }
523
- export interface FederatedAutocompleteResults {
524
- /** Document type of queries */
525
- documentType?: string | null;
526
- /** Suggested phrases */
527
- values?: AutocompleteResponseValue[];
528
- }
529
- export interface TrendingRequest {
530
- documentTypes?: string[];
531
- language?: string | null;
532
- /** Include seo hidden documents. Defaults to false if not provided. */
533
- includeSeoHidden?: boolean | null;
534
- }
535
- export interface TrendingResponse {
536
- results?: TrendingItems[];
537
- }
538
- export interface TrendingItems {
539
- documentType?: string;
540
- documents?: Record<string, any>[] | null;
541
- }
542
- export interface SearchResponseNonNullableFields {
543
- nextPage?: {
544
- total: number;
545
- skip: number;
546
- limit: number;
547
- };
548
- facets: {
549
- terms?: {
550
- facet: string;
551
- facets: {
552
- facetValue: string;
553
- count: number;
554
- }[];
555
- };
556
- minAggregation?: {
557
- facet: string;
558
- };
559
- maxAggregation?: {
560
- facet: string;
561
- };
562
- minMaxAggregation?: {
563
- facet: string;
564
- };
565
- hierarchicalAggregation?: {
566
- facet: string;
567
- values: {
568
- value: string;
569
- }[];
570
- };
571
- sumAggregation?: {
572
- facet: string;
573
- };
574
- }[];
575
- }
576
- /**
577
- * Executes a regular search query.
578
- * If you are unsure, this is likely the search method you want to used.
579
- * @public
580
- * @documentationMaturity preview
581
- */
582
- export declare function search(options?: SearchOptions): Promise<SearchResponse & SearchResponseNonNullableFields>;
583
- export interface SearchOptions {
584
- /** Text to search for. All searchable fields will be searched. */
585
- query?: string | null;
586
- /** Document type of documents to search for. All document types are searched if not provided. */
587
- documentType?: string | null;
588
- /** Fields to order by. */
589
- ordering?: OrderingClauses;
590
- /** Paging parameters. */
591
- paging?: SearchPaging;
592
- /** Language to search in. */
593
- language?: string | null;
594
- /** Filter in platformized query language (for example {'field': {'$eq': 'value'}}) */
595
- filter?: Record<string, any> | null;
596
- /** The facets to retrieve. */
597
- facets?: FacetClauses;
598
- /** Enable fuzzy search (eg. query 'kalvin clein' will match document with 'calvin klein' in title). */
599
- fuzzy?: boolean | null;
600
- /** Highlight texts matching the query. Highlighted text will be wrapped with <mark/> tag. Defaults to true if not provided. */
601
- highlight?: boolean | null;
602
- /** Searchable fields to search in. If not provided, search is executed on all searchable fields in schema */
603
- searchFields?: string[];
604
- /** A list of fields to include in the result set. If not provided, all fields of schema will be included. */
605
- fields?: string[];
606
- /** The properties/overrides/experiments to enable for this request. Currently supported: `scoring_profile`. */
607
- properties?: SearchProperty[];
608
- /** Include seo hidden documents. Defaults to false if not provided. */
609
- includeSeoHidden?: boolean | null;
610
- }