/
serviceModels.ts
1865 lines (1792 loc) · 55.8 KB
/
serviceModels.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
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import { OperationOptions } from "@azure/core-http";
import {
LuceneStandardAnalyzer,
StopAnalyzer,
CorsOptions,
Suggester as SearchSuggester,
ClassicTokenizer,
EdgeNGramTokenizer,
MicrosoftLanguageTokenizer,
MicrosoftLanguageStemmingTokenizer,
NGramTokenizer,
PathHierarchyTokenizerV2 as PathHierarchyTokenizer,
UaxUrlEmailTokenizer,
AsciiFoldingTokenFilter,
CjkBigramTokenFilter,
CommonGramTokenFilter,
DictionaryDecompounderTokenFilter,
LengthTokenFilter,
ElisionTokenFilter,
KeepTokenFilter,
KeywordMarkerTokenFilter,
LimitTokenFilter,
PatternCaptureTokenFilter,
PatternReplaceTokenFilter,
PhoneticTokenFilter,
ShingleTokenFilter,
SnowballTokenFilter,
StemmerTokenFilter,
StemmerOverrideTokenFilter,
StopwordsTokenFilter,
SynonymTokenFilter,
TruncateTokenFilter,
UniqueTokenFilter,
WordDelimiterTokenFilter,
MappingCharFilter,
PatternReplaceCharFilter,
DistanceScoringFunction,
FreshnessScoringFunction,
MagnitudeScoringFunction,
TagScoringFunction,
TextWeights,
ScoringFunctionAggregation,
RegexFlags,
ConditionalSkill,
KeyPhraseExtractionSkill,
OcrSkill,
ImageAnalysisSkill,
LanguageDetectionSkill,
ShaperSkill,
MergeSkill,
EntityRecognitionSkill,
SentimentSkill,
SplitSkill,
PIIDetectionSkill,
EntityRecognitionSkillV3,
EntityLinkingSkill,
SentimentSkillV3,
CustomEntityLookupSkill,
DocumentExtractionSkill,
TextTranslationSkill,
WebApiSkill,
DefaultCognitiveServicesAccount,
CognitiveServicesAccountKey,
HighWaterMarkChangeDetectionPolicy,
SqlIntegratedChangeTrackingPolicy,
SearchIndexerDataUserAssignedIdentity,
SearchIndexerDataNoneIdentity,
SoftDeleteColumnDeletionDetectionPolicy,
SearchIndexerDataSourceType,
SearchIndexerDataContainer,
LexicalAnalyzerName,
ClassicSimilarity,
BM25Similarity,
EdgeNGramTokenFilterSide,
ServiceCounters,
ServiceLimits,
FieldMapping,
IndexingParameters,
IndexingSchedule,
LexicalNormalizerName,
CustomNormalizer,
SearchIndexerKnowledgeStore
} from "./generated/service/models";
import { PagedAsyncIterableIterator } from "@azure/core-paging";
/**
* Options for a list skillsets operation.
*/
export type ListSkillsetsOptions = OperationOptions;
/**
* Options for a list synonymMaps operation.
*/
export type ListSynonymMapsOptions = OperationOptions;
/**
* Options for a list indexes operation.
*/
export type ListIndexesOptions = OperationOptions;
/**
* Options for a list indexers operation.
*/
export type ListIndexersOptions = OperationOptions;
/**
* Options for a list data sources operation.
*/
export type ListDataSourceConnectionsOptions = OperationOptions;
/**
* Options for get index operation.
*/
export type GetIndexOptions = OperationOptions;
/**
* Options for get skillset operation.
*/
export type GetSkillSetOptions = OperationOptions;
/**
* Options for get synonymmaps operation.
*/
export type GetSynonymMapsOptions = OperationOptions;
/**
* Options for get indexer operation.
*/
export type GetIndexerOptions = OperationOptions;
/**
* Options for get datasource operation.
*/
export type GetDataSourceConnectionOptions = OperationOptions;
/**
* Options for get index statistics operation.
*/
export type GetIndexStatisticsOptions = OperationOptions;
/**
* Statistics for a given index. Statistics are collected periodically and are not guaranteed to
* always be up-to-date.
*/
export interface SearchIndexStatistics {
/**
* The number of documents in the index.
* **NOTE: This property will not be serialized. It can only be populated by the server.**
*/
readonly documentCount: number;
/**
* The amount of storage in bytes consumed by the index.
* **NOTE: This property will not be serialized. It can only be populated by the server.**
*/
readonly storageSize: number;
}
/**
* Response from a get service statistics request. If successful, it includes service level
* counters and limits.
*/
export interface SearchServiceStatistics {
/**
* Service level resource counters.
*/
counters: ServiceCounters;
/**
* Service level general limits.
*/
limits: ServiceLimits;
}
/**
* Options for get service statistics operation.
*/
export type GetServiceStatisticsOptions = OperationOptions;
/**
* Options for get indexer status operation.
*/
export type GetIndexerStatusOptions = OperationOptions;
/**
* Options for reset indexer operation.
*/
export type ResetIndexerOptions = OperationOptions;
/**
* Options for run indexer operation.
*/
export type RunIndexerOptions = OperationOptions;
/**
* Options for create index operation.
*/
export type CreateIndexOptions = OperationOptions;
/**
* Options for create skillset operation.
*/
export type CreateSkillsetOptions = OperationOptions;
/**
* Options for create synonymmap operation.
*/
export type CreateSynonymMapOptions = OperationOptions;
/**
* Options for create indexer operation.
*/
export type CreateIndexerOptions = OperationOptions;
/**
* Options for create datasource operation.
*/
export type CreateDataSourceConnectionOptions = OperationOptions;
/**
* Options for create/update index operation.
*/
export interface CreateOrUpdateIndexOptions extends OperationOptions {
/**
* Allows new analyzers, tokenizers, token filters, or char filters to be added to an index by
* taking the index offline for at least a few seconds. This temporarily causes indexing and
* query requests to fail. Performance and write availability of the index can be impaired for
* several minutes after the index is updated, or longer for very large indexes.
*/
allowIndexDowntime?: boolean;
/**
* If set to true, Resource will be deleted only if the etag matches.
*/
onlyIfUnchanged?: boolean;
}
/**
* Options for create/update skillset operation.
*/
export interface CreateOrUpdateSkillsetOptions extends OperationOptions {
/**
* If set to true, Resource will be deleted only if the etag matches.
*/
onlyIfUnchanged?: boolean;
}
/**
* Options for create/update synonymmap operation.
*/
export interface CreateOrUpdateSynonymMapOptions extends OperationOptions {
/**
* If set to true, Resource will be deleted only if the etag matches.
*/
onlyIfUnchanged?: boolean;
}
/**
* Options for create/update indexer operation.
*/
export interface CreateorUpdateIndexerOptions extends OperationOptions {
/**
* If set to true, Resource will be deleted only if the etag matches.
*/
onlyIfUnchanged?: boolean;
}
/**
* Options for create/update datasource operation.
*/
export interface CreateorUpdateDataSourceConnectionOptions extends OperationOptions {
/**
* If set to true, Resource will be deleted only if the etag matches.
*/
onlyIfUnchanged?: boolean;
}
/**
* Options for delete index operation.
*/
export interface DeleteIndexOptions extends OperationOptions {
/**
* If set to true, Resource will be deleted only if the etag matches.
*/
onlyIfUnchanged?: boolean;
}
/**
* Options for delete skillset operaion.
*/
export interface DeleteSkillsetOptions extends OperationOptions {
/**
* If set to true, Resource will be deleted only if the etag matches.
*/
onlyIfUnchanged?: boolean;
}
/**
* Options for delete synonymmap operation.
*/
export interface DeleteSynonymMapOptions extends OperationOptions {
/**
* If set to true, Resource will be deleted only if the etag matches.
*/
onlyIfUnchanged?: boolean;
}
/**
* Options for delete indexer operation.
*/
export interface DeleteIndexerOptions extends OperationOptions {
/**
* If set to true, Resource will be deleted only if the etag matches.
*/
onlyIfUnchanged?: boolean;
}
/**
* Options for delete datasource operation.
*/
export interface DeleteDataSourceConnectionOptions extends OperationOptions {
/**
* If set to true, Resource will be deleted only if the etag matches.
*/
onlyIfUnchanged?: boolean;
}
/**
* Specifies some text and analysis components used to break that text into tokens.
*/
export interface AnalyzeRequest {
/**
* The text to break into tokens.
*/
text: string;
/**
* The name of the analyzer to use to break the given text. If this parameter is not specified,
* you must specify a tokenizer instead. The tokenizer and analyzer parameters are mutually
* exclusive. KnownAnalyzerNames is an enum containing known values.
* NOTE: Either analyzerName or tokenizerName is required in an AnalyzeRequest.
*/
analyzerName?: string;
/**
* The name of the tokenizer to use to break the given text. If this parameter is not specified,
* you must specify an analyzer instead. The tokenizer and analyzer parameters are mutually
* exclusive. KnownTokenizerNames is an enum containing known values.
* NOTE: Either analyzerName or tokenizerName is required in an AnalyzeRequest.
*/
tokenizerName?: string;
/**
* An optional list of token filters to use when breaking the given text. This parameter can only
* be set when using the tokenizer parameter.
*/
tokenFilters?: string[];
/**
* An optional list of character filters to use when breaking the given text. This parameter can
* only be set when using the tokenizer parameter.
*/
charFilters?: string[];
}
/**
* Options for analyze text operation.
*/
export type AnalyzeTextOptions = OperationOptions & AnalyzeRequest;
// BEGIN manually modified generated interfaces
//
// This section is for places where we have to manually fix issues
// with interfaces from the generated code.
// One issue is that unions of discriminated types generated with
// their abstract base class as a member.
/**
* Flexibly separates text into terms via a regular expression pattern. This analyzer is
* implemented using Apache Lucene.
*/
export interface PatternAnalyzer {
/**
* Polymorphic Discriminator
*/
odatatype: "#Microsoft.Azure.Search.PatternAnalyzer";
/**
* The name of the analyzer. It must only contain letters, digits, spaces, dashes or underscores,
* can only start and end with alphanumeric characters, and is limited to 128 characters.
*/
name: string;
/**
* A value indicating whether terms should be lower-cased. Default is true. Default value: true.
*/
lowerCaseTerms?: boolean;
/**
* A regular expression pattern to match token separators. Default is an expression that matches
* one or more whitespace characters. Default value: `\W+`.
*/
pattern?: string;
/**
* Regular expression flags. Possible values include: 'CANON_EQ', 'CASE_INSENSITIVE', 'COMMENTS',
* 'DOTALL', 'LITERAL', 'MULTILINE', 'UNICODE_CASE', 'UNIX_LINES'
*/
flags?: RegexFlags[];
/**
* A list of stopwords.
*/
stopwords?: string[];
}
/**
* Allows you to take control over the process of converting text into indexable/searchable tokens.
* It's a user-defined configuration consisting of a single predefined tokenizer and one or more
* filters. The tokenizer is responsible for breaking text into tokens, and the filters for
* modifying tokens emitted by the tokenizer.
*/
export interface CustomAnalyzer {
/**
* Polymorphic Discriminator
*/
odatatype: "#Microsoft.Azure.Search.CustomAnalyzer";
/**
* The name of the analyzer. It must only contain letters, digits, spaces, dashes or underscores,
* can only start and end with alphanumeric characters, and is limited to 128 characters.
*/
name: string;
/**
* The name of the tokenizer to use to divide continuous text into a sequence of tokens, such as
* breaking a sentence into words. KnownTokenizerNames is an enum containing known values.
*/
tokenizerName: string;
/**
* A list of token filters used to filter out or modify the tokens generated by a tokenizer. For
* example, you can specify a lowercase filter that converts all characters to lowercase. The
* filters are run in the order in which they are listed.
*/
tokenFilters?: string[];
/**
* A list of character filters used to prepare input text before it is processed by the
* tokenizer. For instance, they can replace certain characters or symbols. The filters are run
* in the order in which they are listed.
*/
charFilters?: string[];
}
/**
* Contains the possible cases for Analyzer.
*/
export type LexicalAnalyzer =
| CustomAnalyzer
| PatternAnalyzer
| LuceneStandardAnalyzer
| StopAnalyzer;
/**
* Contains the possible cases for Skill.
*/
export type SearchIndexerSkill =
| ConditionalSkill
| KeyPhraseExtractionSkill
| OcrSkill
| ImageAnalysisSkill
| LanguageDetectionSkill
| ShaperSkill
| MergeSkill
| EntityRecognitionSkill
| SentimentSkill
| SplitSkill
| PIIDetectionSkill
| EntityRecognitionSkillV3
| EntityLinkingSkill
| SentimentSkillV3
| CustomEntityLookupSkill
| TextTranslationSkill
| DocumentExtractionSkill
| WebApiSkill;
/**
* Contains the possible cases for CognitiveServicesAccount.
*/
export type CognitiveServicesAccount =
| DefaultCognitiveServicesAccount
| CognitiveServicesAccountKey;
/**
* Tokenizer that uses regex pattern matching to construct distinct tokens. This tokenizer is
* implemented using Apache Lucene.
*/
export interface PatternTokenizer {
/**
* Polymorphic Discriminator
*/
odatatype: "#Microsoft.Azure.Search.PatternTokenizer";
/**
* The name of the tokenizer. It must only contain letters, digits, spaces, dashes or
* underscores, can only start and end with alphanumeric characters, and is limited to 128
* characters.
*/
name: string;
/**
* A regular expression pattern to match token separators. Default is an expression that matches
* one or more whitespace characters. Default value: `\W+`.
*/
pattern?: string;
/**
* Regular expression flags. Possible values include: 'CANON_EQ', 'CASE_INSENSITIVE', 'COMMENTS',
* 'DOTALL', 'LITERAL', 'MULTILINE', 'UNICODE_CASE', 'UNIX_LINES'
*/
flags?: RegexFlags[];
/**
* The zero-based ordinal of the matching group in the regular expression pattern to extract into
* tokens. Use -1 if you want to use the entire pattern to split the input into tokens,
* irrespective of matching groups. Default is -1. Default value: -1.
*/
group?: number;
}
/**
* Breaks text following the Unicode Text Segmentation rules. This tokenizer is implemented using
* Apache Lucene.
*/
export interface LuceneStandardTokenizer {
/**
* Polymorphic Discriminator
*/
odatatype:
| "#Microsoft.Azure.Search.StandardTokenizerV2"
| "#Microsoft.Azure.Search.StandardTokenizer";
/**
* The name of the tokenizer. It must only contain letters, digits, spaces, dashes or
* underscores, can only start and end with alphanumeric characters, and is limited to 128
* characters.
*/
name: string;
/**
* The maximum token length. Default is 255. Tokens longer than the maximum length are split. The
* maximum token length that can be used is 300 characters. Default value: 255.
*/
maxTokenLength?: number;
}
/**
* Generates n-grams of the given size(s) starting from the front or the back of an input token.
* This token filter is implemented using Apache Lucene.
*/
export interface EdgeNGramTokenFilter {
/**
* Polymorphic Discriminator
*/
odatatype:
| "#Microsoft.Azure.Search.EdgeNGramTokenFilterV2"
| "#Microsoft.Azure.Search.EdgeNGramTokenFilter";
/**
* The name of the token filter. It must only contain letters, digits, spaces, dashes or
* underscores, can only start and end with alphanumeric characters, and is limited to 128
* characters.
*/
name: string;
/**
* The minimum n-gram length. Default is 1. Maximum is 300. Must be less than the value of
* maxGram. Default value: 1.
*/
minGram?: number;
/**
* The maximum n-gram length. Default is 2. Maximum is 300. Default value: 2.
*/
maxGram?: number;
/**
* Specifies which side of the input the n-gram should be generated from. Default is "front".
* Possible values include: 'Front', 'Back'
*/
side?: EdgeNGramTokenFilterSide;
}
/**
* Emits the entire input as a single token. This tokenizer is implemented using Apache Lucene.
*/
export interface KeywordTokenizer {
/**
* Polymorphic Discriminator
*/
odatatype:
| "#Microsoft.Azure.Search.KeywordTokenizerV2"
| "#Microsoft.Azure.Search.KeywordTokenizer";
/**
* The name of the tokenizer. It must only contain letters, digits, spaces, dashes or
* underscores, can only start and end with alphanumeric characters, and is limited to 128
* characters.
*/
name: string;
/**
* The maximum token length. Default is 256. Tokens longer than the maximum length are split. The
* maximum token length that can be used is 300 characters. Default value: 256.
*/
maxTokenLength?: number;
}
/**
* Contains the possible cases for Tokenizer.
*/
export type LexicalTokenizer =
| ClassicTokenizer
| EdgeNGramTokenizer
| KeywordTokenizer
| MicrosoftLanguageTokenizer
| MicrosoftLanguageStemmingTokenizer
| NGramTokenizer
| PathHierarchyTokenizer
| PatternTokenizer
| LuceneStandardTokenizer
| UaxUrlEmailTokenizer;
/**
* Contains the possible cases for Similarity.
*/
export type SimilarityAlgorithm = ClassicSimilarity | BM25Similarity;
/**
* Generates n-grams of the given size(s). This token filter is implemented using Apache Lucene.
*/
export interface NGramTokenFilter {
/**
* Polymorphic Discriminator
*/
odatatype:
| "#Microsoft.Azure.Search.NGramTokenFilterV2"
| "#Microsoft.Azure.Search.NGramTokenFilter";
/**
* The name of the token filter. It must only contain letters, digits, spaces, dashes or
* underscores, can only start and end with alphanumeric characters, and is limited to 128
* characters.
*/
name: string;
/**
* The minimum n-gram length. Default is 1. Maximum is 300. Must be less than the value of
* maxGram. Default value: 1.
*/
minGram?: number;
/**
* The maximum n-gram length. Default is 2. Maximum is 300. Default value: 2.
*/
maxGram?: number;
}
/**
* Contains the possible cases for TokenFilter.
*/
export type TokenFilter =
| AsciiFoldingTokenFilter
| CjkBigramTokenFilter
| CommonGramTokenFilter
| DictionaryDecompounderTokenFilter
| EdgeNGramTokenFilter
| ElisionTokenFilter
| KeepTokenFilter
| KeywordMarkerTokenFilter
| LengthTokenFilter
| LimitTokenFilter
| NGramTokenFilter
| PatternCaptureTokenFilter
| PatternReplaceTokenFilter
| PhoneticTokenFilter
| ShingleTokenFilter
| SnowballTokenFilter
| StemmerTokenFilter
| StemmerOverrideTokenFilter
| StopwordsTokenFilter
| SynonymTokenFilter
| TruncateTokenFilter
| UniqueTokenFilter
| WordDelimiterTokenFilter;
/**
* Contains the possible cases for CharFilter.
*/
export type CharFilter = MappingCharFilter | PatternReplaceCharFilter;
/**
* Contains the possible cases for LexicalNormalizer.
*/
export type LexicalNormalizer = CustomNormalizer;
/**
* Contains the possible cases for ScoringFunction.
*/
export type ScoringFunction =
| DistanceScoringFunction
| FreshnessScoringFunction
| MagnitudeScoringFunction
| TagScoringFunction;
/**
* Defines values for SearchFieldDataType.
* Possible values include: 'Edm.String', 'Edm.Int32', 'Edm.Int64', 'Edm.Double', 'Edm.Boolean',
* 'Edm.DateTimeOffset', 'Edm.GeographyPoint', 'Collection(Edm.String)',
* 'Collection(Edm.Int32)', 'Collection(Edm.Int64)', 'Collection(Edm.Double)',
* 'Collection(Edm.Boolean)', 'Collection(Edm.DateTimeOffset)', 'Collection(Edm.GeographyPoint)'
* @readonly
*/
export type SearchFieldDataType =
| "Edm.String"
| "Edm.Int32"
| "Edm.Int64"
| "Edm.Double"
| "Edm.Boolean"
| "Edm.DateTimeOffset"
| "Edm.GeographyPoint"
| "Collection(Edm.String)"
| "Collection(Edm.Int32)"
| "Collection(Edm.Int64)"
| "Collection(Edm.Double)"
| "Collection(Edm.Boolean)"
| "Collection(Edm.DateTimeOffset)"
| "Collection(Edm.GeographyPoint)";
/**
* Defines values for ComplexDataType.
* Possible values include: 'Edm.ComplexType', 'Collection(Edm.ComplexType)'
* @readonly
*/
export type ComplexDataType = "Edm.ComplexType" | "Collection(Edm.ComplexType)";
/**
* Represents a field in an index definition, which describes the name, data type, and search
* behavior of a field.
*/
export type SearchField = SimpleField | ComplexField;
/**
* Represents a field in an index definition, which describes the name, data type, and search
* behavior of a field.
*/
export interface SimpleField {
/**
* The name of the field, which must be unique within the fields collection of the index or
* parent field.
*/
name: string;
/**
* The data type of the field. Possible values include: 'Edm.String', 'Edm.Int32', 'Edm.Int64',
* 'Edm.Double', 'Edm.Boolean', 'Edm.DateTimeOffset', 'Edm.GeographyPoint'
* 'Collection(Edm.String)', 'Collection(Edm.Int32)', 'Collection(Edm.Int64)',
* 'Collection(Edm.Double)', 'Collection(Edm.Boolean)', 'Collection(Edm.DateTimeOffset)',
* 'Collection(Edm.GeographyPoint)'
*/
type: SearchFieldDataType;
/**
* A value indicating whether the field uniquely identifies documents in the index. Exactly one
* top-level field in each index must be chosen as the key field and it must be of type
* Edm.String. Key fields can be used to look up documents directly and update or delete specific
* documents. Default is false.
*/
key?: boolean;
/**
* A value indicating whether the field can be returned in a search result. You can enable this
* option if you want to use a field (for example, margin) as a filter, sorting, or scoring
* mechanism but do not want the field to be visible to the end user. This property must be false
* for key fields. This property can be changed on existing fields.
* Disabling this property does not cause any increase in index storage requirements.
* Default is false.
*/
hidden?: boolean;
/**
* A value indicating whether the field is full-text searchable. This means it will undergo
* analysis such as word-breaking during indexing. If you set a searchable field to a value like
* "sunny day", internally it will be split into the individual tokens "sunny" and "day". This
* enables full-text searches for these terms. This property must be false for simple
* fields of other non-string data types.
* Note: searchable fields consume extra space in your index since Azure Cognitive Search will store an
* additional tokenized version of the field value for full-text searches.
* Defaults to false for simple fields.
*/
searchable?: boolean;
/**
* A value indicating whether to enable the field to be referenced in $filter queries. Filterable
* differs from searchable in how strings are handled. Fields of type Edm.String or
* Collection(Edm.String) that are filterable do not undergo word-breaking, so comparisons are
* for exact matches only. For example, if you set such a field f to "sunny day", $filter=f eq
* 'sunny' will find no matches, but $filter=f eq 'sunny day' will.
* Default is false.
*/
filterable?: boolean;
/**
* A value indicating whether to enable the field to be referenced in $orderby expressions. By
* default Azure Cognitive Search sorts results by score, but in many experiences users will want
* to sort by fields in the documents. A simple field can be sortable only if it is single-valued
* (it has a single value in the scope of the parent document). Simple collection fields cannot
* be sortable, since they are multi-valued. Simple sub-fields of complex collections are also
* multi-valued, and therefore cannot be sortable. This is true whether it's an immediate parent
* field, or an ancestor field, that's the complex collection. The default for sortable is false.
*/
sortable?: boolean;
/**
* A value indicating whether to enable the field to be referenced in facet queries. Typically
* used in a presentation of search results that includes hit count by category (for example,
* search for digital cameras and see hits by brand, by megapixels, by price, and so on).
* Fields of type Edm.GeographyPoint or Collection(Edm.GeographyPoint) cannot be facetable.
* Default is false for all other simple fields.
*/
facetable?: boolean;
/**
* The name of the language analyzer to use for the field. This option can be used only with
* searchable fields and it can't be set together with either searchAnalyzer or indexAnalyzer.
* Once the analyzer is chosen, it cannot be changed for the field.
* KnownAnalyzerNames is an enum containing known values.
*/
analyzerName?: LexicalAnalyzerName;
/**
* The name of the analyzer used at search time for the field. This option can be used only with
* searchable fields. It must be set together with indexAnalyzer and it cannot be set together
* with the analyzer option. This analyzer can be updated on an existing field.
* KnownAnalyzerNames is an enum containing known values.
*/
searchAnalyzerName?: LexicalAnalyzerName;
/**
* The name of the analyzer used at indexing time for the field. This option can be used only
* with searchable fields. It must be set together with searchAnalyzer and it cannot be set
* together with the analyzer option. Once the analyzer is chosen, it cannot be changed for the
* field. KnownAnalyzerNames is an enum containing known values.
*/
indexAnalyzerName?: LexicalAnalyzerName;
/**
* A list of the names of synonym maps to associate with this field. This option can be used only
* with searchable fields. Currently only one synonym map per field is supported. Assigning a
* synonym map to a field ensures that query terms targeting that field are expanded at
* query-time using the rules in the synonym map. This attribute can be changed on existing
* fields.
*/
synonymMapNames?: string[];
/**
* The name of the normalizer used at indexing time for the field.
*/
normalizerName?: LexicalNormalizerName;
}
export function isComplexField(field: SearchField): field is ComplexField {
return field.type === "Edm.ComplexType" || field.type === "Collection(Edm.ComplexType)";
}
/**
* Represents a field in an index definition, which describes the name, data type, and search
* behavior of a field.
*/
export interface ComplexField {
/**
* The name of the field, which must be unique within the fields collection of the index or
* parent field.
*/
name: string;
/**
* The data type of the field.
* Possible values include: 'Edm.ComplexType','Collection(Edm.ComplexType)'
*/
type: ComplexDataType;
/**
* A list of sub-fields.
*/
fields: SearchField[];
}
/**
* Represents a synonym map definition.
*/
export interface SynonymMap {
/**
* The name of the synonym map.
*/
name: string;
/**
* An array of synonym rules in the specified synonym map format.
*/
synonyms: string[];
/**
* A description of an encryption key that you create in Azure Key Vault. This key is used to
* provide an additional level of encryption-at-rest for your data when you want full assurance
* that no one, not even Microsoft, can decrypt your data in Azure Cognitive Search. Once you
* have encrypted your data, it will always remain encrypted. Azure Cognitive Search will ignore
* attempts to set this property to null. You can change this property as needed if you want to
* rotate your encryption key; Your data will be unaffected. Encryption with customer-managed
* keys is not available for free search services, and is only available for paid services
* created on or after January 1, 2019.
*/
encryptionKey?: SearchResourceEncryptionKey | null;
/**
* The ETag of the synonym map.
*/
etag?: string;
}
/**
* An iterator for listing the indexes that exist in the Search service. Will make requests
* as needed during iteration. Use .byPage() to make one request to the server
* per iteration.
*/
// eslint-disable-next-line @typescript-eslint/ban-types
export type IndexIterator = PagedAsyncIterableIterator<SearchIndex, SearchIndex[], {}>;
/**
* An iterator for listing the indexes that exist in the Search service. Will make requests
* as needed during iteration. Use .byPage() to make one request to the server
* per iteration.
*/
// eslint-disable-next-line @typescript-eslint/ban-types
export type IndexNameIterator = PagedAsyncIterableIterator<string, string[], {}>;
/**
* Represents a search index definition, which describes the fields and search behavior of an
* index.
*/
export interface SearchIndex {
/**
* The name of the index.
*/
name: string;
/**
* The fields of the index.
*/
fields: SearchField[];
/**
* The scoring profiles for the index.
*/
scoringProfiles?: ScoringProfile[];
/**
* The name of the scoring profile to use if none is specified in the query. If this property is
* not set and no scoring profile is specified in the query, then default scoring (tf-idf) will
* be used.
*/
defaultScoringProfile?: string;
/**
* Options to control Cross-Origin Resource Sharing (CORS) for the index.
*/
corsOptions?: CorsOptions | null;
/**
* The suggesters for the index.
*/
suggesters?: SearchSuggester[];
/**
* The analyzers for the index.
*/
analyzers?: LexicalAnalyzer[];
/**
* The tokenizers for the index.
*/
tokenizers?: LexicalTokenizer[];
/**
* The token filters for the index.
*/
tokenFilters?: TokenFilter[];
/**
* The character filters for the index.
*/
charFilters?: CharFilter[];
/**
* The normalizers for the index.
*/
normalizers?: LexicalNormalizer[];
/**
* A description of an encryption key that you create in Azure Key Vault. This key is used to
* provide an additional level of encryption-at-rest for your data when you want full assurance
* that no one, not even Microsoft, can decrypt your data in Azure Cognitive Search. Once you
* have encrypted your data, it will always remain encrypted. Azure Cognitive Search will ignore
* attempts to set this property to null. You can change this property as needed if you want to
* rotate your encryption key; Your data will be unaffected. Encryption with customer-managed
* keys is not available for free search services, and is only available for paid services
* created on or after January 1, 2019.
*/
encryptionKey?: SearchResourceEncryptionKey | null;
/**
* The type of similarity algorithm to be used when scoring and ranking the documents matching a
* search query. The similarity algorithm can only be defined at index creation time and cannot
* be modified on existing indexes. If null, the ClassicSimilarity algorithm is used.
*/
similarity?: SimilarityAlgorithm;
/**
* The ETag of the index.
*/
etag?: string;
}
/**
* Represents an indexer.
*/
export interface SearchIndexer {
/**
* The name of the indexer.
*/
name: string;
/**
* The description of the indexer.
*/
description?: string;
/**
* The name of the datasource from which this indexer reads data.
*/
dataSourceName: string;
/**
* The name of the skillset executing with this indexer.
*/
skillsetName?: string;
/**
* The name of the index to which this indexer writes data.
*/
targetIndexName: string;
/**