/
index.ts
921 lines (864 loc) · 49.7 KB
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
import * as coreClient from "@azure/core-client";
/** Describes an error condition for the Azure Cognitive Search API. */
export interface SearchError {
/**
* One of a server-defined set of error codes.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly code?: string;
/**
* A human-readable representation of the error.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly message: string;
/**
* An array of details about specific errors that led to this reported error.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly details?: SearchError[];
}
/** Response containing search results from an index. */
export interface SearchDocumentsResult {
/**
* The total count of results found by the search operation, or null if the count was not requested. If present, the count may be greater than the number of results in this response. This can happen if you use the $top or $skip parameters, or if Azure Cognitive Search can't return all the requested documents in a single Search response.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly count?: number;
/**
* A value indicating the percentage of the index that was included in the query, or null if minimumCoverage was not specified in the request.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly coverage?: number;
/**
* The facet query results for the search operation, organized as a collection of buckets for each faceted field; null if the query did not include any facet expressions.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly facets?: { [propertyName: string]: FacetResult[] };
/**
* The answers query results for the search operation; null if the answers query parameter was not specified or set to 'none'.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly answers?: AnswerResult[];
/**
* Continuation JSON payload returned when Azure Cognitive Search can't return all the requested results in a single Search response. You can use this JSON along with @odata.nextLink to formulate another POST Search request to get the next part of the search response.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly nextPageParameters?: SearchRequest;
/**
* The sequence of results returned by the query.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly results: SearchResult[];
/**
* Continuation URL returned when Azure Cognitive Search can't return all the requested results in a single Search response. You can use this URL to formulate another GET or POST Search request to get the next part of the search response. Make sure to use the same verb (GET or POST) as the request that produced this response.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly nextLink?: string;
}
/** A single bucket of a facet query result. Reports the number of documents with a field value falling within a particular range or having a particular value or interval. */
export interface FacetResult {
/** Describes unknown properties. The value of an unknown property can be of "any" type. */
[property: string]: any;
/**
* The approximate count of documents falling within the bucket described by this facet.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly count?: number;
}
/** An answer is a text passage extracted from the contents of the most relevant documents that matched the query. Answers are extracted from the top search results. Answer candidates are scored and the top answers are selected. */
export interface AnswerResult {
/** Describes unknown properties. The value of an unknown property can be of "any" type. */
[property: string]: any;
/**
* The score value represents how relevant the answer is to the query relative to other answers returned for the query.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly score: number;
/**
* The key of the document the answer was extracted from.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly key: string;
/**
* The text passage extracted from the document contents as the answer.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly text: string;
/**
* Same text passage as in the Text property with highlighted text phrases most relevant to the query.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly highlights?: string;
}
/** Parameters for filtering, sorting, faceting, paging, and other search query behaviors. */
export interface SearchRequest {
/** A value that specifies whether to fetch the total count of results. Default is false. Setting this value to true may have a performance impact. Note that the count returned is an approximation. */
includeTotalResultCount?: boolean;
/** The list of facet expressions to apply to the search query. Each facet expression contains a field name, optionally followed by a comma-separated list of name:value pairs. */
facets?: string[];
/** The OData $filter expression to apply to the search query. */
filter?: string;
/** The comma-separated list of field names to use for hit highlights. Only searchable fields can be used for hit highlighting. */
highlightFields?: string;
/** A string tag that is appended to hit highlights. Must be set with highlightPreTag. Default is </em>. */
highlightPostTag?: string;
/** A string tag that is prepended to hit highlights. Must be set with highlightPostTag. Default is <em>. */
highlightPreTag?: string;
/** A number between 0 and 100 indicating the percentage of the index that must be covered by a search query in order for the query to be reported as a success. This parameter can be useful for ensuring search availability even for services with only one replica. The default is 100. */
minimumCoverage?: number;
/** The comma-separated list of OData $orderby expressions by which to sort the results. Each expression can be either a field name or a call to either the geo.distance() or the search.score() functions. Each expression can be followed by asc to indicate ascending, or desc to indicate descending. The default is ascending order. Ties will be broken by the match scores of documents. If no $orderby is specified, the default sort order is descending by document match score. There can be at most 32 $orderby clauses. */
orderBy?: string;
/** A value that specifies the syntax of the search query. The default is 'simple'. Use 'full' if your query uses the Lucene query syntax. */
queryType?: QueryType;
/** A value that specifies whether we want to calculate scoring statistics (such as document frequency) globally for more consistent scoring, or locally, for lower latency. The default is 'local'. Use 'global' to aggregate scoring statistics globally before scoring. Using global scoring statistics can increase latency of search queries. */
scoringStatistics?: ScoringStatistics;
/** A value to be used to create a sticky session, which can help getting more consistent results. As long as the same sessionId is used, a best-effort attempt will be made to target the same replica set. Be wary that reusing the same sessionID values repeatedly can interfere with the load balancing of the requests across replicas and adversely affect the performance of the search service. The value used as sessionId cannot start with a '_' character. */
sessionId?: string;
/** The list of parameter values to be used in scoring functions (for example, referencePointParameter) using the format name-values. For example, if the scoring profile defines a function with a parameter called 'mylocation' the parameter string would be "mylocation--122.2,44.8" (without the quotes). */
scoringParameters?: string[];
/** The name of a scoring profile to evaluate match scores for matching documents in order to sort the results. */
scoringProfile?: string;
/** The name of a semantic configuration that will be used when processing documents for queries of type semantic. */
semanticConfiguration?: string;
/** A full-text search query expression; Use "*" or omit this parameter to match all documents. */
searchText?: string;
/** The comma-separated list of field names to which to scope the full-text search. When using fielded search (fieldName:searchExpression) in a full Lucene query, the field names of each fielded search expression take precedence over any field names listed in this parameter. */
searchFields?: string;
/** A value that specifies whether any or all of the search terms must be matched in order to count the document as a match. */
searchMode?: SearchMode;
/** A value that specifies the language of the search query. */
queryLanguage?: QueryLanguage;
/** A value that specified the type of the speller to use to spell-correct individual search query terms. */
speller?: QuerySpellerType;
/** A value that specifies whether answers should be returned as part of the search response. */
answers?: QueryAnswerType;
/** The comma-separated list of fields to retrieve. If unspecified, all fields marked as retrievable in the schema are included. */
select?: string;
/** The number of search results to skip. This value cannot be greater than 100,000. If you need to scan documents in sequence, but cannot use skip due to this limitation, consider using orderby on a totally-ordered key and filter with a range query instead. */
skip?: number;
/** The number of search results to retrieve. This can be used in conjunction with $skip to implement client-side paging of search results. If results are truncated due to server-side paging, the response will include a continuation token that can be used to issue another Search request for the next page of results. */
top?: number;
/** A value that specifies whether captions should be returned as part of the search response. */
captions?: QueryCaptionType;
/** The comma-separated list of field names used for semantic search. */
semanticFields?: string;
}
/** Contains a document found by a search query, plus associated metadata. */
export interface SearchResult {
/** Describes unknown properties. The value of an unknown property can be of "any" type. */
[property: string]: any;
/**
* The relevance score of the document compared to other documents returned by the query.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly _score: number;
/**
* The relevance score computed by the semantic ranker for the top search results. Search results are sorted by the RerankerScore first and then by the Score. RerankerScore is only returned for queries of type 'semantic'.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly rerankerScore?: number;
/**
* Text fragments from the document that indicate the matching search terms, organized by each applicable field; null if hit highlighting was not enabled for the query.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly _highlights?: { [propertyName: string]: string[] };
/**
* Captions are the most representative passages from the document relatively to the search query. They are often used as document summary. Captions are only returned for queries of type 'semantic'.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly captions?: CaptionResult[];
}
/** Captions are the most representative passages from the document relatively to the search query. They are often used as document summary. Captions are only returned for queries of type 'semantic'.. */
export interface CaptionResult {
/** Describes unknown properties. The value of an unknown property can be of "any" type. */
[property: string]: any;
/**
* A representative text passage extracted from the document most relevant to the search query.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly text?: string;
/**
* Same text passage as in the Text property with highlighted phrases most relevant to the query.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly highlights?: string;
}
/** Response containing suggestion query results from an index. */
export interface SuggestDocumentsResult {
/**
* The sequence of results returned by the query.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly results: SuggestResult[];
/**
* A value indicating the percentage of the index that was included in the query, or null if minimumCoverage was not set in the request.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly coverage?: number;
}
/** A result containing a document found by a suggestion query, plus associated metadata. */
export interface SuggestResult {
/** Describes unknown properties. The value of an unknown property can be of "any" type. */
[property: string]: any;
/**
* The text of the suggestion result.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly _text: string;
}
/** Parameters for filtering, sorting, fuzzy matching, and other suggestions query behaviors. */
export interface SuggestRequest {
/** An OData expression that filters the documents considered for suggestions. */
filter?: string;
/** A value indicating whether to use fuzzy matching for the suggestion query. Default is false. When set to true, the query will find suggestions even if there's a substituted or missing character in the search text. While this provides a better experience in some scenarios, it comes at a performance cost as fuzzy suggestion searches are slower and consume more resources. */
useFuzzyMatching?: boolean;
/** A string tag that is appended to hit highlights. Must be set with highlightPreTag. If omitted, hit highlighting of suggestions is disabled. */
highlightPostTag?: string;
/** A string tag that is prepended to hit highlights. Must be set with highlightPostTag. If omitted, hit highlighting of suggestions is disabled. */
highlightPreTag?: string;
/** A number between 0 and 100 indicating the percentage of the index that must be covered by a suggestion query in order for the query to be reported as a success. This parameter can be useful for ensuring search availability even for services with only one replica. The default is 80. */
minimumCoverage?: number;
/** The comma-separated list of OData $orderby expressions by which to sort the results. Each expression can be either a field name or a call to either the geo.distance() or the search.score() functions. Each expression can be followed by asc to indicate ascending, or desc to indicate descending. The default is ascending order. Ties will be broken by the match scores of documents. If no $orderby is specified, the default sort order is descending by document match score. There can be at most 32 $orderby clauses. */
orderBy?: string;
/** The search text to use to suggest documents. Must be at least 1 character, and no more than 100 characters. */
searchText: string;
/** The comma-separated list of field names to search for the specified search text. Target fields must be included in the specified suggester. */
searchFields?: string;
/** The comma-separated list of fields to retrieve. If unspecified, only the key field will be included in the results. */
select?: string;
/** The name of the suggester as specified in the suggesters collection that's part of the index definition. */
suggesterName: string;
/** The number of suggestions to retrieve. This must be a value between 1 and 100. The default is 5. */
top?: number;
}
/** Contains a batch of document write actions to send to the index. */
export interface IndexBatch {
/** The actions in the batch. */
actions: IndexAction[];
}
/** Represents an index action that operates on a document. */
export interface IndexAction {
/** Describes unknown properties. The value of an unknown property can be of "any" type. */
[property: string]: any;
/** The operation to perform on a document in an indexing batch. */
__actionType: IndexActionType;
}
/** Response containing the status of operations for all documents in the indexing request. */
export interface IndexDocumentsResult {
/**
* The list of status information for each document in the indexing request.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly results: IndexingResult[];
}
/** Status of an indexing operation for a single document. */
export interface IndexingResult {
/**
* The key of a document that was in the indexing request.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly key: string;
/**
* The error message explaining why the indexing operation failed for the document identified by the key; null if indexing succeeded.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly errorMessage?: string;
/**
* A value indicating whether the indexing operation succeeded for the document identified by the key.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly succeeded: boolean;
/**
* The status code of the indexing operation. Possible values include: 200 for a successful update or delete, 201 for successful document creation, 400 for a malformed input document, 404 for document not found, 409 for a version conflict, 422 when the index is temporarily unavailable, or 503 for when the service is too busy.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly statusCode: number;
}
/** The result of Autocomplete query. */
export interface AutocompleteResult {
/**
* A value indicating the percentage of the index that was considered by the autocomplete request, or null if minimumCoverage was not specified in the request.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly coverage?: number;
/**
* The list of returned Autocompleted items.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly results: AutocompleteItem[];
}
/** The result of Autocomplete requests. */
export interface AutocompleteItem {
/**
* The completed term.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly text: string;
/**
* The query along with the completed term.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly queryPlusText: string;
}
/** Parameters for fuzzy matching, and other autocomplete query behaviors. */
export interface AutocompleteRequest {
/** The search text on which to base autocomplete results. */
searchText: string;
/** Specifies the mode for Autocomplete. The default is 'oneTerm'. Use 'twoTerms' to get shingles and 'oneTermWithContext' to use the current context while producing auto-completed terms. */
autocompleteMode?: AutocompleteMode;
/** An OData expression that filters the documents used to produce completed terms for the Autocomplete result. */
filter?: string;
/** A value indicating whether to use fuzzy matching for the autocomplete query. Default is false. When set to true, the query will autocomplete terms even if there's a substituted or missing character in the search text. While this provides a better experience in some scenarios, it comes at a performance cost as fuzzy autocomplete queries are slower and consume more resources. */
useFuzzyMatching?: boolean;
/** A string tag that is appended to hit highlights. Must be set with highlightPreTag. If omitted, hit highlighting is disabled. */
highlightPostTag?: string;
/** A string tag that is prepended to hit highlights. Must be set with highlightPostTag. If omitted, hit highlighting is disabled. */
highlightPreTag?: string;
/** A number between 0 and 100 indicating the percentage of the index that must be covered by an autocomplete query in order for the query to be reported as a success. This parameter can be useful for ensuring search availability even for services with only one replica. The default is 80. */
minimumCoverage?: number;
/** The comma-separated list of field names to consider when querying for auto-completed terms. Target fields must be included in the specified suggester. */
searchFields?: string;
/** The name of the suggester as specified in the suggesters collection that's part of the index definition. */
suggesterName: string;
/** The number of auto-completed terms to retrieve. This must be a value between 1 and 100. The default is 5. */
top?: number;
}
/** Parameter group */
export interface RequestOptions {
/** The tracking ID sent with the request to help with debugging. */
xMsClientRequestId?: string;
}
/** Parameter group */
export interface SearchOptions {
/** A value that specifies whether to fetch the total count of results. Default is false. Setting this value to true may have a performance impact. Note that the count returned is an approximation. */
includeTotalResultCount?: boolean;
/** The list of facet expressions to apply to the search query. Each facet expression contains a field name, optionally followed by a comma-separated list of name:value pairs. */
facets?: string[];
/** The OData $filter expression to apply to the search query. */
filter?: string;
/** The list of field names to use for hit highlights. Only searchable fields can be used for hit highlighting. */
highlightFields?: string[];
/** A string tag that is appended to hit highlights. Must be set with highlightPreTag. Default is </em>. */
highlightPostTag?: string;
/** A string tag that is prepended to hit highlights. Must be set with highlightPostTag. Default is <em>. */
highlightPreTag?: string;
/** A number between 0 and 100 indicating the percentage of the index that must be covered by a search query in order for the query to be reported as a success. This parameter can be useful for ensuring search availability even for services with only one replica. The default is 100. */
minimumCoverage?: number;
/** The list of OData $orderby expressions by which to sort the results. Each expression can be either a field name or a call to either the geo.distance() or the search.score() functions. Each expression can be followed by asc to indicate ascending, and desc to indicate descending. The default is ascending order. Ties will be broken by the match scores of documents. If no OrderBy is specified, the default sort order is descending by document match score. There can be at most 32 $orderby clauses. */
orderBy?: string[];
/** A value that specifies the syntax of the search query. The default is 'simple'. Use 'full' if your query uses the Lucene query syntax. */
queryType?: QueryType;
/** The list of parameter values to be used in scoring functions (for example, referencePointParameter) using the format name-values. For example, if the scoring profile defines a function with a parameter called 'mylocation' the parameter string would be "mylocation--122.2,44.8" (without the quotes). */
scoringParameters?: string[];
/** The name of a scoring profile to evaluate match scores for matching documents in order to sort the results. */
scoringProfile?: string;
/** The name of the semantic configuration that lists which fields should be used for semantic ranking, captions, highlights, and answers */
semanticConfiguration?: string;
/** The list of field names to which to scope the full-text search. When using fielded search (fieldName:searchExpression) in a full Lucene query, the field names of each fielded search expression take precedence over any field names listed in this parameter. */
searchFields?: string[];
/** The language of the query. */
queryLanguage?: QueryLanguage;
/** Improve search recall by spell-correcting individual search query terms. */
speller?: Speller;
/** This parameter is only valid if the query type is 'semantic'. If set, the query returns answers extracted from key passages in the highest ranked documents. The number of answers returned can be configured by appending the pipe character '|' followed by the 'count-<number of answers>' option after the answers parameter value, such as 'extractive|count-3'. Default count is 1. */
answers?: Answers;
/** A value that specifies whether any or all of the search terms must be matched in order to count the document as a match. */
searchMode?: SearchMode;
/** A value that specifies whether we want to calculate scoring statistics (such as document frequency) globally for more consistent scoring, or locally, for lower latency. */
scoringStatistics?: ScoringStatistics;
/** A value to be used to create a sticky session, which can help to get more consistent results. As long as the same sessionId is used, a best-effort attempt will be made to target the same replica set. Be wary that reusing the same sessionID values repeatedly can interfere with the load balancing of the requests across replicas and adversely affect the performance of the search service. The value used as sessionId cannot start with a '_' character. */
sessionId?: string;
/** The list of fields to retrieve. If unspecified, all fields marked as retrievable in the schema are included. */
select?: string[];
/** The number of search results to skip. This value cannot be greater than 100,000. If you need to scan documents in sequence, but cannot use $skip due to this limitation, consider using $orderby on a totally-ordered key and $filter with a range query instead. */
skip?: number;
/** The number of search results to retrieve. This can be used in conjunction with $skip to implement client-side paging of search results. If results are truncated due to server-side paging, the response will include a continuation token that can be used to issue another Search request for the next page of results. */
top?: number;
/** This parameter is only valid if the query type is 'semantic'. If set, the query returns captions extracted from key passages in the highest ranked documents. When Captions is set to 'extractive', highlighting is enabled by default, and can be configured by appending the pipe character '|' followed by the 'highlight-<true/false>' option, such as 'extractive|highlight-true'. Defaults to 'None'. */
captions?: Captions;
/** The list of field names used for semantic search. */
semanticFields?: string[];
}
/** Parameter group */
export interface SuggestOptions {
/** An OData expression that filters the documents considered for suggestions. */
filter?: string;
/** A value indicating whether to use fuzzy matching for the suggestions query. Default is false. When set to true, the query will find terms even if there's a substituted or missing character in the search text. While this provides a better experience in some scenarios, it comes at a performance cost as fuzzy suggestions queries are slower and consume more resources. */
useFuzzyMatching?: boolean;
/** A string tag that is appended to hit highlights. Must be set with highlightPreTag. If omitted, hit highlighting of suggestions is disabled. */
highlightPostTag?: string;
/** A string tag that is prepended to hit highlights. Must be set with highlightPostTag. If omitted, hit highlighting of suggestions is disabled. */
highlightPreTag?: string;
/** A number between 0 and 100 indicating the percentage of the index that must be covered by a suggestions query in order for the query to be reported as a success. This parameter can be useful for ensuring search availability even for services with only one replica. The default is 80. */
minimumCoverage?: number;
/** The list of OData $orderby expressions by which to sort the results. Each expression can be either a field name or a call to either the geo.distance() or the search.score() functions. Each expression can be followed by asc to indicate ascending, or desc to indicate descending. The default is ascending order. Ties will be broken by the match scores of documents. If no $orderby is specified, the default sort order is descending by document match score. There can be at most 32 $orderby clauses. */
orderBy?: string[];
/** The list of field names to search for the specified search text. Target fields must be included in the specified suggester. */
searchFields?: string[];
/** The list of fields to retrieve. If unspecified, only the key field will be included in the results. */
select?: string[];
/** The number of suggestions to retrieve. The value must be a number between 1 and 100. The default is 5. */
top?: number;
}
/** Parameter group */
export interface AutocompleteOptions {
/** Specifies the mode for Autocomplete. The default is 'oneTerm'. Use 'twoTerms' to get shingles and 'oneTermWithContext' to use the current context while producing auto-completed terms. */
autocompleteMode?: AutocompleteMode;
/** An OData expression that filters the documents used to produce completed terms for the Autocomplete result. */
filter?: string;
/** A value indicating whether to use fuzzy matching for the autocomplete query. Default is false. When set to true, the query will find terms even if there's a substituted or missing character in the search text. While this provides a better experience in some scenarios, it comes at a performance cost as fuzzy autocomplete queries are slower and consume more resources. */
useFuzzyMatching?: boolean;
/** A string tag that is appended to hit highlights. Must be set with highlightPreTag. If omitted, hit highlighting is disabled. */
highlightPostTag?: string;
/** A string tag that is prepended to hit highlights. Must be set with highlightPostTag. If omitted, hit highlighting is disabled. */
highlightPreTag?: string;
/** A number between 0 and 100 indicating the percentage of the index that must be covered by an autocomplete query in order for the query to be reported as a success. This parameter can be useful for ensuring search availability even for services with only one replica. The default is 80. */
minimumCoverage?: number;
/** The list of field names to consider when querying for auto-completed terms. Target fields must be included in the specified suggester. */
searchFields?: string[];
/** The number of auto-completed terms to retrieve. This must be a value between 1 and 100. The default is 5. */
top?: number;
}
/** Known values of {@link ApiVersion20210430Preview} that the service accepts. */
export enum KnownApiVersion20210430Preview {
/** Api Version '2021-04-30-Preview' */
TwoThousandTwentyOne0430Preview = "2021-04-30-Preview"
}
/**
* Defines values for ApiVersion20210430Preview. \
* {@link KnownApiVersion20210430Preview} can be used interchangeably with ApiVersion20210430Preview,
* this enum contains the known values that the service supports.
* ### Known values supported by the service
* **2021-04-30-Preview**: Api Version '2021-04-30-Preview'
*/
export type ApiVersion20210430Preview = string;
/** Known values of {@link QueryLanguage} that the service accepts. */
export enum KnownQueryLanguage {
/** Query language not specified. */
None = "none",
/** Query language value for English (United States). */
EnUs = "en-us",
/** Query language value for English (Great Britain). */
EnGb = "en-gb",
/** Query language value for English (India). */
EnIn = "en-in",
/** Query language value for English (Canada). */
EnCa = "en-ca",
/** Query language value for English (Australia). */
EnAu = "en-au",
/** Query language value for French (France). */
FrFr = "fr-fr",
/** Query language value for French (Canada). */
FrCa = "fr-ca",
/** Query language value for German (Germany). */
DeDe = "de-de",
/** Query language value for Spanish (Spain). */
EsEs = "es-es",
/** Query language value for Spanish (Mexico). */
EsMx = "es-mx",
/** Query language value for Chinese (China). */
ZhCn = "zh-cn",
/** Query language value for Chinese (Taiwan). */
ZhTw = "zh-tw",
/** Query language value for Portuguese (Brazil). */
PtBr = "pt-br",
/** Query language value for Portuguese (Portugal). */
PtPt = "pt-pt",
/** Query language value for Italian (Italy). */
ItIt = "it-it",
/** Query language value for Japanese (Japan). */
JaJp = "ja-jp",
/** Query language value for Korean (Korea). */
KoKr = "ko-kr",
/** Query language value for Russian (Russia). */
RuRu = "ru-ru",
/** Query language value for Czech (Czech Republic). */
CsCz = "cs-cz",
/** Query language value for Dutch (Belgium). */
NlBe = "nl-be",
/** Query language value for Dutch (Netherlands). */
NlNl = "nl-nl",
/** Query language value for Hungarian (Hungary). */
HuHu = "hu-hu",
/** Query language value for Polish (Poland). */
PlPl = "pl-pl",
/** Query language value for Swedish (Sweden). */
SvSe = "sv-se",
/** Query language value for Turkish (Turkey). */
TrTr = "tr-tr",
/** Query language value for Hindi (India). */
HiIn = "hi-in",
/** Query language value for Arabic (Saudi Arabia). */
ArSa = "ar-sa",
/** Query language value for Arabic (Egypt). */
ArEg = "ar-eg",
/** Query language value for Arabic (Morocco). */
ArMa = "ar-ma",
/** Query language value for Arabic (Kuwait). */
ArKw = "ar-kw",
/** Query language value for Arabic (Jordan). */
ArJo = "ar-jo",
/** Query language value for Danish (Denmark). */
DaDk = "da-dk",
/** Query language value for Norwegian (Norway). */
NoNo = "no-no",
/** Query language value for Bulgarian (Bulgaria). */
BgBg = "bg-bg",
/** Query language value for Croatian (Croatia). */
HrHr = "hr-hr",
/** Query language value for Croatian (Bosnia and Herzegovina). */
HrBa = "hr-ba",
/** Query language value for Malay (Malaysia). */
MsMy = "ms-my",
/** Query language value for Malay (Brunei Darussalam). */
MsBn = "ms-bn",
/** Query language value for Slovenian (Slovenia). */
SlSl = "sl-sl",
/** Query language value for Tamil (India). */
TaIn = "ta-in",
/** Query language value for Vietnamese (Viet Nam). */
ViVn = "vi-vn",
/** Query language value for Greek (Greece). */
ElGr = "el-gr",
/** Query language value for Romanian (Romania). */
RoRo = "ro-ro",
/** Query language value for Icelandic (Iceland). */
IsIs = "is-is",
/** Query language value for Indonesian (Indonesia). */
IdId = "id-id",
/** Query language value for Thai (Thailand). */
ThTh = "th-th",
/** Query language value for Lithuanian (Lithuania). */
LtLt = "lt-lt",
/** Query language value for Ukrainian (Ukraine). */
UkUa = "uk-ua",
/** Query language value for Latvian (Latvia). */
LvLv = "lv-lv",
/** Query language value for Estonian (Estonia). */
EtEe = "et-ee",
/** Query language value for Catalan (Spain). */
CaEs = "ca-es",
/** Query language value for Finnish (Finland). */
FiFi = "fi-fi",
/** Query language value for Serbian (Bosnia and Herzegovina). */
SrBa = "sr-ba",
/** Query language value for Serbian (Montenegro). */
SrMe = "sr-me",
/** Query language value for Serbian (Serbia). */
SrRs = "sr-rs",
/** Query language value for Slovak (Slovakia). */
SkSk = "sk-sk",
/** Query language value for Norwegian (Norway). */
NbNo = "nb-no",
/** Query language value for Armenian (Armenia). */
HyAm = "hy-am",
/** Query language value for Bengali (India). */
BnIn = "bn-in",
/** Query language value for Basque (Spain). */
EuEs = "eu-es",
/** Query language value for Galician (Spain). */
GlEs = "gl-es",
/** Query language value for Gujarati (India). */
GuIn = "gu-in",
/** Query language value for Hebrew (Israel). */
HeIl = "he-il",
/** Query language value for Irish (Ireland). */
GaIe = "ga-ie",
/** Query language value for Kannada (India). */
KnIn = "kn-in",
/** Query language value for Malayalam (India). */
MlIn = "ml-in",
/** Query language value for Marathi (India). */
MrIn = "mr-in",
/** Query language value for Persian (U.A.E.). */
FaAe = "fa-ae",
/** Query language value for Punjabi (India). */
PaIn = "pa-in",
/** Query language value for Telugu (India). */
TeIn = "te-in",
/** Query language value for Urdu (Pakistan). */
UrPk = "ur-pk"
}
/**
* Defines values for QueryLanguage. \
* {@link KnownQueryLanguage} can be used interchangeably with QueryLanguage,
* this enum contains the known values that the service supports.
* ### Known values supported by the service
* **none**: Query language not specified. \
* **en-us**: Query language value for English (United States). \
* **en-gb**: Query language value for English (Great Britain). \
* **en-in**: Query language value for English (India). \
* **en-ca**: Query language value for English (Canada). \
* **en-au**: Query language value for English (Australia). \
* **fr-fr**: Query language value for French (France). \
* **fr-ca**: Query language value for French (Canada). \
* **de-de**: Query language value for German (Germany). \
* **es-es**: Query language value for Spanish (Spain). \
* **es-mx**: Query language value for Spanish (Mexico). \
* **zh-cn**: Query language value for Chinese (China). \
* **zh-tw**: Query language value for Chinese (Taiwan). \
* **pt-br**: Query language value for Portuguese (Brazil). \
* **pt-pt**: Query language value for Portuguese (Portugal). \
* **it-it**: Query language value for Italian (Italy). \
* **ja-jp**: Query language value for Japanese (Japan). \
* **ko-kr**: Query language value for Korean (Korea). \
* **ru-ru**: Query language value for Russian (Russia). \
* **cs-cz**: Query language value for Czech (Czech Republic). \
* **nl-be**: Query language value for Dutch (Belgium). \
* **nl-nl**: Query language value for Dutch (Netherlands). \
* **hu-hu**: Query language value for Hungarian (Hungary). \
* **pl-pl**: Query language value for Polish (Poland). \
* **sv-se**: Query language value for Swedish (Sweden). \
* **tr-tr**: Query language value for Turkish (Turkey). \
* **hi-in**: Query language value for Hindi (India). \
* **ar-sa**: Query language value for Arabic (Saudi Arabia). \
* **ar-eg**: Query language value for Arabic (Egypt). \
* **ar-ma**: Query language value for Arabic (Morocco). \
* **ar-kw**: Query language value for Arabic (Kuwait). \
* **ar-jo**: Query language value for Arabic (Jordan). \
* **da-dk**: Query language value for Danish (Denmark). \
* **no-no**: Query language value for Norwegian (Norway). \
* **bg-bg**: Query language value for Bulgarian (Bulgaria). \
* **hr-hr**: Query language value for Croatian (Croatia). \
* **hr-ba**: Query language value for Croatian (Bosnia and Herzegovina). \
* **ms-my**: Query language value for Malay (Malaysia). \
* **ms-bn**: Query language value for Malay (Brunei Darussalam). \
* **sl-sl**: Query language value for Slovenian (Slovenia). \
* **ta-in**: Query language value for Tamil (India). \
* **vi-vn**: Query language value for Vietnamese (Viet Nam). \
* **el-gr**: Query language value for Greek (Greece). \
* **ro-ro**: Query language value for Romanian (Romania). \
* **is-is**: Query language value for Icelandic (Iceland). \
* **id-id**: Query language value for Indonesian (Indonesia). \
* **th-th**: Query language value for Thai (Thailand). \
* **lt-lt**: Query language value for Lithuanian (Lithuania). \
* **uk-ua**: Query language value for Ukrainian (Ukraine). \
* **lv-lv**: Query language value for Latvian (Latvia). \
* **et-ee**: Query language value for Estonian (Estonia). \
* **ca-es**: Query language value for Catalan (Spain). \
* **fi-fi**: Query language value for Finnish (Finland). \
* **sr-ba**: Query language value for Serbian (Bosnia and Herzegovina). \
* **sr-me**: Query language value for Serbian (Montenegro). \
* **sr-rs**: Query language value for Serbian (Serbia). \
* **sk-sk**: Query language value for Slovak (Slovakia). \
* **nb-no**: Query language value for Norwegian (Norway). \
* **hy-am**: Query language value for Armenian (Armenia). \
* **bn-in**: Query language value for Bengali (India). \
* **eu-es**: Query language value for Basque (Spain). \
* **gl-es**: Query language value for Galician (Spain). \
* **gu-in**: Query language value for Gujarati (India). \
* **he-il**: Query language value for Hebrew (Israel). \
* **ga-ie**: Query language value for Irish (Ireland). \
* **kn-in**: Query language value for Kannada (India). \
* **ml-in**: Query language value for Malayalam (India). \
* **mr-in**: Query language value for Marathi (India). \
* **fa-ae**: Query language value for Persian (U.A.E.). \
* **pa-in**: Query language value for Punjabi (India). \
* **te-in**: Query language value for Telugu (India). \
* **ur-pk**: Query language value for Urdu (Pakistan).
*/
export type QueryLanguage = string;
/** Known values of {@link Speller} that the service accepts. */
export enum KnownSpeller {
/** Speller not enabled. */
None = "none",
/** Speller corrects individual query terms using a static lexicon for the language specified by the queryLanguage parameter. */
Lexicon = "lexicon"
}
/**
* Defines values for Speller. \
* {@link KnownSpeller} can be used interchangeably with Speller,
* this enum contains the known values that the service supports.
* ### Known values supported by the service
* **none**: Speller not enabled. \
* **lexicon**: Speller corrects individual query terms using a static lexicon for the language specified by the queryLanguage parameter.
*/
export type Speller = string;
/** Known values of {@link Answers} that the service accepts. */
export enum KnownAnswers {
/** Do not return answers for the query. */
None = "none",
/** Extracts answer candidates from the contents of the documents returned in response to a query expressed as a question in natural language. */
Extractive = "extractive"
}
/**
* Defines values for Answers. \
* {@link KnownAnswers} can be used interchangeably with Answers,
* this enum contains the known values that the service supports.
* ### Known values supported by the service
* **none**: Do not return answers for the query. \
* **extractive**: Extracts answer candidates from the contents of the documents returned in response to a query expressed as a question in natural language.
*/
export type Answers = string;
/** Known values of {@link Captions} that the service accepts. */
export enum KnownCaptions {
/** Do not return captions for the query. */
None = "none",
/** Extracts captions from the matching documents that contain passages relevant to the search query. */
Extractive = "extractive"
}
/**
* Defines values for Captions. \
* {@link KnownCaptions} can be used interchangeably with Captions,
* this enum contains the known values that the service supports.
* ### Known values supported by the service
* **none**: Do not return captions for the query. \
* **extractive**: Extracts captions from the matching documents that contain passages relevant to the search query.
*/
export type Captions = string;
/** Known values of {@link QuerySpellerType} that the service accepts. */
export enum KnownQuerySpellerType {
/** Speller not enabled. */
None = "none",
/** Speller corrects individual query terms using a static lexicon for the language specified by the queryLanguage parameter. */
Lexicon = "lexicon"
}
/**
* Defines values for QuerySpellerType. \
* {@link KnownQuerySpellerType} can be used interchangeably with QuerySpellerType,
* this enum contains the known values that the service supports.
* ### Known values supported by the service
* **none**: Speller not enabled. \
* **lexicon**: Speller corrects individual query terms using a static lexicon for the language specified by the queryLanguage parameter.
*/
export type QuerySpellerType = string;
/** Known values of {@link QueryAnswerType} that the service accepts. */
export enum KnownQueryAnswerType {
/** Do not return answers for the query. */
None = "none",
/** Extracts answer candidates from the contents of the documents returned in response to a query expressed as a question in natural language. */
Extractive = "extractive"
}
/**
* Defines values for QueryAnswerType. \
* {@link KnownQueryAnswerType} can be used interchangeably with QueryAnswerType,
* this enum contains the known values that the service supports.
* ### Known values supported by the service
* **none**: Do not return answers for the query. \
* **extractive**: Extracts answer candidates from the contents of the documents returned in response to a query expressed as a question in natural language.
*/
export type QueryAnswerType = string;
/** Known values of {@link QueryCaptionType} that the service accepts. */
export enum KnownQueryCaptionType {
/** Do not return captions for the query. */
None = "none",
/** Extracts captions from the matching documents that contain passages relevant to the search query. */
Extractive = "extractive"
}
/**
* Defines values for QueryCaptionType. \
* {@link KnownQueryCaptionType} can be used interchangeably with QueryCaptionType,
* this enum contains the known values that the service supports.
* ### Known values supported by the service
* **none**: Do not return captions for the query. \
* **extractive**: Extracts captions from the matching documents that contain passages relevant to the search query.
*/
export type QueryCaptionType = string;
/** Defines values for QueryType. */
export type QueryType = "simple" | "full" | "semantic";
/** Defines values for SearchMode. */
export type SearchMode = "any" | "all";
/** Defines values for ScoringStatistics. */
export type ScoringStatistics = "local" | "global";
/** Defines values for IndexActionType. */
export type IndexActionType = "upload" | "merge" | "mergeOrUpload" | "delete";
/** Defines values for AutocompleteMode. */
export type AutocompleteMode = "oneTerm" | "twoTerms" | "oneTermWithContext";
/** Optional parameters. */
export interface DocumentsCountOptionalParams
extends coreClient.OperationOptions {
/** Parameter group */
requestOptionsParam?: RequestOptions;
}
/** Contains response data for the count operation. */
export type DocumentsCountResponse = {
/** The parsed response body. */
body: number;
};
/** Optional parameters. */
export interface DocumentsSearchGetOptionalParams
extends coreClient.OperationOptions {
/** Parameter group */
requestOptionsParam?: RequestOptions;
/** Parameter group */
searchOptions?: SearchOptions;
/** A full-text search query expression; Use "*" or omit this parameter to match all documents. */
searchText?: string;
}
/** Contains response data for the searchGet operation. */
export type DocumentsSearchGetResponse = SearchDocumentsResult;
/** Optional parameters. */
export interface DocumentsSearchPostOptionalParams
extends coreClient.OperationOptions {
/** Parameter group */
requestOptionsParam?: RequestOptions;
}
/** Contains response data for the searchPost operation. */
export type DocumentsSearchPostResponse = SearchDocumentsResult;
/** Optional parameters. */
export interface DocumentsGetOptionalParams
extends coreClient.OperationOptions {
/** Parameter group */
requestOptionsParam?: RequestOptions;
/** List of field names to retrieve for the document; Any field not retrieved will be missing from the returned document. */
selectedFields?: string[];
}
/** Contains response data for the get operation. */
export type DocumentsGetResponse = Record<string, unknown>;
/** Optional parameters. */
export interface DocumentsSuggestGetOptionalParams
extends coreClient.OperationOptions {
/** Parameter group */
requestOptionsParam?: RequestOptions;
/** Parameter group */
suggestOptions?: SuggestOptions;
}
/** Contains response data for the suggestGet operation. */
export type DocumentsSuggestGetResponse = SuggestDocumentsResult;
/** Optional parameters. */
export interface DocumentsSuggestPostOptionalParams
extends coreClient.OperationOptions {
/** Parameter group */
requestOptionsParam?: RequestOptions;
}
/** Contains response data for the suggestPost operation. */
export type DocumentsSuggestPostResponse = SuggestDocumentsResult;
/** Optional parameters. */
export interface DocumentsIndexOptionalParams
extends coreClient.OperationOptions {
/** Parameter group */
requestOptionsParam?: RequestOptions;
}
/** Contains response data for the index operation. */
export type DocumentsIndexResponse = IndexDocumentsResult;
/** Optional parameters. */
export interface DocumentsAutocompleteGetOptionalParams
extends coreClient.OperationOptions {
/** Parameter group */
requestOptionsParam?: RequestOptions;
/** Parameter group */
autocompleteOptions?: AutocompleteOptions;
}
/** Contains response data for the autocompleteGet operation. */
export type DocumentsAutocompleteGetResponse = AutocompleteResult;
/** Optional parameters. */
export interface DocumentsAutocompletePostOptionalParams
extends coreClient.OperationOptions {
/** Parameter group */
requestOptionsParam?: RequestOptions;
}
/** Contains response data for the autocompletePost operation. */
export type DocumentsAutocompletePostResponse = AutocompleteResult;
/** Optional parameters. */
export interface SearchClientOptionalParams
extends coreClient.ServiceClientOptions {
/** Overrides client endpoint. */
endpoint?: string;
}