diff --git a/sdk/search/Azure.Search.Documents/api/Azure.Search.Documents.netstandard2.0.cs b/sdk/search/Azure.Search.Documents/api/Azure.Search.Documents.netstandard2.0.cs index b6a1c46b6cbc..6d08aa6de0dd 100644 --- a/sdk/search/Azure.Search.Documents/api/Azure.Search.Documents.netstandard2.0.cs +++ b/sdk/search/Azure.Search.Documents/api/Azure.Search.Documents.netstandard2.0.cs @@ -399,6 +399,23 @@ public partial class CharFilter internal CharFilter() { } public string Name { get { throw null; } set { } } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct CharFilterName : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public CharFilterName(string value) { throw null; } + public static Azure.Search.Documents.Indexes.Models.CharFilterName HtmlStrip { get { throw null; } } + public bool Equals(Azure.Search.Documents.Indexes.Models.CharFilterName other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.Search.Documents.Indexes.Models.CharFilterName left, Azure.Search.Documents.Indexes.Models.CharFilterName right) { throw null; } + public static implicit operator Azure.Search.Documents.Indexes.Models.CharFilterName (string value) { throw null; } + public static bool operator !=(Azure.Search.Documents.Indexes.Models.CharFilterName left, Azure.Search.Documents.Indexes.Models.CharFilterName right) { throw null; } + public override string ToString() { throw null; } + } public partial class CjkBigramTokenFilter : Azure.Search.Documents.Indexes.Models.TokenFilter { public CjkBigramTokenFilter(string name) { } @@ -460,6 +477,71 @@ public CustomAnalyzer(string name, Azure.Search.Documents.Indexes.Models.Lexical public System.Collections.Generic.IList TokenFilters { get { throw null; } } public Azure.Search.Documents.Indexes.Models.LexicalTokenizerName TokenizerName { get { throw null; } set { } } } + public partial class CustomEntity + { + public CustomEntity(string name) { } + public bool? AccentSensitive { get { throw null; } set { } } + public System.Collections.Generic.IList Aliases { get { throw null; } } + public bool? CaseSensitive { get { throw null; } set { } } + public bool? DefaultAccentSensitive { get { throw null; } set { } } + public bool? DefaultCaseSensitive { get { throw null; } set { } } + public int? DefaultFuzzyEditDistance { get { throw null; } set { } } + public string Description { get { throw null; } set { } } + public int? FuzzyEditDistance { get { throw null; } set { } } + public string Id { get { throw null; } set { } } + public string Name { get { throw null; } set { } } + public string Subtype { get { throw null; } set { } } + public string Type { get { throw null; } set { } } + } + public partial class CustomEntityAlias + { + public CustomEntityAlias(string text) { } + public bool? AccentSensitive { get { throw null; } set { } } + public bool? CaseSensitive { get { throw null; } set { } } + public int? FuzzyEditDistance { get { throw null; } set { } } + public string Text { get { throw null; } set { } } + } + public partial class CustomEntityLookupSkill : Azure.Search.Documents.Indexes.Models.SearchIndexerSkill + { + public CustomEntityLookupSkill(System.Collections.Generic.IEnumerable inputs, System.Collections.Generic.IEnumerable outputs) { } + public Azure.Search.Documents.Indexes.Models.CustomEntityLookupSkillLanguage? DefaultLanguageCode { get { throw null; } set { } } + public string EntitiesDefinitionUri { get { throw null; } set { } } + public bool? GlobalDefaultAccentSensitive { get { throw null; } set { } } + public bool? GlobalDefaultCaseSensitive { get { throw null; } set { } } + public int? GlobalDefaultFuzzyEditDistance { get { throw null; } set { } } + public System.Collections.Generic.IList InlineEntitiesDefinition { get { throw null; } } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct CustomEntityLookupSkillLanguage : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public CustomEntityLookupSkillLanguage(string value) { throw null; } + public static Azure.Search.Documents.Indexes.Models.CustomEntityLookupSkillLanguage Da { get { throw null; } } + public static Azure.Search.Documents.Indexes.Models.CustomEntityLookupSkillLanguage De { get { throw null; } } + public static Azure.Search.Documents.Indexes.Models.CustomEntityLookupSkillLanguage En { get { throw null; } } + public static Azure.Search.Documents.Indexes.Models.CustomEntityLookupSkillLanguage Es { get { throw null; } } + public static Azure.Search.Documents.Indexes.Models.CustomEntityLookupSkillLanguage Fi { get { throw null; } } + public static Azure.Search.Documents.Indexes.Models.CustomEntityLookupSkillLanguage Fr { get { throw null; } } + public static Azure.Search.Documents.Indexes.Models.CustomEntityLookupSkillLanguage It { get { throw null; } } + public static Azure.Search.Documents.Indexes.Models.CustomEntityLookupSkillLanguage Ko { get { throw null; } } + public static Azure.Search.Documents.Indexes.Models.CustomEntityLookupSkillLanguage Pt { get { throw null; } } + public bool Equals(Azure.Search.Documents.Indexes.Models.CustomEntityLookupSkillLanguage other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.Search.Documents.Indexes.Models.CustomEntityLookupSkillLanguage left, Azure.Search.Documents.Indexes.Models.CustomEntityLookupSkillLanguage right) { throw null; } + public static implicit operator Azure.Search.Documents.Indexes.Models.CustomEntityLookupSkillLanguage (string value) { throw null; } + public static bool operator !=(Azure.Search.Documents.Indexes.Models.CustomEntityLookupSkillLanguage left, Azure.Search.Documents.Indexes.Models.CustomEntityLookupSkillLanguage right) { throw null; } + public override string ToString() { throw null; } + } + public partial class CustomNormalizer : Azure.Search.Documents.Indexes.Models.LexicalNormalizer + { + public CustomNormalizer(string name) : base (default(string)) { } + public System.Collections.Generic.IList CharFilters { get { throw null; } } + public System.Collections.Generic.IList TokenFilters { get { throw null; } } + } public partial class DataChangeDetectionPolicy { internal DataChangeDetectionPolicy() { } @@ -492,6 +574,13 @@ public DistanceScoringParameters(string referencePointParameter, double boosting public double BoostingDistance { get { throw null; } set { } } public string ReferencePointParameter { get { throw null; } set { } } } + public partial class DocumentExtractionSkill : Azure.Search.Documents.Indexes.Models.SearchIndexerSkill + { + public DocumentExtractionSkill(System.Collections.Generic.IEnumerable inputs, System.Collections.Generic.IEnumerable outputs) { } + public System.Collections.Generic.IDictionary Configuration { get { throw null; } } + public string DataToExtract { get { throw null; } set { } } + public string ParsingMode { get { throw null; } set { } } + } public partial class EdgeNGramTokenFilter : Azure.Search.Documents.Indexes.Models.TokenFilter { public EdgeNGramTokenFilter(string name) { } @@ -824,6 +913,7 @@ public KeywordTokenizer(string name) { } public partial class LanguageDetectionSkill : Azure.Search.Documents.Indexes.Models.SearchIndexerSkill { public LanguageDetectionSkill(System.Collections.Generic.IEnumerable inputs, System.Collections.Generic.IEnumerable outputs) { } + public string DefaultCountryHint { get { throw null; } set { } } } public partial class LengthTokenFilter : Azure.Search.Documents.Indexes.Models.TokenFilter { @@ -1041,6 +1131,32 @@ public static partial class Values public const string ZhHantMicrosoft = "zh-Hant.microsoft"; } } + public partial class LexicalNormalizer + { + public LexicalNormalizer(string name) { } + public string Name { get { throw null; } set { } } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct LexicalNormalizerName : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public LexicalNormalizerName(string value) { throw null; } + public static Azure.Search.Documents.Indexes.Models.LexicalNormalizerName AsciiFolding { get { throw null; } } + public static Azure.Search.Documents.Indexes.Models.LexicalNormalizerName Elision { get { throw null; } } + public static Azure.Search.Documents.Indexes.Models.LexicalNormalizerName Lowercase { get { throw null; } } + public static Azure.Search.Documents.Indexes.Models.LexicalNormalizerName Standard { get { throw null; } } + public static Azure.Search.Documents.Indexes.Models.LexicalNormalizerName Uppercase { get { throw null; } } + public bool Equals(Azure.Search.Documents.Indexes.Models.LexicalNormalizerName other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.Search.Documents.Indexes.Models.LexicalNormalizerName left, Azure.Search.Documents.Indexes.Models.LexicalNormalizerName right) { throw null; } + public static implicit operator Azure.Search.Documents.Indexes.Models.LexicalNormalizerName (string value) { throw null; } + public static bool operator !=(Azure.Search.Documents.Indexes.Models.LexicalNormalizerName left, Azure.Search.Documents.Indexes.Models.LexicalNormalizerName right) { throw null; } + public override string ToString() { throw null; } + } public partial class LexicalTokenizer { internal LexicalTokenizer() { } @@ -1426,6 +1542,7 @@ public SearchField(string name, Azure.Search.Documents.Indexes.Models.SearchFiel public bool? IsSearchable { get { throw null; } set { } } public bool? IsSortable { get { throw null; } set { } } public string Name { get { throw null; } } + public Azure.Search.Documents.Indexes.Models.LexicalNormalizerName? Normalizer { get { throw null; } set { } } public Azure.Search.Documents.Indexes.Models.LexicalAnalyzerName? SearchAnalyzerName { get { throw null; } set { } } public System.Collections.Generic.IList SynonymMapNames { get { throw null; } } public Azure.Search.Documents.Indexes.Models.SearchFieldDataType Type { get { throw null; } } @@ -1476,6 +1593,7 @@ public SearchIndex(string name, System.Collections.Generic.IEnumerable Fields { get { throw null; } set { } } public string Name { get { throw null; } } + public System.Collections.Generic.IList Normalizers { get { throw null; } } public System.Collections.Generic.IList ScoringProfiles { get { throw null; } } public Azure.Search.Documents.Indexes.Models.SimilarityAlgorithm Similarity { get { throw null; } set { } } public System.Collections.Generic.IList Suggesters { get { throw null; } } @@ -1523,6 +1641,7 @@ public SearchIndexerDataSourceConnection(string name, Azure.Search.Documents.Ind private readonly object _dummy; private readonly int _dummyPrimitive; public SearchIndexerDataSourceType(string value) { throw null; } + public static Azure.Search.Documents.Indexes.Models.SearchIndexerDataSourceType AdlsGen2 { get { throw null; } } public static Azure.Search.Documents.Indexes.Models.SearchIndexerDataSourceType AzureBlob { get { throw null; } } public static Azure.Search.Documents.Indexes.Models.SearchIndexerDataSourceType AzureSql { get { throw null; } } public static Azure.Search.Documents.Indexes.Models.SearchIndexerDataSourceType AzureTable { get { throw null; } } @@ -1619,6 +1738,7 @@ internal SearchServiceCounters() { } public Azure.Search.Documents.Indexes.Models.SearchResourceCounter DocumentCounter { get { throw null; } } public Azure.Search.Documents.Indexes.Models.SearchResourceCounter IndexCounter { get { throw null; } } public Azure.Search.Documents.Indexes.Models.SearchResourceCounter IndexerCounter { get { throw null; } } + public Azure.Search.Documents.Indexes.Models.SearchResourceCounter SkillsetCounter { get { throw null; } } public Azure.Search.Documents.Indexes.Models.SearchResourceCounter StorageSizeCounter { get { throw null; } } public Azure.Search.Documents.Indexes.Models.SearchResourceCounter SynonymMapCounter { get { throw null; } } } @@ -2343,7 +2463,9 @@ public static partial class SearchModelFactory public static Azure.Search.Documents.Models.SearchResultsPage SearchResultsPage(Azure.Search.Documents.Models.SearchResults results) { throw null; } public static Azure.Search.Documents.Models.SearchResults SearchResults(System.Collections.Generic.IEnumerable> values, long? totalCount, System.Collections.Generic.IDictionary> facets, double? coverage, Azure.Response rawResponse) { throw null; } public static Azure.Search.Documents.Models.SearchResult SearchResult(T document, double? score, System.Collections.Generic.IDictionary> highlights) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.Search.Documents.Indexes.Models.SearchServiceCounters SearchServiceCounters(Azure.Search.Documents.Indexes.Models.SearchResourceCounter documentCounter, Azure.Search.Documents.Indexes.Models.SearchResourceCounter indexCounter, Azure.Search.Documents.Indexes.Models.SearchResourceCounter indexerCounter, Azure.Search.Documents.Indexes.Models.SearchResourceCounter dataSourceCounter, Azure.Search.Documents.Indexes.Models.SearchResourceCounter storageSizeCounter, Azure.Search.Documents.Indexes.Models.SearchResourceCounter synonymMapCounter) { throw null; } + public static Azure.Search.Documents.Indexes.Models.SearchServiceCounters SearchServiceCounters(Azure.Search.Documents.Indexes.Models.SearchResourceCounter documentCounter, Azure.Search.Documents.Indexes.Models.SearchResourceCounter indexCounter, Azure.Search.Documents.Indexes.Models.SearchResourceCounter indexerCounter, Azure.Search.Documents.Indexes.Models.SearchResourceCounter dataSourceCounter, Azure.Search.Documents.Indexes.Models.SearchResourceCounter storageSizeCounter, Azure.Search.Documents.Indexes.Models.SearchResourceCounter synonymMapCounter, Azure.Search.Documents.Indexes.Models.SearchResourceCounter skillsetCounter) { throw null; } public static Azure.Search.Documents.Indexes.Models.SearchServiceLimits SearchServiceLimits(int? maxFieldsPerIndex, int? maxFieldNestingDepthPerIndex, int? maxComplexCollectionFieldsPerIndex, int? maxComplexObjectsInCollectionsPerDocument) { throw null; } public static Azure.Search.Documents.Indexes.Models.SearchServiceStatistics SearchServiceStatistics(Azure.Search.Documents.Indexes.Models.SearchServiceCounters counters, Azure.Search.Documents.Indexes.Models.SearchServiceLimits limits) { throw null; } public static Azure.Search.Documents.Models.SearchSuggestion SearchSuggestion(T document, string text) { throw null; } diff --git a/sdk/search/Azure.Search.Documents/src/Generated/DataSourcesRestClient.cs b/sdk/search/Azure.Search.Documents/src/Generated/DataSourcesRestClient.cs index 81e7fd264be8..a8cb0f0f7b2d 100644 --- a/sdk/search/Azure.Search.Documents/src/Generated/DataSourcesRestClient.cs +++ b/sdk/search/Azure.Search.Documents/src/Generated/DataSourcesRestClient.cs @@ -31,7 +31,7 @@ internal partial class DataSourcesRestClient /// The tracking ID sent with the request to help with debugging. /// Api Version. /// or is null. - public DataSourcesRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string endpoint, Guid? xMsClientRequestId = null, string apiVersion = "2020-06-30") + public DataSourcesRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string endpoint, Guid? xMsClientRequestId = null, string apiVersion = "2020-06-30-Preview") { if (endpoint == null) { diff --git a/sdk/search/Azure.Search.Documents/src/Generated/DocumentsRestClient.cs b/sdk/search/Azure.Search.Documents/src/Generated/DocumentsRestClient.cs index 1b71013fd32e..1eee9ae8a2d4 100644 --- a/sdk/search/Azure.Search.Documents/src/Generated/DocumentsRestClient.cs +++ b/sdk/search/Azure.Search.Documents/src/Generated/DocumentsRestClient.cs @@ -34,7 +34,7 @@ internal partial class DocumentsRestClient /// The tracking ID sent with the request to help with debugging. /// Api Version. /// , , or is null. - public DocumentsRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string endpoint, string indexName, Guid? xMsClientRequestId = null, string apiVersion = "2020-06-30") + public DocumentsRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string endpoint, string indexName, Guid? xMsClientRequestId = null, string apiVersion = "2020-06-30-Preview") { if (endpoint == null) { diff --git a/sdk/search/Azure.Search.Documents/src/Generated/IndexersRestClient.cs b/sdk/search/Azure.Search.Documents/src/Generated/IndexersRestClient.cs index 02203a8013e7..b572f1c5f6e2 100644 --- a/sdk/search/Azure.Search.Documents/src/Generated/IndexersRestClient.cs +++ b/sdk/search/Azure.Search.Documents/src/Generated/IndexersRestClient.cs @@ -31,7 +31,7 @@ internal partial class IndexersRestClient /// The tracking ID sent with the request to help with debugging. /// Api Version. /// or is null. - public IndexersRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string endpoint, Guid? xMsClientRequestId = null, string apiVersion = "2020-06-30") + public IndexersRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string endpoint, Guid? xMsClientRequestId = null, string apiVersion = "2020-06-30-Preview") { if (endpoint == null) { diff --git a/sdk/search/Azure.Search.Documents/src/Generated/IndexesRestClient.cs b/sdk/search/Azure.Search.Documents/src/Generated/IndexesRestClient.cs index 63beccf7bb11..e3adc8b886da 100644 --- a/sdk/search/Azure.Search.Documents/src/Generated/IndexesRestClient.cs +++ b/sdk/search/Azure.Search.Documents/src/Generated/IndexesRestClient.cs @@ -31,7 +31,7 @@ internal partial class IndexesRestClient /// The tracking ID sent with the request to help with debugging. /// Api Version. /// or is null. - public IndexesRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string endpoint, Guid? xMsClientRequestId = null, string apiVersion = "2020-06-30") + public IndexesRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string endpoint, Guid? xMsClientRequestId = null, string apiVersion = "2020-06-30-Preview") { if (endpoint == null) { diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/AnswerResult.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/AnswerResult.Serialization.cs new file mode 100644 index 000000000000..2e1eaac67f9e --- /dev/null +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/AnswerResult.Serialization.cs @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Models +{ + internal partial class AnswerResult + { + internal static AnswerResult DeserializeAnswerResult(JsonElement element) + { + Optional score = default; + Optional key = default; + Optional text = default; + Optional highlights = default; + IReadOnlyDictionary additionalProperties = default; + Dictionary additionalPropertiesDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("score")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + score = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("key")) + { + key = property.Value.GetString(); + continue; + } + if (property.NameEquals("text")) + { + text = property.Value.GetString(); + continue; + } + if (property.NameEquals("highlights")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + highlights = null; + continue; + } + highlights = property.Value.GetString(); + continue; + } + additionalPropertiesDictionary.Add(property.Name, property.Value.GetObject()); + } + additionalProperties = additionalPropertiesDictionary; + return new AnswerResult(Optional.ToNullable(score), key.Value, text.Value, highlights.Value, additionalProperties); + } + } +} diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/AnswerResult.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/AnswerResult.cs new file mode 100644 index 000000000000..4c52e6b2f068 --- /dev/null +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/AnswerResult.cs @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Search.Documents.Models +{ + /// 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. + internal partial class AnswerResult : IReadOnlyDictionary + { + /// Initializes a new instance of AnswerResult. + internal AnswerResult() + { + AdditionalProperties = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of AnswerResult. + /// The score value represents how relevant the answer is to the the query relative to other answers returned for the query. + /// The key of the document the answer was extracted from. + /// The text passage extracted from the document contents as the answer. + /// Same text passage as in the Text property with highlighted text phrases most relevant to the query. + /// . + internal AnswerResult(double? score, string key, string text, string highlights, IReadOnlyDictionary additionalProperties) + { + Score = score; + Key = key; + Text = text; + Highlights = highlights; + AdditionalProperties = additionalProperties; + } + + /// The score value represents how relevant the answer is to the the query relative to other answers returned for the query. + public double? Score { get; } + /// The key of the document the answer was extracted from. + public string Key { get; } + /// The text passage extracted from the document contents as the answer. + public string Text { get; } + /// Same text passage as in the Text property with highlighted text phrases most relevant to the query. + public string Highlights { get; } + internal IReadOnlyDictionary AdditionalProperties { get; } + /// + public IEnumerator> GetEnumerator() => AdditionalProperties.GetEnumerator(); + /// + IEnumerator IEnumerable.GetEnumerator() => AdditionalProperties.GetEnumerator(); + /// + public bool TryGetValue(string key, out object value) => AdditionalProperties.TryGetValue(key, out value); + /// + public bool ContainsKey(string key) => AdditionalProperties.ContainsKey(key); + /// + public IEnumerable Keys => AdditionalProperties.Keys; + /// + public IEnumerable Values => AdditionalProperties.Values; + /// + int IReadOnlyCollection>.Count => AdditionalProperties.Count; + /// + public object this[string key] + { + get => AdditionalProperties[key]; + } + } +} diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/Answers.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/Answers.cs new file mode 100644 index 000000000000..d76f7361bb07 --- /dev/null +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/Answers.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Search.Documents.Models +{ + /// 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. + internal readonly partial struct Answers : IEquatable + { + private readonly string _value; + + /// Determines if two values are the same. + /// is null. + public Answers(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NoneValue = "none"; + private const string ExtractiveValue = "extractive"; + + /// Do not return answers for the query. + public static Answers None { get; } = new Answers(NoneValue); + /// Extracts answer candidates from the contents of the documents returned in response to a query expressed as a question in natural language. + public static Answers Extractive { get; } = new Answers(ExtractiveValue); + /// Determines if two values are the same. + public static bool operator ==(Answers left, Answers right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(Answers left, Answers right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator Answers(string value) => new Answers(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is Answers other && Equals(other); + /// + public bool Equals(Answers other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/CaptionResult.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/CaptionResult.Serialization.cs new file mode 100644 index 000000000000..9ef17c224ec8 --- /dev/null +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/CaptionResult.Serialization.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Models +{ + internal partial class CaptionResult + { + internal static CaptionResult DeserializeCaptionResult(JsonElement element) + { + Optional text = default; + Optional highlights = default; + IReadOnlyDictionary additionalProperties = default; + Dictionary additionalPropertiesDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("text")) + { + text = property.Value.GetString(); + continue; + } + if (property.NameEquals("highlights")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + highlights = null; + continue; + } + highlights = property.Value.GetString(); + continue; + } + additionalPropertiesDictionary.Add(property.Name, property.Value.GetObject()); + } + additionalProperties = additionalPropertiesDictionary; + return new CaptionResult(text.Value, highlights.Value, additionalProperties); + } + } +} diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/CaptionResult.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/CaptionResult.cs new file mode 100644 index 000000000000..56961143feeb --- /dev/null +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/CaptionResult.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Search.Documents.Models +{ + /// 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'.. + internal partial class CaptionResult : IReadOnlyDictionary + { + /// Initializes a new instance of CaptionResult. + internal CaptionResult() + { + AdditionalProperties = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of CaptionResult. + /// A representative text passage extracted from the document most relevant to the search query. + /// Same text passage as in the Text property with highlighted phrases most relevant to the query. + /// . + internal CaptionResult(string text, string highlights, IReadOnlyDictionary additionalProperties) + { + Text = text; + Highlights = highlights; + AdditionalProperties = additionalProperties; + } + + /// A representative text passage extracted from the document most relevant to the search query. + public string Text { get; } + /// Same text passage as in the Text property with highlighted phrases most relevant to the query. + public string Highlights { get; } + internal IReadOnlyDictionary AdditionalProperties { get; } + /// + public IEnumerator> GetEnumerator() => AdditionalProperties.GetEnumerator(); + /// + IEnumerator IEnumerable.GetEnumerator() => AdditionalProperties.GetEnumerator(); + /// + public bool TryGetValue(string key, out object value) => AdditionalProperties.TryGetValue(key, out value); + /// + public bool ContainsKey(string key) => AdditionalProperties.ContainsKey(key); + /// + public IEnumerable Keys => AdditionalProperties.Keys; + /// + public IEnumerable Values => AdditionalProperties.Values; + /// + int IReadOnlyCollection>.Count => AdditionalProperties.Count; + /// + public object this[string key] + { + get => AdditionalProperties[key]; + } + } +} diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/CharFilterName.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/CharFilterName.cs index 6a855b81b9f7..c22804bed92d 100644 --- a/sdk/search/Azure.Search.Documents/src/Generated/Models/CharFilterName.cs +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/CharFilterName.cs @@ -11,7 +11,7 @@ namespace Azure.Search.Documents.Indexes.Models { /// Defines the names of all character filters supported by Azure Cognitive Search. - internal readonly partial struct CharFilterName : IEquatable + public readonly partial struct CharFilterName : IEquatable { private readonly string _value; diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/CustomEntity.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/CustomEntity.Serialization.cs new file mode 100644 index 000000000000..ba8690140c99 --- /dev/null +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/CustomEntity.Serialization.cs @@ -0,0 +1,301 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes.Models +{ + public partial class CustomEntity : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("name"); + writer.WriteStringValue(Name); + if (Optional.IsDefined(Description)) + { + if (Description != null) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(Description); + } + else + { + writer.WriteNull("description"); + } + } + if (Optional.IsDefined(Type)) + { + if (Type != null) + { + writer.WritePropertyName("type"); + writer.WriteStringValue(Type); + } + else + { + writer.WriteNull("type"); + } + } + if (Optional.IsDefined(Subtype)) + { + if (Subtype != null) + { + writer.WritePropertyName("subtype"); + writer.WriteStringValue(Subtype); + } + else + { + writer.WriteNull("subtype"); + } + } + if (Optional.IsDefined(Id)) + { + if (Id != null) + { + writer.WritePropertyName("id"); + writer.WriteStringValue(Id); + } + else + { + writer.WriteNull("id"); + } + } + if (Optional.IsDefined(CaseSensitive)) + { + if (CaseSensitive != null) + { + writer.WritePropertyName("caseSensitive"); + writer.WriteBooleanValue(CaseSensitive.Value); + } + else + { + writer.WriteNull("caseSensitive"); + } + } + if (Optional.IsDefined(AccentSensitive)) + { + if (AccentSensitive != null) + { + writer.WritePropertyName("accentSensitive"); + writer.WriteBooleanValue(AccentSensitive.Value); + } + else + { + writer.WriteNull("accentSensitive"); + } + } + if (Optional.IsDefined(FuzzyEditDistance)) + { + if (FuzzyEditDistance != null) + { + writer.WritePropertyName("fuzzyEditDistance"); + writer.WriteNumberValue(FuzzyEditDistance.Value); + } + else + { + writer.WriteNull("fuzzyEditDistance"); + } + } + if (Optional.IsDefined(DefaultCaseSensitive)) + { + if (DefaultCaseSensitive != null) + { + writer.WritePropertyName("defaultCaseSensitive"); + writer.WriteBooleanValue(DefaultCaseSensitive.Value); + } + else + { + writer.WriteNull("defaultCaseSensitive"); + } + } + if (Optional.IsDefined(DefaultAccentSensitive)) + { + if (DefaultAccentSensitive != null) + { + writer.WritePropertyName("defaultAccentSensitive"); + writer.WriteBooleanValue(DefaultAccentSensitive.Value); + } + else + { + writer.WriteNull("defaultAccentSensitive"); + } + } + if (Optional.IsDefined(DefaultFuzzyEditDistance)) + { + if (DefaultFuzzyEditDistance != null) + { + writer.WritePropertyName("defaultFuzzyEditDistance"); + writer.WriteNumberValue(DefaultFuzzyEditDistance.Value); + } + else + { + writer.WriteNull("defaultFuzzyEditDistance"); + } + } + if (Optional.IsCollectionDefined(Aliases)) + { + if (Aliases != null) + { + writer.WritePropertyName("aliases"); + writer.WriteStartArray(); + foreach (var item in Aliases) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + else + { + writer.WriteNull("aliases"); + } + } + writer.WriteEndObject(); + } + + internal static CustomEntity DeserializeCustomEntity(JsonElement element) + { + string name = default; + Optional description = default; + Optional type = default; + Optional subtype = default; + Optional id = default; + Optional caseSensitive = default; + Optional accentSensitive = default; + Optional fuzzyEditDistance = default; + Optional defaultCaseSensitive = default; + Optional defaultAccentSensitive = default; + Optional defaultFuzzyEditDistance = default; + Optional> aliases = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("description")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + description = null; + continue; + } + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + type = null; + continue; + } + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("subtype")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + subtype = null; + continue; + } + subtype = property.Value.GetString(); + continue; + } + if (property.NameEquals("id")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + id = null; + continue; + } + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("caseSensitive")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + caseSensitive = null; + continue; + } + caseSensitive = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("accentSensitive")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + accentSensitive = null; + continue; + } + accentSensitive = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("fuzzyEditDistance")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + fuzzyEditDistance = null; + continue; + } + fuzzyEditDistance = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("defaultCaseSensitive")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + defaultCaseSensitive = null; + continue; + } + defaultCaseSensitive = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("defaultAccentSensitive")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + defaultAccentSensitive = null; + continue; + } + defaultAccentSensitive = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("defaultFuzzyEditDistance")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + defaultFuzzyEditDistance = null; + continue; + } + defaultFuzzyEditDistance = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("aliases")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + aliases = null; + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(CustomEntityAlias.DeserializeCustomEntityAlias(item)); + } + aliases = array; + continue; + } + } + return new CustomEntity(name, description.Value, type.Value, subtype.Value, id.Value, Optional.ToNullable(caseSensitive), Optional.ToNullable(accentSensitive), Optional.ToNullable(fuzzyEditDistance), Optional.ToNullable(defaultCaseSensitive), Optional.ToNullable(defaultAccentSensitive), Optional.ToNullable(defaultFuzzyEditDistance), Optional.ToList(aliases)); + } + } +} diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/CustomEntity.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/CustomEntity.cs new file mode 100644 index 000000000000..c21790d977ae --- /dev/null +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/CustomEntity.cs @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes.Models +{ + /// An object that contains information about the matches that were found, and related metadata. + public partial class CustomEntity + { + /// Initializes a new instance of CustomEntity. + /// The top-level entity descriptor. Matches in the skill output will be grouped by this name, and it should represent the "normalized" form of the text being found. + /// is null. + public CustomEntity(string name) + { + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + Name = name; + Aliases = new ChangeTrackingList(); + } + + /// Initializes a new instance of CustomEntity. + /// The top-level entity descriptor. Matches in the skill output will be grouped by this name, and it should represent the "normalized" form of the text being found. + /// This field can be used as a passthrough for custom metadata about the matched text(s). The value of this field will appear with every match of its entity in the skill output. + /// This field can be used as a passthrough for custom metadata about the matched text(s). The value of this field will appear with every match of its entity in the skill output. + /// This field can be used as a passthrough for custom metadata about the matched text(s). The value of this field will appear with every match of its entity in the skill output. + /// This field can be used as a passthrough for custom metadata about the matched text(s). The value of this field will appear with every match of its entity in the skill output. + /// Defaults to false. Boolean value denoting whether comparisons with the entity name should be sensitive to character casing. Sample case insensitive matches of "Microsoft" could be: microsoft, microSoft, MICROSOFT. + /// Defaults to false. Boolean value denoting whether comparisons with the entity name should be sensitive to accent. + /// Defaults to 0. Maximum value of 5. Denotes the acceptable number of divergent characters that would still constitute a match with the entity name. The smallest possible fuzziness for any given match is returned. For instance, if the edit distance is set to 3, "Windows10" would still match "Windows", "Windows10" and "Windows 7". When case sensitivity is set to false, case differences do NOT count towards fuzziness tolerance, but otherwise do. + /// Changes the default case sensitivity value for this entity. It be used to change the default value of all aliases caseSensitive values. + /// Changes the default accent sensitivity value for this entity. It be used to change the default value of all aliases accentSensitive values. + /// Changes the default fuzzy edit distance value for this entity. It can be used to change the default value of all aliases fuzzyEditDistance values. + /// An array of complex objects that can be used to specify alternative spellings or synonyms to the root entity name. + internal CustomEntity(string name, string description, string type, string subtype, string id, bool? caseSensitive, bool? accentSensitive, int? fuzzyEditDistance, bool? defaultCaseSensitive, bool? defaultAccentSensitive, int? defaultFuzzyEditDistance, IList aliases) + { + Name = name; + Description = description; + Type = type; + Subtype = subtype; + Id = id; + CaseSensitive = caseSensitive; + AccentSensitive = accentSensitive; + FuzzyEditDistance = fuzzyEditDistance; + DefaultCaseSensitive = defaultCaseSensitive; + DefaultAccentSensitive = defaultAccentSensitive; + DefaultFuzzyEditDistance = defaultFuzzyEditDistance; + Aliases = aliases; + } + + /// The top-level entity descriptor. Matches in the skill output will be grouped by this name, and it should represent the "normalized" form of the text being found. + public string Name { get; set; } + /// This field can be used as a passthrough for custom metadata about the matched text(s). The value of this field will appear with every match of its entity in the skill output. + public string Description { get; set; } + /// This field can be used as a passthrough for custom metadata about the matched text(s). The value of this field will appear with every match of its entity in the skill output. + public string Type { get; set; } + /// This field can be used as a passthrough for custom metadata about the matched text(s). The value of this field will appear with every match of its entity in the skill output. + public string Subtype { get; set; } + /// This field can be used as a passthrough for custom metadata about the matched text(s). The value of this field will appear with every match of its entity in the skill output. + public string Id { get; set; } + /// Defaults to false. Boolean value denoting whether comparisons with the entity name should be sensitive to character casing. Sample case insensitive matches of "Microsoft" could be: microsoft, microSoft, MICROSOFT. + public bool? CaseSensitive { get; set; } + /// Defaults to false. Boolean value denoting whether comparisons with the entity name should be sensitive to accent. + public bool? AccentSensitive { get; set; } + /// Defaults to 0. Maximum value of 5. Denotes the acceptable number of divergent characters that would still constitute a match with the entity name. The smallest possible fuzziness for any given match is returned. For instance, if the edit distance is set to 3, "Windows10" would still match "Windows", "Windows10" and "Windows 7". When case sensitivity is set to false, case differences do NOT count towards fuzziness tolerance, but otherwise do. + public int? FuzzyEditDistance { get; set; } + /// Changes the default case sensitivity value for this entity. It be used to change the default value of all aliases caseSensitive values. + public bool? DefaultCaseSensitive { get; set; } + /// Changes the default accent sensitivity value for this entity. It be used to change the default value of all aliases accentSensitive values. + public bool? DefaultAccentSensitive { get; set; } + /// Changes the default fuzzy edit distance value for this entity. It can be used to change the default value of all aliases fuzzyEditDistance values. + public int? DefaultFuzzyEditDistance { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/CustomEntityAlias.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/CustomEntityAlias.Serialization.cs new file mode 100644 index 000000000000..b284bdea7dd9 --- /dev/null +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/CustomEntityAlias.Serialization.cs @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes.Models +{ + public partial class CustomEntityAlias : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("text"); + writer.WriteStringValue(Text); + if (Optional.IsDefined(CaseSensitive)) + { + if (CaseSensitive != null) + { + writer.WritePropertyName("caseSensitive"); + writer.WriteBooleanValue(CaseSensitive.Value); + } + else + { + writer.WriteNull("caseSensitive"); + } + } + if (Optional.IsDefined(AccentSensitive)) + { + if (AccentSensitive != null) + { + writer.WritePropertyName("accentSensitive"); + writer.WriteBooleanValue(AccentSensitive.Value); + } + else + { + writer.WriteNull("accentSensitive"); + } + } + if (Optional.IsDefined(FuzzyEditDistance)) + { + if (FuzzyEditDistance != null) + { + writer.WritePropertyName("fuzzyEditDistance"); + writer.WriteNumberValue(FuzzyEditDistance.Value); + } + else + { + writer.WriteNull("fuzzyEditDistance"); + } + } + writer.WriteEndObject(); + } + + internal static CustomEntityAlias DeserializeCustomEntityAlias(JsonElement element) + { + string text = default; + Optional caseSensitive = default; + Optional accentSensitive = default; + Optional fuzzyEditDistance = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("text")) + { + text = property.Value.GetString(); + continue; + } + if (property.NameEquals("caseSensitive")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + caseSensitive = null; + continue; + } + caseSensitive = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("accentSensitive")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + accentSensitive = null; + continue; + } + accentSensitive = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("fuzzyEditDistance")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + fuzzyEditDistance = null; + continue; + } + fuzzyEditDistance = property.Value.GetInt32(); + continue; + } + } + return new CustomEntityAlias(text, Optional.ToNullable(caseSensitive), Optional.ToNullable(accentSensitive), Optional.ToNullable(fuzzyEditDistance)); + } + } +} diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/CustomEntityAlias.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/CustomEntityAlias.cs new file mode 100644 index 000000000000..3ebe03e8ae91 --- /dev/null +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/CustomEntityAlias.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Search.Documents.Indexes.Models +{ + /// A complex object that can be used to specify alternative spellings or synonyms to the root entity name. + public partial class CustomEntityAlias + { + /// Initializes a new instance of CustomEntityAlias. + /// The text of the alias. + /// is null. + public CustomEntityAlias(string text) + { + if (text == null) + { + throw new ArgumentNullException(nameof(text)); + } + + Text = text; + } + + /// Initializes a new instance of CustomEntityAlias. + /// The text of the alias. + /// Determine if the alias is case sensitive. + /// Determine if the alias is accent sensitive. + /// Determine the fuzzy edit distance of the alias. + internal CustomEntityAlias(string text, bool? caseSensitive, bool? accentSensitive, int? fuzzyEditDistance) + { + Text = text; + CaseSensitive = caseSensitive; + AccentSensitive = accentSensitive; + FuzzyEditDistance = fuzzyEditDistance; + } + + /// The text of the alias. + public string Text { get; set; } + /// Determine if the alias is case sensitive. + public bool? CaseSensitive { get; set; } + /// Determine if the alias is accent sensitive. + public bool? AccentSensitive { get; set; } + /// Determine the fuzzy edit distance of the alias. + public int? FuzzyEditDistance { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/CustomEntityLookupSkill.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/CustomEntityLookupSkill.Serialization.cs new file mode 100644 index 000000000000..e990d0cb9bcd --- /dev/null +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/CustomEntityLookupSkill.Serialization.cs @@ -0,0 +1,255 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes.Models +{ + public partial class CustomEntityLookupSkill : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(DefaultLanguageCode)) + { + if (DefaultLanguageCode != null) + { + writer.WritePropertyName("defaultLanguageCode"); + writer.WriteStringValue(DefaultLanguageCode.Value.ToString()); + } + else + { + writer.WriteNull("defaultLanguageCode"); + } + } + if (Optional.IsDefined(EntitiesDefinitionUri)) + { + if (EntitiesDefinitionUri != null) + { + writer.WritePropertyName("entitiesDefinitionUri"); + writer.WriteStringValue(EntitiesDefinitionUri); + } + else + { + writer.WriteNull("entitiesDefinitionUri"); + } + } + if (Optional.IsCollectionDefined(InlineEntitiesDefinition)) + { + if (InlineEntitiesDefinition != null) + { + writer.WritePropertyName("inlineEntitiesDefinition"); + writer.WriteStartArray(); + foreach (var item in InlineEntitiesDefinition) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + else + { + writer.WriteNull("inlineEntitiesDefinition"); + } + } + if (Optional.IsDefined(GlobalDefaultCaseSensitive)) + { + if (GlobalDefaultCaseSensitive != null) + { + writer.WritePropertyName("globalDefaultCaseSensitive"); + writer.WriteBooleanValue(GlobalDefaultCaseSensitive.Value); + } + else + { + writer.WriteNull("globalDefaultCaseSensitive"); + } + } + if (Optional.IsDefined(GlobalDefaultAccentSensitive)) + { + if (GlobalDefaultAccentSensitive != null) + { + writer.WritePropertyName("globalDefaultAccentSensitive"); + writer.WriteBooleanValue(GlobalDefaultAccentSensitive.Value); + } + else + { + writer.WriteNull("globalDefaultAccentSensitive"); + } + } + if (Optional.IsDefined(GlobalDefaultFuzzyEditDistance)) + { + if (GlobalDefaultFuzzyEditDistance != null) + { + writer.WritePropertyName("globalDefaultFuzzyEditDistance"); + writer.WriteNumberValue(GlobalDefaultFuzzyEditDistance.Value); + } + else + { + writer.WriteNull("globalDefaultFuzzyEditDistance"); + } + } + writer.WritePropertyName("@odata.type"); + writer.WriteStringValue(ODataType); + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(Name); + } + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(Description); + } + if (Optional.IsDefined(Context)) + { + writer.WritePropertyName("context"); + writer.WriteStringValue(Context); + } + writer.WritePropertyName("inputs"); + writer.WriteStartArray(); + foreach (var item in Inputs) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + writer.WritePropertyName("outputs"); + writer.WriteStartArray(); + foreach (var item in Outputs) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + writer.WriteEndObject(); + } + + internal static CustomEntityLookupSkill DeserializeCustomEntityLookupSkill(JsonElement element) + { + Optional defaultLanguageCode = default; + Optional entitiesDefinitionUri = default; + Optional> inlineEntitiesDefinition = default; + Optional globalDefaultCaseSensitive = default; + Optional globalDefaultAccentSensitive = default; + Optional globalDefaultFuzzyEditDistance = default; + string odataType = default; + Optional name = default; + Optional description = default; + Optional context = default; + IList inputs = default; + IList outputs = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("defaultLanguageCode")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + defaultLanguageCode = null; + continue; + } + defaultLanguageCode = new CustomEntityLookupSkillLanguage(property.Value.GetString()); + continue; + } + if (property.NameEquals("entitiesDefinitionUri")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + entitiesDefinitionUri = null; + continue; + } + entitiesDefinitionUri = property.Value.GetString(); + continue; + } + if (property.NameEquals("inlineEntitiesDefinition")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + inlineEntitiesDefinition = null; + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(CustomEntity.DeserializeCustomEntity(item)); + } + inlineEntitiesDefinition = array; + continue; + } + if (property.NameEquals("globalDefaultCaseSensitive")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + globalDefaultCaseSensitive = null; + continue; + } + globalDefaultCaseSensitive = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("globalDefaultAccentSensitive")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + globalDefaultAccentSensitive = null; + continue; + } + globalDefaultAccentSensitive = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("globalDefaultFuzzyEditDistance")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + globalDefaultFuzzyEditDistance = null; + continue; + } + globalDefaultFuzzyEditDistance = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("@odata.type")) + { + odataType = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("description")) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("context")) + { + context = property.Value.GetString(); + continue; + } + if (property.NameEquals("inputs")) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(InputFieldMappingEntry.DeserializeInputFieldMappingEntry(item)); + } + inputs = array; + continue; + } + if (property.NameEquals("outputs")) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(OutputFieldMappingEntry.DeserializeOutputFieldMappingEntry(item)); + } + outputs = array; + continue; + } + } + return new CustomEntityLookupSkill(odataType, name.Value, description.Value, context.Value, inputs, outputs, Optional.ToNullable(defaultLanguageCode), entitiesDefinitionUri.Value, Optional.ToList(inlineEntitiesDefinition), Optional.ToNullable(globalDefaultCaseSensitive), Optional.ToNullable(globalDefaultAccentSensitive), Optional.ToNullable(globalDefaultFuzzyEditDistance)); + } + } +} diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/CustomEntityLookupSkill.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/CustomEntityLookupSkill.cs new file mode 100644 index 000000000000..0a8964dcaf07 --- /dev/null +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/CustomEntityLookupSkill.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes.Models +{ + /// A skill looks for text from a custom, user-defined list of words and phrases. + public partial class CustomEntityLookupSkill : SearchIndexerSkill + { + /// Initializes a new instance of CustomEntityLookupSkill. + /// Inputs of the skills could be a column in the source data set, or the output of an upstream skill. + /// The output of a skill is either a field in a search index, or a value that can be consumed as an input by another skill. + /// or is null. + public CustomEntityLookupSkill(IEnumerable inputs, IEnumerable outputs) : base(inputs, outputs) + { + if (inputs == null) + { + throw new ArgumentNullException(nameof(inputs)); + } + if (outputs == null) + { + throw new ArgumentNullException(nameof(outputs)); + } + + InlineEntitiesDefinition = new ChangeTrackingList(); + ODataType = "#Microsoft.Skills.Text.CustomEntityLookupSkill"; + } + + /// Initializes a new instance of CustomEntityLookupSkill. + /// Identifies the concrete type of the skill. + /// The name of the skill which uniquely identifies it within the skillset. A skill with no name defined will be given a default name of its 1-based index in the skills array, prefixed with the character '#'. + /// The description of the skill which describes the inputs, outputs, and usage of the skill. + /// Represents the level at which operations take place, such as the document root or document content (for example, /document or /document/content). The default is /document. + /// Inputs of the skills could be a column in the source data set, or the output of an upstream skill. + /// The output of a skill is either a field in a search index, or a value that can be consumed as an input by another skill. + /// A value indicating which language code to use. Default is en. + /// Path to a JSON or CSV file containing all the target text to match against. This entity definition is read at the beginning of an indexer run. Any updates to this file during an indexer run will not take effect until subsequent runs. This config must be accessible over HTTPS. + /// The inline CustomEntity definition. + /// A global flag for CaseSensitive. If CaseSensitive is not set in CustomEntity, this value will be the default value. + /// A global flag for AccentSensitive. If AccentSensitive is not set in CustomEntity, this value will be the default value. + /// A global flag for FuzzyEditDistance. If FuzzyEditDistance is not set in CustomEntity, this value will be the default value. + internal CustomEntityLookupSkill(string oDataType, string name, string description, string context, IList inputs, IList outputs, CustomEntityLookupSkillLanguage? defaultLanguageCode, string entitiesDefinitionUri, IList inlineEntitiesDefinition, bool? globalDefaultCaseSensitive, bool? globalDefaultAccentSensitive, int? globalDefaultFuzzyEditDistance) : base(oDataType, name, description, context, inputs, outputs) + { + DefaultLanguageCode = defaultLanguageCode; + EntitiesDefinitionUri = entitiesDefinitionUri; + InlineEntitiesDefinition = inlineEntitiesDefinition; + GlobalDefaultCaseSensitive = globalDefaultCaseSensitive; + GlobalDefaultAccentSensitive = globalDefaultAccentSensitive; + GlobalDefaultFuzzyEditDistance = globalDefaultFuzzyEditDistance; + ODataType = oDataType ?? "#Microsoft.Skills.Text.CustomEntityLookupSkill"; + } + + /// A value indicating which language code to use. Default is en. + public CustomEntityLookupSkillLanguage? DefaultLanguageCode { get; set; } + /// Path to a JSON or CSV file containing all the target text to match against. This entity definition is read at the beginning of an indexer run. Any updates to this file during an indexer run will not take effect until subsequent runs. This config must be accessible over HTTPS. + public string EntitiesDefinitionUri { get; set; } + /// A global flag for CaseSensitive. If CaseSensitive is not set in CustomEntity, this value will be the default value. + public bool? GlobalDefaultCaseSensitive { get; set; } + /// A global flag for AccentSensitive. If AccentSensitive is not set in CustomEntity, this value will be the default value. + public bool? GlobalDefaultAccentSensitive { get; set; } + /// A global flag for FuzzyEditDistance. If FuzzyEditDistance is not set in CustomEntity, this value will be the default value. + public int? GlobalDefaultFuzzyEditDistance { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/CustomEntityLookupSkillLanguage.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/CustomEntityLookupSkillLanguage.cs new file mode 100644 index 000000000000..34f8021d9540 --- /dev/null +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/CustomEntityLookupSkillLanguage.cs @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Search.Documents.Indexes.Models +{ + /// The language codes supported for input text by CustomEntityLookupSkill. + public readonly partial struct CustomEntityLookupSkillLanguage : IEquatable + { + private readonly string _value; + + /// Determines if two values are the same. + /// is null. + public CustomEntityLookupSkillLanguage(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string DaValue = "da"; + private const string DeValue = "de"; + private const string EnValue = "en"; + private const string EsValue = "es"; + private const string FiValue = "fi"; + private const string FrValue = "fr"; + private const string ItValue = "it"; + private const string KoValue = "ko"; + private const string PtValue = "pt"; + + /// Danish. + public static CustomEntityLookupSkillLanguage Da { get; } = new CustomEntityLookupSkillLanguage(DaValue); + /// German. + public static CustomEntityLookupSkillLanguage De { get; } = new CustomEntityLookupSkillLanguage(DeValue); + /// English. + public static CustomEntityLookupSkillLanguage En { get; } = new CustomEntityLookupSkillLanguage(EnValue); + /// Spanish. + public static CustomEntityLookupSkillLanguage Es { get; } = new CustomEntityLookupSkillLanguage(EsValue); + /// Finnish. + public static CustomEntityLookupSkillLanguage Fi { get; } = new CustomEntityLookupSkillLanguage(FiValue); + /// French. + public static CustomEntityLookupSkillLanguage Fr { get; } = new CustomEntityLookupSkillLanguage(FrValue); + /// Italian. + public static CustomEntityLookupSkillLanguage It { get; } = new CustomEntityLookupSkillLanguage(ItValue); + /// Korean. + public static CustomEntityLookupSkillLanguage Ko { get; } = new CustomEntityLookupSkillLanguage(KoValue); + /// Portuguese. + public static CustomEntityLookupSkillLanguage Pt { get; } = new CustomEntityLookupSkillLanguage(PtValue); + /// Determines if two values are the same. + public static bool operator ==(CustomEntityLookupSkillLanguage left, CustomEntityLookupSkillLanguage right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(CustomEntityLookupSkillLanguage left, CustomEntityLookupSkillLanguage right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator CustomEntityLookupSkillLanguage(string value) => new CustomEntityLookupSkillLanguage(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is CustomEntityLookupSkillLanguage other && Equals(other); + /// + public bool Equals(CustomEntityLookupSkillLanguage other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/CustomNormalizer.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/CustomNormalizer.Serialization.cs new file mode 100644 index 000000000000..be08391f9293 --- /dev/null +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/CustomNormalizer.Serialization.cs @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes.Models +{ + public partial class CustomNormalizer : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(TokenFilters)) + { + writer.WritePropertyName("tokenFilters"); + writer.WriteStartArray(); + foreach (var item in TokenFilters) + { + writer.WriteStringValue(item.ToString()); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(CharFilters)) + { + writer.WritePropertyName("charFilters"); + writer.WriteStartArray(); + foreach (var item in CharFilters) + { + writer.WriteStringValue(item.ToString()); + } + writer.WriteEndArray(); + } + writer.WritePropertyName("@odata.type"); + writer.WriteStringValue(ODataType); + writer.WritePropertyName("name"); + writer.WriteStringValue(Name); + writer.WriteEndObject(); + } + + internal static CustomNormalizer DeserializeCustomNormalizer(JsonElement element) + { + Optional> tokenFilters = default; + Optional> charFilters = default; + string odataType = default; + string name = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("tokenFilters")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(new TokenFilterName(item.GetString())); + } + tokenFilters = array; + continue; + } + if (property.NameEquals("charFilters")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(new CharFilterName(item.GetString())); + } + charFilters = array; + continue; + } + if (property.NameEquals("@odata.type")) + { + odataType = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + } + return new CustomNormalizer(odataType, name, Optional.ToList(tokenFilters), Optional.ToList(charFilters)); + } + } +} diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/CustomNormalizer.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/CustomNormalizer.cs new file mode 100644 index 000000000000..e2f6d1a7d482 --- /dev/null +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/CustomNormalizer.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes.Models +{ + /// Allows you to configure normalization for filterable, sortable, and facetable fields, which by default operate with strict matching. This is a user-defined configuration consisting of at least one or more filters, which modify the token that is stored. + public partial class CustomNormalizer : LexicalNormalizer + { + /// Initializes a new instance of CustomNormalizer. + /// The name of the normalizer. It must only contain letters, digits, spaces, dashes or underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. It cannot end in '.microsoft' nor '.lucene', nor be named 'asciifolding', 'standard', 'lowercase', 'uppercase', or 'elision'. + /// is null. + public CustomNormalizer(string name) : base(name) + { + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + TokenFilters = new ChangeTrackingList(); + CharFilters = new ChangeTrackingList(); + ODataType = "#Microsoft.Azure.Search.CustomNormalizer"; + } + + /// Initializes a new instance of CustomNormalizer. + /// Identifies the concrete type of the normalizer. + /// The name of the normalizer. It must only contain letters, digits, spaces, dashes or underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. It cannot end in '.microsoft' nor '.lucene', nor be named 'asciifolding', 'standard', 'lowercase', 'uppercase', or 'elision'. + /// A list of token filters used to filter out or modify the input token. 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. + /// A list of character filters used to prepare input text before it is processed. For instance, they can replace certain characters or symbols. The filters are run in the order in which they are listed. + internal CustomNormalizer(string oDataType, string name, IList tokenFilters, IList charFilters) : base(oDataType, name) + { + TokenFilters = tokenFilters; + CharFilters = charFilters; + ODataType = oDataType ?? "#Microsoft.Azure.Search.CustomNormalizer"; + } + + /// A list of token filters used to filter out or modify the input token. 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. + public IList TokenFilters { get; } + /// A list of character filters used to prepare input text before it is processed. For instance, they can replace certain characters or symbols. The filters are run in the order in which they are listed. + public IList CharFilters { get; } + } +} diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/DataSourceCredentials.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/DataSourceCredentials.cs index f7a8cedb869a..62c66779e9af 100644 --- a/sdk/search/Azure.Search.Documents/src/Generated/Models/DataSourceCredentials.cs +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/DataSourceCredentials.cs @@ -16,13 +16,13 @@ public DataSourceCredentials() } /// Initializes a new instance of DataSourceCredentials. - /// The connection string for the datasource. + /// The connection string for the datasource. Set to '<unchanged>' if you do not want the connection string updated. internal DataSourceCredentials(string connectionString) { ConnectionString = connectionString; } - /// The connection string for the datasource. + /// The connection string for the datasource. Set to '<unchanged>' if you do not want the connection string updated. public string ConnectionString { get; set; } } } diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/DocumentExtractionSkill.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/DocumentExtractionSkill.Serialization.cs new file mode 100644 index 000000000000..d4a3298ee16e --- /dev/null +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/DocumentExtractionSkill.Serialization.cs @@ -0,0 +1,187 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes.Models +{ + public partial class DocumentExtractionSkill : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(ParsingMode)) + { + if (ParsingMode != null) + { + writer.WritePropertyName("parsingMode"); + writer.WriteStringValue(ParsingMode); + } + else + { + writer.WriteNull("parsingMode"); + } + } + if (Optional.IsDefined(DataToExtract)) + { + if (DataToExtract != null) + { + writer.WritePropertyName("dataToExtract"); + writer.WriteStringValue(DataToExtract); + } + else + { + writer.WriteNull("dataToExtract"); + } + } + if (Optional.IsCollectionDefined(Configuration)) + { + if (Configuration != null) + { + writer.WritePropertyName("configuration"); + writer.WriteStartObject(); + foreach (var item in Configuration) + { + writer.WritePropertyName(item.Key); + writer.WriteObjectValue(item.Value); + } + writer.WriteEndObject(); + } + else + { + writer.WriteNull("configuration"); + } + } + writer.WritePropertyName("@odata.type"); + writer.WriteStringValue(ODataType); + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(Name); + } + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(Description); + } + if (Optional.IsDefined(Context)) + { + writer.WritePropertyName("context"); + writer.WriteStringValue(Context); + } + writer.WritePropertyName("inputs"); + writer.WriteStartArray(); + foreach (var item in Inputs) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + writer.WritePropertyName("outputs"); + writer.WriteStartArray(); + foreach (var item in Outputs) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + writer.WriteEndObject(); + } + + internal static DocumentExtractionSkill DeserializeDocumentExtractionSkill(JsonElement element) + { + Optional parsingMode = default; + Optional dataToExtract = default; + Optional> configuration = default; + string odataType = default; + Optional name = default; + Optional description = default; + Optional context = default; + IList inputs = default; + IList outputs = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("parsingMode")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + parsingMode = null; + continue; + } + parsingMode = property.Value.GetString(); + continue; + } + if (property.NameEquals("dataToExtract")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + dataToExtract = null; + continue; + } + dataToExtract = property.Value.GetString(); + continue; + } + if (property.NameEquals("configuration")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + configuration = null; + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetObject()); + } + configuration = dictionary; + continue; + } + if (property.NameEquals("@odata.type")) + { + odataType = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("description")) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("context")) + { + context = property.Value.GetString(); + continue; + } + if (property.NameEquals("inputs")) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(InputFieldMappingEntry.DeserializeInputFieldMappingEntry(item)); + } + inputs = array; + continue; + } + if (property.NameEquals("outputs")) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(OutputFieldMappingEntry.DeserializeOutputFieldMappingEntry(item)); + } + outputs = array; + continue; + } + } + return new DocumentExtractionSkill(odataType, name.Value, description.Value, context.Value, inputs, outputs, parsingMode.Value, dataToExtract.Value, Optional.ToDictionary(configuration)); + } + } +} diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/DocumentExtractionSkill.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/DocumentExtractionSkill.cs new file mode 100644 index 000000000000..9fa856ce6e9b --- /dev/null +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/DocumentExtractionSkill.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes.Models +{ + /// A skill that extracts content from a file within the enrichment pipeline. + public partial class DocumentExtractionSkill : SearchIndexerSkill + { + /// Initializes a new instance of DocumentExtractionSkill. + /// Inputs of the skills could be a column in the source data set, or the output of an upstream skill. + /// The output of a skill is either a field in a search index, or a value that can be consumed as an input by another skill. + /// or is null. + public DocumentExtractionSkill(IEnumerable inputs, IEnumerable outputs) : base(inputs, outputs) + { + if (inputs == null) + { + throw new ArgumentNullException(nameof(inputs)); + } + if (outputs == null) + { + throw new ArgumentNullException(nameof(outputs)); + } + + Configuration = new ChangeTrackingDictionary(); + ODataType = "#Microsoft.Skills.Util.DocumentExtractionSkill"; + } + + /// Initializes a new instance of DocumentExtractionSkill. + /// Identifies the concrete type of the skill. + /// The name of the skill which uniquely identifies it within the skillset. A skill with no name defined will be given a default name of its 1-based index in the skills array, prefixed with the character '#'. + /// The description of the skill which describes the inputs, outputs, and usage of the skill. + /// Represents the level at which operations take place, such as the document root or document content (for example, /document or /document/content). The default is /document. + /// Inputs of the skills could be a column in the source data set, or the output of an upstream skill. + /// The output of a skill is either a field in a search index, or a value that can be consumed as an input by another skill. + /// The parsingMode for the skill. Will be set to 'default' if not defined. + /// The type of data to be extracted for the skill. Will be set to 'contentAndMetadata' if not defined. + /// A dictionary of configurations for the skill. + internal DocumentExtractionSkill(string oDataType, string name, string description, string context, IList inputs, IList outputs, string parsingMode, string dataToExtract, IDictionary configuration) : base(oDataType, name, description, context, inputs, outputs) + { + ParsingMode = parsingMode; + DataToExtract = dataToExtract; + Configuration = configuration; + ODataType = oDataType ?? "#Microsoft.Skills.Util.DocumentExtractionSkill"; + } + + /// The parsingMode for the skill. Will be set to 'default' if not defined. + public string ParsingMode { get; set; } + /// The type of data to be extracted for the skill. Will be set to 'contentAndMetadata' if not defined. + public string DataToExtract { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/KeyPhraseExtractionSkill.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/KeyPhraseExtractionSkill.Serialization.cs index 37d06a83d58c..5e1977fa4977 100644 --- a/sdk/search/Azure.Search.Documents/src/Generated/Models/KeyPhraseExtractionSkill.Serialization.cs +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/KeyPhraseExtractionSkill.Serialization.cs @@ -40,6 +40,18 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WriteNull("maxKeyPhraseCount"); } } + if (Optional.IsDefined(ModelVersion)) + { + if (ModelVersion != null) + { + writer.WritePropertyName("modelVersion"); + writer.WriteStringValue(ModelVersion); + } + else + { + writer.WriteNull("modelVersion"); + } + } writer.WritePropertyName("@odata.type"); writer.WriteStringValue(ODataType); if (Optional.IsDefined(Name)) @@ -78,6 +90,7 @@ internal static KeyPhraseExtractionSkill DeserializeKeyPhraseExtractionSkill(Jso { Optional defaultLanguageCode = default; Optional maxKeyPhraseCount = default; + Optional modelVersion = default; string odataType = default; Optional name = default; Optional description = default; @@ -106,6 +119,16 @@ internal static KeyPhraseExtractionSkill DeserializeKeyPhraseExtractionSkill(Jso maxKeyPhraseCount = property.Value.GetInt32(); continue; } + if (property.NameEquals("modelVersion")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + modelVersion = null; + continue; + } + modelVersion = property.Value.GetString(); + continue; + } if (property.NameEquals("@odata.type")) { odataType = property.Value.GetString(); @@ -147,7 +170,7 @@ internal static KeyPhraseExtractionSkill DeserializeKeyPhraseExtractionSkill(Jso continue; } } - return new KeyPhraseExtractionSkill(odataType, name.Value, description.Value, context.Value, inputs, outputs, Optional.ToNullable(defaultLanguageCode), Optional.ToNullable(maxKeyPhraseCount)); + return new KeyPhraseExtractionSkill(odataType, name.Value, description.Value, context.Value, inputs, outputs, Optional.ToNullable(defaultLanguageCode), Optional.ToNullable(maxKeyPhraseCount), modelVersion.Value); } } } diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/KeyPhraseExtractionSkill.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/KeyPhraseExtractionSkill.cs index 06e8937bbf66..1a379eb5ef1c 100644 --- a/sdk/search/Azure.Search.Documents/src/Generated/Models/KeyPhraseExtractionSkill.cs +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/KeyPhraseExtractionSkill.cs @@ -40,10 +40,12 @@ public KeyPhraseExtractionSkill(IEnumerable inputs, IEnu /// The output of a skill is either a field in a search index, or a value that can be consumed as an input by another skill. /// A value indicating which language code to use. Default is en. /// A number indicating how many key phrases to return. If absent, all identified key phrases will be returned. - internal KeyPhraseExtractionSkill(string oDataType, string name, string description, string context, IList inputs, IList outputs, KeyPhraseExtractionSkillLanguage? defaultLanguageCode, int? maxKeyPhraseCount) : base(oDataType, name, description, context, inputs, outputs) + /// The version of the model to use when calling the Text Analytics service. It will default to the latest available when not specified. We recommend you do not specify this value unless absolutely necessary. + internal KeyPhraseExtractionSkill(string oDataType, string name, string description, string context, IList inputs, IList outputs, KeyPhraseExtractionSkillLanguage? defaultLanguageCode, int? maxKeyPhraseCount, string modelVersion) : base(oDataType, name, description, context, inputs, outputs) { DefaultLanguageCode = defaultLanguageCode; MaxKeyPhraseCount = maxKeyPhraseCount; + ModelVersion = modelVersion; ODataType = oDataType ?? "#Microsoft.Skills.Text.KeyPhraseExtractionSkill"; } diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/LanguageDetectionSkill.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/LanguageDetectionSkill.Serialization.cs index 3b5a4717660b..e8ce0242e136 100644 --- a/sdk/search/Azure.Search.Documents/src/Generated/Models/LanguageDetectionSkill.Serialization.cs +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/LanguageDetectionSkill.Serialization.cs @@ -16,6 +16,30 @@ public partial class LanguageDetectionSkill : IUtf8JsonSerializable void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { writer.WriteStartObject(); + if (Optional.IsDefined(DefaultCountryHint)) + { + if (DefaultCountryHint != null) + { + writer.WritePropertyName("defaultCountryHint"); + writer.WriteStringValue(DefaultCountryHint); + } + else + { + writer.WriteNull("defaultCountryHint"); + } + } + if (Optional.IsDefined(ModelVersion)) + { + if (ModelVersion != null) + { + writer.WritePropertyName("modelVersion"); + writer.WriteStringValue(ModelVersion); + } + else + { + writer.WriteNull("modelVersion"); + } + } writer.WritePropertyName("@odata.type"); writer.WriteStringValue(ODataType); if (Optional.IsDefined(Name)) @@ -52,6 +76,8 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) internal static LanguageDetectionSkill DeserializeLanguageDetectionSkill(JsonElement element) { + Optional defaultCountryHint = default; + Optional modelVersion = default; string odataType = default; Optional name = default; Optional description = default; @@ -60,6 +86,26 @@ internal static LanguageDetectionSkill DeserializeLanguageDetectionSkill(JsonEle IList outputs = default; foreach (var property in element.EnumerateObject()) { + if (property.NameEquals("defaultCountryHint")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + defaultCountryHint = null; + continue; + } + defaultCountryHint = property.Value.GetString(); + continue; + } + if (property.NameEquals("modelVersion")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + modelVersion = null; + continue; + } + modelVersion = property.Value.GetString(); + continue; + } if (property.NameEquals("@odata.type")) { odataType = property.Value.GetString(); @@ -101,7 +147,7 @@ internal static LanguageDetectionSkill DeserializeLanguageDetectionSkill(JsonEle continue; } } - return new LanguageDetectionSkill(odataType, name.Value, description.Value, context.Value, inputs, outputs); + return new LanguageDetectionSkill(odataType, name.Value, description.Value, context.Value, inputs, outputs, defaultCountryHint.Value, modelVersion.Value); } } } diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/LanguageDetectionSkill.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/LanguageDetectionSkill.cs index 69b122030fbb..c0fea7175415 100644 --- a/sdk/search/Azure.Search.Documents/src/Generated/Models/LanguageDetectionSkill.cs +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/LanguageDetectionSkill.cs @@ -38,9 +38,16 @@ public LanguageDetectionSkill(IEnumerable inputs, IEnume /// Represents the level at which operations take place, such as the document root or document content (for example, /document or /document/content). The default is /document. /// Inputs of the skills could be a column in the source data set, or the output of an upstream skill. /// The output of a skill is either a field in a search index, or a value that can be consumed as an input by another skill. - internal LanguageDetectionSkill(string oDataType, string name, string description, string context, IList inputs, IList outputs) : base(oDataType, name, description, context, inputs, outputs) + /// A country code to use as a hint to the language detection model if it cannot disambiguate the language. + /// The version of the model to use when calling the Text Analytics service. It will default to the latest available when not specified. We recommend you do not specify this value unless absolutely necessary. + internal LanguageDetectionSkill(string oDataType, string name, string description, string context, IList inputs, IList outputs, string defaultCountryHint, string modelVersion) : base(oDataType, name, description, context, inputs, outputs) { + DefaultCountryHint = defaultCountryHint; + ModelVersion = modelVersion; ODataType = oDataType ?? "#Microsoft.Skills.Text.LanguageDetectionSkill"; } + + /// A country code to use as a hint to the language detection model if it cannot disambiguate the language. + public string DefaultCountryHint { get; set; } } } diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/LexicalNormalizer.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/LexicalNormalizer.Serialization.cs new file mode 100644 index 000000000000..c309b8a319c4 --- /dev/null +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/LexicalNormalizer.Serialization.cs @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes.Models +{ + public partial class LexicalNormalizer : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("@odata.type"); + writer.WriteStringValue(ODataType); + writer.WritePropertyName("name"); + writer.WriteStringValue(Name); + writer.WriteEndObject(); + } + + internal static LexicalNormalizer DeserializeLexicalNormalizer(JsonElement element) + { + if (element.TryGetProperty("@odata.type", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "#Microsoft.Azure.Search.CustomNormalizer": return CustomNormalizer.DeserializeCustomNormalizer(element); + } + } + string odataType = default; + string name = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("@odata.type")) + { + odataType = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + } + return new LexicalNormalizer(odataType, name); + } + } +} diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/LexicalNormalizer.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/LexicalNormalizer.cs new file mode 100644 index 000000000000..03e974bf369d --- /dev/null +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/LexicalNormalizer.cs @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Search.Documents.Indexes.Models +{ + /// Base type for normalizers. + public partial class LexicalNormalizer + { + /// Initializes a new instance of LexicalNormalizer. + /// The name of the normalizer. It must only contain letters, digits, spaces, dashes or underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. It cannot end in '.microsoft' nor '.lucene', nor be named 'asciifolding', 'standard', 'lowercase', 'uppercase', or 'elision'. + /// is null. + public LexicalNormalizer(string name) + { + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + Name = name; + } + + /// Initializes a new instance of LexicalNormalizer. + /// Identifies the concrete type of the normalizer. + /// The name of the normalizer. It must only contain letters, digits, spaces, dashes or underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. It cannot end in '.microsoft' nor '.lucene', nor be named 'asciifolding', 'standard', 'lowercase', 'uppercase', or 'elision'. + internal LexicalNormalizer(string oDataType, string name) + { + ODataType = oDataType; + Name = name; + } + + /// Identifies the concrete type of the normalizer. + internal string ODataType { get; set; } + /// The name of the normalizer. It must only contain letters, digits, spaces, dashes or underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. It cannot end in '.microsoft' nor '.lucene', nor be named 'asciifolding', 'standard', 'lowercase', 'uppercase', or 'elision'. + public string Name { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/LexicalNormalizerName.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/LexicalNormalizerName.cs new file mode 100644 index 000000000000..a087b7cf1f00 --- /dev/null +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/LexicalNormalizerName.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Search.Documents.Indexes.Models +{ + /// Defines the names of all text normalizers supported by Azure Cognitive Search. + public readonly partial struct LexicalNormalizerName : IEquatable + { + private readonly string _value; + + /// Determines if two values are the same. + /// is null. + public LexicalNormalizerName(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AsciiFoldingValue = "asciifolding"; + private const string ElisionValue = "elision"; + private const string LowercaseValue = "lowercase"; + private const string StandardValue = "standard"; + private const string UppercaseValue = "uppercase"; + + /// Converts alphabetic, numeric, and symbolic Unicode characters which are not in the first 127 ASCII characters (the "Basic Latin" Unicode block) into their ASCII equivalents, if such equivalents exist. See http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/miscellaneous/ASCIIFoldingFilter.html. + public static LexicalNormalizerName AsciiFolding { get; } = new LexicalNormalizerName(AsciiFoldingValue); + /// Removes elisions. For example, "l'avion" (the plane) will be converted to "avion" (plane). See http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/util/ElisionFilter.html. + public static LexicalNormalizerName Elision { get; } = new LexicalNormalizerName(ElisionValue); + /// Normalizes token text to lowercase. See https://lucene.apache.org/core/6_6_1/analyzers-common/org/apache/lucene/analysis/core/LowerCaseFilter.html. + public static LexicalNormalizerName Lowercase { get; } = new LexicalNormalizerName(LowercaseValue); + /// Standard normalizer, which consists of lowercase and asciifolding. See http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/reverse/ReverseStringFilter.html. + public static LexicalNormalizerName Standard { get; } = new LexicalNormalizerName(StandardValue); + /// Normalizes token text to uppercase. See https://lucene.apache.org/core/6_6_1/analyzers-common/org/apache/lucene/analysis/core/UpperCaseFilter.html. + public static LexicalNormalizerName Uppercase { get; } = new LexicalNormalizerName(UppercaseValue); + /// Determines if two values are the same. + public static bool operator ==(LexicalNormalizerName left, LexicalNormalizerName right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(LexicalNormalizerName left, LexicalNormalizerName right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator LexicalNormalizerName(string value) => new LexicalNormalizerName(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is LexicalNormalizerName other && Equals(other); + /// + public bool Equals(LexicalNormalizerName other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/QueryLanguage.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/QueryLanguage.cs new file mode 100644 index 000000000000..21923545dd22 --- /dev/null +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/QueryLanguage.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Search.Documents.Models +{ + /// The language of the query. + internal readonly partial struct QueryLanguage : IEquatable + { + private readonly string _value; + + /// Determines if two values are the same. + /// is null. + public QueryLanguage(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NoneValue = "none"; + private const string EnUsValue = "en-us"; + + /// Query language not specified. + public static QueryLanguage None { get; } = new QueryLanguage(NoneValue); + /// English. + public static QueryLanguage EnUs { get; } = new QueryLanguage(EnUsValue); + /// Determines if two values are the same. + public static bool operator ==(QueryLanguage left, QueryLanguage right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(QueryLanguage left, QueryLanguage right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator QueryLanguage(string value) => new QueryLanguage(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is QueryLanguage other && Equals(other); + /// + public bool Equals(QueryLanguage other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchDocumentsResult.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchDocumentsResult.Serialization.cs index a64bc3dee912..9d028c48d0f1 100644 --- a/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchDocumentsResult.Serialization.cs +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchDocumentsResult.Serialization.cs @@ -19,6 +19,7 @@ internal static SearchDocumentsResult DeserializeSearchDocumentsResult(JsonEleme Optional odataCount = default; Optional searchCoverage = default; Optional>> searchFacets = default; + Optional>> searchAnswers = default; Optional searchNextPageParameters = default; IReadOnlyList value = default; Optional odataNextLink = default; @@ -64,6 +65,26 @@ internal static SearchDocumentsResult DeserializeSearchDocumentsResult(JsonEleme searchFacets = dictionary; continue; } + if (property.NameEquals("@search.answers")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + searchAnswers = null; + continue; + } + Dictionary> dictionary = new Dictionary>(); + foreach (var property0 in property.Value.EnumerateObject()) + { + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(AnswerResult.DeserializeAnswerResult(item)); + } + dictionary.Add(property0.Name, array); + } + searchAnswers = dictionary; + continue; + } if (property.NameEquals("@search.nextPageParameters")) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -90,7 +111,7 @@ internal static SearchDocumentsResult DeserializeSearchDocumentsResult(JsonEleme continue; } } - return new SearchDocumentsResult(Optional.ToNullable(odataCount), Optional.ToNullable(searchCoverage), Optional.ToDictionary(searchFacets), searchNextPageParameters.Value, value, odataNextLink.Value); + return new SearchDocumentsResult(Optional.ToNullable(odataCount), Optional.ToNullable(searchCoverage), Optional.ToDictionary(searchFacets), Optional.ToDictionary(searchAnswers), searchNextPageParameters.Value, value, odataNextLink.Value); } } } diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchDocumentsResult.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchDocumentsResult.cs index 276cf49d54d3..6a51991855e9 100644 --- a/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchDocumentsResult.cs +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchDocumentsResult.cs @@ -27,6 +27,7 @@ internal SearchDocumentsResult(IEnumerable results) } Facets = new ChangeTrackingDictionary>(); + Answers = new ChangeTrackingDictionary>(); Results = results.ToList(); } @@ -34,14 +35,16 @@ internal SearchDocumentsResult(IEnumerable results) /// 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. /// A value indicating the percentage of the index that was included in the query, or null if minimumCoverage was not specified in the request. /// 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. + /// The answers query results for the search operation; null if the answers query parameter was not specified or set to 'none'. /// 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. /// The sequence of results returned by the query. /// 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. - internal SearchDocumentsResult(long? count, double? coverage, IReadOnlyDictionary> facets, SearchOptions nextPageParameters, IReadOnlyList results, string nextLink) + internal SearchDocumentsResult(long? count, double? coverage, IReadOnlyDictionary> facets, IReadOnlyDictionary> answers, SearchOptions nextPageParameters, IReadOnlyList results, string nextLink) { Count = count; Coverage = coverage; Facets = facets; + Answers = answers; NextPageParameters = nextPageParameters; Results = results; NextLink = nextLink; @@ -53,6 +56,8 @@ internal SearchDocumentsResult(long? count, double? coverage, IReadOnlyDictionar public double? Coverage { get; } /// 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. public IReadOnlyDictionary> Facets { get; } + /// The answers query results for the search operation; null if the answers query parameter was not specified or set to 'none'. + public IReadOnlyDictionary> Answers { get; } /// 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. public SearchOptions NextPageParameters { get; } /// The sequence of results returned by the query. diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchField.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchField.Serialization.cs index a0d01095846e..c03b1fd80d27 100644 --- a/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchField.Serialization.cs +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchField.Serialization.cs @@ -86,6 +86,18 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WriteNull("indexAnalyzer"); } } + if (Optional.IsDefined(Normalizer)) + { + if (Normalizer != null) + { + writer.WritePropertyName("normalizer"); + writer.WriteStringValue(Normalizer.Value.ToString()); + } + else + { + writer.WriteNull("normalizer"); + } + } if (Optional.IsCollectionDefined(SynonymMapNames)) { writer.WritePropertyName("synonymMaps"); @@ -122,6 +134,7 @@ internal static SearchField DeserializeSearchField(JsonElement element) Optional analyzer = default; Optional searchAnalyzer = default; Optional indexAnalyzer = default; + Optional normalizer = default; Optional> synonymMaps = default; Optional> fields = default; foreach (var property in element.EnumerateObject()) @@ -226,6 +239,16 @@ internal static SearchField DeserializeSearchField(JsonElement element) indexAnalyzer = new LexicalAnalyzerName(property.Value.GetString()); continue; } + if (property.NameEquals("normalizer")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + normalizer = null; + continue; + } + normalizer = new LexicalNormalizerName(property.Value.GetString()); + continue; + } if (property.NameEquals("synonymMaps")) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -257,7 +280,7 @@ internal static SearchField DeserializeSearchField(JsonElement element) continue; } } - return new SearchField(name, type, Optional.ToNullable(key), Optional.ToNullable(retrievable), Optional.ToNullable(searchable), Optional.ToNullable(filterable), Optional.ToNullable(sortable), Optional.ToNullable(facetable), Optional.ToNullable(analyzer), Optional.ToNullable(searchAnalyzer), Optional.ToNullable(indexAnalyzer), Optional.ToList(synonymMaps), Optional.ToList(fields)); + return new SearchField(name, type, Optional.ToNullable(key), Optional.ToNullable(retrievable), Optional.ToNullable(searchable), Optional.ToNullable(filterable), Optional.ToNullable(sortable), Optional.ToNullable(facetable), Optional.ToNullable(analyzer), Optional.ToNullable(searchAnalyzer), Optional.ToNullable(indexAnalyzer), Optional.ToNullable(normalizer), Optional.ToList(synonymMaps), Optional.ToList(fields)); } } } diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchField.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchField.cs index 87810645fbd6..734ef97d6c04 100644 --- a/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchField.cs +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchField.cs @@ -27,9 +27,10 @@ public partial class SearchField /// The name of the 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. Must be null for complex fields. /// 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 property cannot be set to the name of a language analyzer; use the analyzer property instead if you need a language analyzer. This analyzer can be updated on an existing field. Must be null for complex fields. /// 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. This property cannot be set to the name of a language analyzer; use the analyzer property instead if you need a language analyzer. Once the analyzer is chosen, it cannot be changed for the field. Must be null for complex fields. + /// The name of the normalizer to use for the field. This option can be used only with fields with filterable, sortable, or facetable enabled. Once the normalizer is chosen, it cannot be changed for the field. Must be null for complex fields. /// 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. Must be null or an empty collection for complex fields. /// A list of sub-fields if this is a field of type Edm.ComplexType or Collection(Edm.ComplexType). Must be null or empty for simple fields. - internal SearchField(string name, SearchFieldDataType type, bool? isKey, bool? isRetrievable, bool? isSearchable, bool? isFilterable, bool? isSortable, bool? isFacetable, LexicalAnalyzerName? analyzerName, LexicalAnalyzerName? searchAnalyzerName, LexicalAnalyzerName? indexAnalyzerName, IList synonymMapNames, IList fields) + internal SearchField(string name, SearchFieldDataType type, bool? isKey, bool? isRetrievable, bool? isSearchable, bool? isFilterable, bool? isSortable, bool? isFacetable, LexicalAnalyzerName? analyzerName, LexicalAnalyzerName? searchAnalyzerName, LexicalAnalyzerName? indexAnalyzerName, LexicalNormalizerName? normalizer, IList synonymMapNames, IList fields) { Name = name; Type = type; @@ -42,8 +43,11 @@ internal SearchField(string name, SearchFieldDataType type, bool? isKey, bool? i AnalyzerName = analyzerName; SearchAnalyzerName = searchAnalyzerName; IndexAnalyzerName = indexAnalyzerName; + Normalizer = normalizer; SynonymMapNames = synonymMapNames; Fields = fields; } + /// The name of the normalizer to use for the field. This option can be used only with fields with filterable, sortable, or facetable enabled. Once the normalizer is chosen, it cannot be changed for the field. Must be null for complex fields. + public LexicalNormalizerName? Normalizer { get; set; } } } diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchIndex.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchIndex.Serialization.cs index 95d6e5d3b7cc..79fdbf763ace 100644 --- a/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchIndex.Serialization.cs +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchIndex.Serialization.cs @@ -102,6 +102,16 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) } writer.WriteEndArray(); } + if (Optional.IsCollectionDefined(Normalizers)) + { + writer.WritePropertyName("normalizers"); + writer.WriteStartArray(); + foreach (var item in Normalizers) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } if (Optional.IsDefined(EncryptionKey)) { if (EncryptionKey != null) @@ -139,6 +149,7 @@ internal static SearchIndex DeserializeSearchIndex(JsonElement element) Optional> tokenizers = default; Optional> tokenFilters = default; Optional> charFilters = default; + Optional> normalizers = default; Optional encryptionKey = default; Optional similarity = default; Optional odataEtag = default; @@ -264,6 +275,21 @@ internal static SearchIndex DeserializeSearchIndex(JsonElement element) charFilters = array; continue; } + if (property.NameEquals("normalizers")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(LexicalNormalizer.DeserializeLexicalNormalizer(item)); + } + normalizers = array; + continue; + } if (property.NameEquals("encryptionKey")) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -290,7 +316,7 @@ internal static SearchIndex DeserializeSearchIndex(JsonElement element) continue; } } - return new SearchIndex(name, fields, Optional.ToList(scoringProfiles), defaultScoringProfile.Value, corsOptions.Value, Optional.ToList(suggesters), Optional.ToList(analyzers), Optional.ToList(tokenizers), Optional.ToList(tokenFilters), Optional.ToList(charFilters), encryptionKey.Value, similarity.Value, odataEtag.Value); + return new SearchIndex(name, fields, Optional.ToList(scoringProfiles), defaultScoringProfile.Value, corsOptions.Value, Optional.ToList(suggesters), Optional.ToList(analyzers), Optional.ToList(tokenizers), Optional.ToList(tokenFilters), Optional.ToList(charFilters), Optional.ToList(normalizers), encryptionKey.Value, similarity.Value, odataEtag.Value); } } } diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchIndex.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchIndex.cs index be7abd4513f9..361e635e5b2c 100644 --- a/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchIndex.cs +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchIndex.cs @@ -27,10 +27,11 @@ public partial class SearchIndex /// The tokenizers for the index. /// The token filters for the index. /// The character filters for the index. + /// The normalizers for the index. /// 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. /// 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. /// The ETag of the index. - internal SearchIndex(string name, IList Fields, IList scoringProfiles, string defaultScoringProfile, CorsOptions corsOptions, IList suggesters, IList analyzers, IList tokenizers, IList tokenFilters, IList charFilters, SearchResourceEncryptionKey encryptionKey, SimilarityAlgorithm similarity, string Etag) + internal SearchIndex(string name, IList Fields, IList scoringProfiles, string defaultScoringProfile, CorsOptions corsOptions, IList suggesters, IList analyzers, IList tokenizers, IList tokenFilters, IList charFilters, IList normalizers, SearchResourceEncryptionKey encryptionKey, SimilarityAlgorithm similarity, string Etag) { Name = name; _fields = Fields; @@ -42,6 +43,7 @@ internal SearchIndex(string name, IList Fields, IList Indicates an Azure SQL datasource. public static SearchIndexerDataSourceType AzureSql { get; } = new SearchIndexerDataSourceType(AzureSqlValue); /// Indicates a CosmosDB datasource. public static SearchIndexerDataSourceType CosmosDb { get; } = new SearchIndexerDataSourceType(CosmosDbValue); - /// Indicates a Azure Blob datasource. + /// Indicates an Azure Blob datasource. public static SearchIndexerDataSourceType AzureBlob { get; } = new SearchIndexerDataSourceType(AzureBlobValue); - /// Indicates a Azure Table datasource. + /// Indicates an Azure Table datasource. public static SearchIndexerDataSourceType AzureTable { get; } = new SearchIndexerDataSourceType(AzureTableValue); /// Indicates a MySql datasource. public static SearchIndexerDataSourceType MySql { get; } = new SearchIndexerDataSourceType(MySqlValue); + /// Indicates an ADLS Gen2 datasource. + public static SearchIndexerDataSourceType AdlsGen2 { get; } = new SearchIndexerDataSourceType(AdlsGen2Value); /// Determines if two values are the same. public static bool operator ==(SearchIndexerDataSourceType left, SearchIndexerDataSourceType right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchIndexerSkill.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchIndexerSkill.Serialization.cs index c6bf7dfc3b7d..79aecff2621d 100644 --- a/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchIndexerSkill.Serialization.cs +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchIndexerSkill.Serialization.cs @@ -57,6 +57,7 @@ internal static SearchIndexerSkill DeserializeSearchIndexerSkill(JsonElement ele switch (discriminator.GetString()) { case "#Microsoft.Skills.Custom.WebApiSkill": return WebApiSkill.DeserializeWebApiSkill(element); + case "#Microsoft.Skills.Text.CustomEntityLookupSkill": return CustomEntityLookupSkill.DeserializeCustomEntityLookupSkill(element); case "#Microsoft.Skills.Text.EntityRecognitionSkill": return EntityRecognitionSkill.DeserializeEntityRecognitionSkill(element); case "#Microsoft.Skills.Text.KeyPhraseExtractionSkill": return KeyPhraseExtractionSkill.DeserializeKeyPhraseExtractionSkill(element); case "#Microsoft.Skills.Text.LanguageDetectionSkill": return LanguageDetectionSkill.DeserializeLanguageDetectionSkill(element); @@ -65,6 +66,7 @@ internal static SearchIndexerSkill DeserializeSearchIndexerSkill(JsonElement ele case "#Microsoft.Skills.Text.SplitSkill": return SplitSkill.DeserializeSplitSkill(element); case "#Microsoft.Skills.Text.TranslationSkill": return TextTranslationSkill.DeserializeTextTranslationSkill(element); case "#Microsoft.Skills.Util.ConditionalSkill": return ConditionalSkill.DeserializeConditionalSkill(element); + case "#Microsoft.Skills.Util.DocumentExtractionSkill": return DocumentExtractionSkill.DeserializeDocumentExtractionSkill(element); case "#Microsoft.Skills.Util.ShaperSkill": return ShaperSkill.DeserializeShaperSkill(element); case "#Microsoft.Skills.Vision.ImageAnalysisSkill": return ImageAnalysisSkill.DeserializeImageAnalysisSkill(element); case "#Microsoft.Skills.Vision.OcrSkill": return OcrSkill.DeserializeOcrSkill(element); diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchOptions.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchOptions.Serialization.cs index 0cd1b5fe2a58..ac10b07dee21 100644 --- a/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchOptions.Serialization.cs +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchOptions.Serialization.cs @@ -107,6 +107,21 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("searchMode"); writer.WriteStringValue(SearchMode.Value.ToSerialString()); } + if (Optional.IsDefined(QueryLanguage)) + { + writer.WritePropertyName("queryLanguage"); + writer.WriteStringValue(QueryLanguage.Value.ToString()); + } + if (Optional.IsDefined(Speller)) + { + writer.WritePropertyName("speller"); + writer.WriteStringValue(Speller.Value.ToString()); + } + if (Optional.IsDefined(Answers)) + { + writer.WritePropertyName("answers"); + writer.WriteStringValue(Answers.Value.ToString()); + } if (Optional.IsDefined(SelectRaw)) { writer.WritePropertyName("select"); @@ -143,6 +158,9 @@ internal static SearchOptions DeserializeSearchOptions(JsonElement element) Optional search = default; Optional searchFields = default; Optional searchMode = default; + Optional queryLanguage = default; + Optional speller = default; + Optional answers = default; Optional select = default; Optional skip = default; Optional top = default; @@ -273,6 +291,36 @@ internal static SearchOptions DeserializeSearchOptions(JsonElement element) searchMode = property.Value.GetString().ToSearchMode(); continue; } + if (property.NameEquals("queryLanguage")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + queryLanguage = new QueryLanguage(property.Value.GetString()); + continue; + } + if (property.NameEquals("speller")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + speller = new Speller(property.Value.GetString()); + continue; + } + if (property.NameEquals("answers")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + answers = new Answers(property.Value.GetString()); + continue; + } if (property.NameEquals("select")) { select = property.Value.GetString(); @@ -299,7 +347,7 @@ internal static SearchOptions DeserializeSearchOptions(JsonElement element) continue; } } - return new SearchOptions(Optional.ToNullable(count), Optional.ToList(facets), filter.Value, highlight.Value, highlightPostTag.Value, highlightPreTag.Value, Optional.ToNullable(minimumCoverage), orderby.Value, Optional.ToNullable(queryType), Optional.ToNullable(scoringStatistics), sessionId.Value, Optional.ToList(scoringParameters), scoringProfile.Value, search.Value, searchFields.Value, Optional.ToNullable(searchMode), select.Value, Optional.ToNullable(skip), Optional.ToNullable(top)); + return new SearchOptions(Optional.ToNullable(count), Optional.ToList(facets), filter.Value, highlight.Value, highlightPostTag.Value, highlightPreTag.Value, Optional.ToNullable(minimumCoverage), orderby.Value, Optional.ToNullable(queryType), Optional.ToNullable(scoringStatistics), sessionId.Value, Optional.ToList(scoringParameters), scoringProfile.Value, search.Value, searchFields.Value, Optional.ToNullable(searchMode), Optional.ToNullable(queryLanguage), Optional.ToNullable(speller), Optional.ToNullable(answers), select.Value, Optional.ToNullable(skip), Optional.ToNullable(top)); } } } diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchOptions.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchOptions.cs index d7a917a083ef..4f32680ae67c 100644 --- a/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchOptions.cs +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchOptions.cs @@ -38,10 +38,13 @@ public SearchOptions() /// A full-text search query expression; Use "*" or omit this parameter to match all documents. /// 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. /// A value that specifies whether any or all of the search terms must be matched in order to count the document as a match. + /// A value that specifies the language of the search query. + /// A value that specified the type of the speller to use to spell-correct individual search query terms. + /// A value that specifies whether answers should be returned as part of the search response. /// The comma-separated list of fields to retrieve. If unspecified, all fields marked as retrievable in the schema are included. /// 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. /// 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. - internal SearchOptions(bool? includeTotalCount, IList facets, string filter, string highlightFieldsRaw, string highlightPostTag, string highlightPreTag, double? minimumCoverage, string orderByRaw, SearchQueryType? queryType, ScoringStatistics? scoringStatistics, string sessionId, IList scoringParameters, string scoringProfile, string searchText, string searchFieldsRaw, SearchMode? searchMode, string selectRaw, int? skip, int? size) + internal SearchOptions(bool? includeTotalCount, IList facets, string filter, string highlightFieldsRaw, string highlightPostTag, string highlightPreTag, double? minimumCoverage, string orderByRaw, SearchQueryType? queryType, ScoringStatistics? scoringStatistics, string sessionId, IList scoringParameters, string scoringProfile, string searchText, string searchFieldsRaw, SearchMode? searchMode, QueryLanguage? queryLanguage, Speller? speller, Answers? answers, string selectRaw, int? skip, int? size) { IncludeTotalCount = includeTotalCount; Facets = facets; @@ -59,6 +62,9 @@ internal SearchOptions(bool? includeTotalCount, IList facets, string fil SearchText = searchText; SearchFieldsRaw = searchFieldsRaw; SearchMode = searchMode; + QueryLanguage = queryLanguage; + Speller = speller; + Answers = answers; SelectRaw = selectRaw; Skip = skip; Size = size; diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchQueryType.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchQueryType.Serialization.cs index afa7cc79645b..223c6aa5e627 100644 --- a/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchQueryType.Serialization.cs +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchQueryType.Serialization.cs @@ -11,18 +11,5 @@ namespace Azure.Search.Documents.Models { internal static partial class SearchQueryTypeExtensions { - public static string ToSerialString(this SearchQueryType value) => value switch - { - SearchQueryType.Simple => "simple", - SearchQueryType.Full => "full", - _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown SearchQueryType value.") - }; - - public static SearchQueryType ToSearchQueryType(this string value) - { - if (string.Equals(value, "simple", StringComparison.InvariantCultureIgnoreCase)) return SearchQueryType.Simple; - if (string.Equals(value, "full", StringComparison.InvariantCultureIgnoreCase)) return SearchQueryType.Full; - throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown SearchQueryType value."); - } } } diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchResult.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchResult.Serialization.cs index ada5aa8fb853..90298e3ff0e9 100644 --- a/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchResult.Serialization.cs +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchResult.Serialization.cs @@ -16,7 +16,9 @@ internal partial class SearchResult internal static SearchResult DeserializeSearchResult(JsonElement element) { double searchScore = default; + Optional searchRerankerScore = default; Optional>> searchHighlights = default; + Optional>> searchCaptions = default; IReadOnlyDictionary additionalProperties = default; Dictionary additionalPropertiesDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -26,6 +28,16 @@ internal static SearchResult DeserializeSearchResult(JsonElement element) searchScore = property.Value.GetDouble(); continue; } + if (property.NameEquals("@search.rerankerScore")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + searchRerankerScore = null; + continue; + } + searchRerankerScore = property.Value.GetDouble(); + continue; + } if (property.NameEquals("@search.highlights")) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -46,10 +58,30 @@ internal static SearchResult DeserializeSearchResult(JsonElement element) searchHighlights = dictionary; continue; } + if (property.NameEquals("@search.captions")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + searchCaptions = null; + continue; + } + Dictionary> dictionary = new Dictionary>(); + foreach (var property0 in property.Value.EnumerateObject()) + { + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(CaptionResult.DeserializeCaptionResult(item)); + } + dictionary.Add(property0.Name, array); + } + searchCaptions = dictionary; + continue; + } additionalPropertiesDictionary.Add(property.Name, property.Value.GetObject()); } additionalProperties = additionalPropertiesDictionary; - return new SearchResult(searchScore, Optional.ToDictionary(searchHighlights), additionalProperties); + return new SearchResult(searchScore, Optional.ToNullable(searchRerankerScore), Optional.ToDictionary(searchHighlights), Optional.ToDictionary(searchCaptions), additionalProperties); } } } diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchResult.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchResult.cs index 360723e27930..dbe00ea49077 100644 --- a/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchResult.cs +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchResult.cs @@ -20,24 +20,33 @@ internal SearchResult(double score) { Score = score; Highlights = new ChangeTrackingDictionary>(); + Captions = new ChangeTrackingDictionary>(); AdditionalProperties = new ChangeTrackingDictionary(); } /// Initializes a new instance of SearchResult. /// The relevance score of the document compared to other documents returned by the query. + /// 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'. /// 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. + /// 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'. /// . - internal SearchResult(double score, IReadOnlyDictionary> highlights, IReadOnlyDictionary additionalProperties) + internal SearchResult(double score, double? rerankerScore, IReadOnlyDictionary> highlights, IReadOnlyDictionary> captions, IReadOnlyDictionary additionalProperties) { Score = score; + RerankerScore = rerankerScore; Highlights = highlights; + Captions = captions; AdditionalProperties = additionalProperties; } /// The relevance score of the document compared to other documents returned by the query. public double Score { get; } + /// 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'. + public double? RerankerScore { get; } /// 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. public IReadOnlyDictionary> Highlights { get; } + /// 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'. + public IReadOnlyDictionary> Captions { get; } internal IReadOnlyDictionary AdditionalProperties { get; } /// public IEnumerator> GetEnumerator() => AdditionalProperties.GetEnumerator(); diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchServiceCounters.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchServiceCounters.Serialization.cs index 8eb36a286572..8a270057fab7 100644 --- a/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchServiceCounters.Serialization.cs +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchServiceCounters.Serialization.cs @@ -20,6 +20,7 @@ internal static SearchServiceCounters DeserializeSearchServiceCounters(JsonEleme SearchResourceCounter dataSourcesCount = default; SearchResourceCounter storageSize = default; SearchResourceCounter synonymMaps = default; + SearchResourceCounter skillsetCount = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("documentCount")) @@ -52,8 +53,13 @@ internal static SearchServiceCounters DeserializeSearchServiceCounters(JsonEleme synonymMaps = SearchResourceCounter.DeserializeSearchResourceCounter(property.Value); continue; } + if (property.NameEquals("skillsetCount")) + { + skillsetCount = SearchResourceCounter.DeserializeSearchResourceCounter(property.Value); + continue; + } } - return new SearchServiceCounters(documentCount, indexesCount, indexersCount, dataSourcesCount, storageSize, synonymMaps); + return new SearchServiceCounters(documentCount, indexesCount, indexersCount, dataSourcesCount, storageSize, synonymMaps, skillsetCount); } } } diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchServiceCounters.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchServiceCounters.cs index b568e0702404..1c9495db075c 100644 --- a/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchServiceCounters.cs +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchServiceCounters.cs @@ -12,48 +12,6 @@ namespace Azure.Search.Documents.Indexes.Models /// Represents service-level resource counters and quotas. public partial class SearchServiceCounters { - /// Initializes a new instance of SearchServiceCounters. - /// Total number of documents across all indexes in the service. - /// Total number of indexes. - /// Total number of indexers. - /// Total number of data sources. - /// Total size of used storage in bytes. - /// Total number of synonym maps. - /// , , , , , or is null. - internal SearchServiceCounters(SearchResourceCounter documentCounter, SearchResourceCounter indexCounter, SearchResourceCounter indexerCounter, SearchResourceCounter dataSourceCounter, SearchResourceCounter storageSizeCounter, SearchResourceCounter synonymMapCounter) - { - if (documentCounter == null) - { - throw new ArgumentNullException(nameof(documentCounter)); - } - if (indexCounter == null) - { - throw new ArgumentNullException(nameof(indexCounter)); - } - if (indexerCounter == null) - { - throw new ArgumentNullException(nameof(indexerCounter)); - } - if (dataSourceCounter == null) - { - throw new ArgumentNullException(nameof(dataSourceCounter)); - } - if (storageSizeCounter == null) - { - throw new ArgumentNullException(nameof(storageSizeCounter)); - } - if (synonymMapCounter == null) - { - throw new ArgumentNullException(nameof(synonymMapCounter)); - } - - DocumentCounter = documentCounter; - IndexCounter = indexCounter; - IndexerCounter = indexerCounter; - DataSourceCounter = dataSourceCounter; - StorageSizeCounter = storageSizeCounter; - SynonymMapCounter = synonymMapCounter; - } /// Total number of documents across all indexes in the service. public SearchResourceCounter DocumentCounter { get; } @@ -67,5 +25,7 @@ internal SearchServiceCounters(SearchResourceCounter documentCounter, SearchReso public SearchResourceCounter StorageSizeCounter { get; } /// Total number of synonym maps. public SearchResourceCounter SynonymMapCounter { get; } + /// Total number of skillsets. + public SearchResourceCounter SkillsetCounter { get; } } } diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/Speller.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/Speller.cs new file mode 100644 index 000000000000..d005f593b311 --- /dev/null +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/Speller.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Search.Documents.Models +{ + /// Improve search recall by spell-correcting individual search query terms. + internal readonly partial struct Speller : IEquatable + { + private readonly string _value; + + /// Determines if two values are the same. + /// is null. + public Speller(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NoneValue = "none"; + private const string LexiconValue = "lexicon"; + + /// Speller not enabled. + public static Speller None { get; } = new Speller(NoneValue); + /// Speller corrects individual query terms using a static lexicon for the language specified by the queryLanguage parameter. + public static Speller Lexicon { get; } = new Speller(LexiconValue); + /// Determines if two values are the same. + public static bool operator ==(Speller left, Speller right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(Speller left, Speller right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator Speller(string value) => new Speller(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is Speller other && Equals(other); + /// + public bool Equals(Speller other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/TokenFilterName.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/TokenFilterName.cs index e765b262fb2e..bdc7d60270d3 100644 --- a/sdk/search/Azure.Search.Documents/src/Generated/Models/TokenFilterName.cs +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/TokenFilterName.cs @@ -89,7 +89,7 @@ public TokenFilterName(string value) public static TokenFilterName Length { get; } = new TokenFilterName(LengthValue); /// Limits the number of tokens while indexing. See http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/miscellaneous/LimitTokenCountFilter.html. public static TokenFilterName Limit { get; } = new TokenFilterName(LimitValue); - /// Normalizes token text to lower case. See http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/core/LowerCaseFilter.htm. + /// Normalizes token text to lower case. See https://lucene.apache.org/core/6_6_1/analyzers-common/org/apache/lucene/analysis/core/LowerCaseFilter.html. public static TokenFilterName Lowercase { get; } = new TokenFilterName(LowercaseValue); /// Generates n-grams of the given size(s). See http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/ngram/NGramTokenFilter.html. public static TokenFilterName NGram { get; } = new TokenFilterName(NGramValue); @@ -121,7 +121,7 @@ public TokenFilterName(string value) public static TokenFilterName Truncate { get; } = new TokenFilterName(TruncateValue); /// Filters out tokens with same text as the previous token. See http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/miscellaneous/RemoveDuplicatesTokenFilter.html. public static TokenFilterName Unique { get; } = new TokenFilterName(UniqueValue); - /// Normalizes token text to upper case. See http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/core/UpperCaseFilter.html. + /// Normalizes token text to upper case. See https://lucene.apache.org/core/6_6_1/analyzers-common/org/apache/lucene/analysis/core/UpperCaseFilter.html. public static TokenFilterName Uppercase { get; } = new TokenFilterName(UppercaseValue); /// Splits words into subwords and performs optional transformations on subword groups. public static TokenFilterName WordDelimiter { get; } = new TokenFilterName(WordDelimiterValue); diff --git a/sdk/search/Azure.Search.Documents/src/Generated/SearchServiceRestClient.cs b/sdk/search/Azure.Search.Documents/src/Generated/SearchServiceRestClient.cs index 407625510a35..88a43f9d49a5 100644 --- a/sdk/search/Azure.Search.Documents/src/Generated/SearchServiceRestClient.cs +++ b/sdk/search/Azure.Search.Documents/src/Generated/SearchServiceRestClient.cs @@ -31,7 +31,7 @@ internal partial class SearchServiceRestClient /// The tracking ID sent with the request to help with debugging. /// Api Version. /// or is null. - public SearchServiceRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string endpoint, Guid? xMsClientRequestId = null, string apiVersion = "2020-06-30") + public SearchServiceRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string endpoint, Guid? xMsClientRequestId = null, string apiVersion = "2020-06-30-Preview") { if (endpoint == null) { diff --git a/sdk/search/Azure.Search.Documents/src/Generated/SkillsetsRestClient.cs b/sdk/search/Azure.Search.Documents/src/Generated/SkillsetsRestClient.cs index 78a94622cb79..a8d153fca1e6 100644 --- a/sdk/search/Azure.Search.Documents/src/Generated/SkillsetsRestClient.cs +++ b/sdk/search/Azure.Search.Documents/src/Generated/SkillsetsRestClient.cs @@ -31,7 +31,7 @@ internal partial class SkillsetsRestClient /// The tracking ID sent with the request to help with debugging. /// Api Version. /// or is null. - public SkillsetsRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string endpoint, Guid? xMsClientRequestId = null, string apiVersion = "2020-06-30") + public SkillsetsRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string endpoint, Guid? xMsClientRequestId = null, string apiVersion = "2020-06-30-Preview") { if (endpoint == null) { diff --git a/sdk/search/Azure.Search.Documents/src/Generated/SynonymMapsRestClient.cs b/sdk/search/Azure.Search.Documents/src/Generated/SynonymMapsRestClient.cs index d19ce7c213fa..bfe4f2d995e4 100644 --- a/sdk/search/Azure.Search.Documents/src/Generated/SynonymMapsRestClient.cs +++ b/sdk/search/Azure.Search.Documents/src/Generated/SynonymMapsRestClient.cs @@ -31,7 +31,7 @@ internal partial class SynonymMapsRestClient /// The tracking ID sent with the request to help with debugging. /// Api Version. /// or is null. - public SynonymMapsRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string endpoint, Guid? xMsClientRequestId = null, string apiVersion = "2020-06-30") + public SynonymMapsRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string endpoint, Guid? xMsClientRequestId = null, string apiVersion = "2020-06-30-Preview") { if (endpoint == null) { diff --git a/sdk/search/Azure.Search.Documents/src/Indexes/Models/CustomEntity.cs b/sdk/search/Azure.Search.Documents/src/Indexes/Models/CustomEntity.cs new file mode 100644 index 000000000000..854f644e0318 --- /dev/null +++ b/sdk/search/Azure.Search.Documents/src/Indexes/Models/CustomEntity.cs @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes.Models +{ + public partial class CustomEntity + { + /// An array of complex objects that can be used to specify alternative spellings or synonyms to the root entity name. + public IList Aliases { get; } + } +} diff --git a/sdk/search/Azure.Search.Documents/src/Indexes/Models/CustomEntityLookupSkill.cs b/sdk/search/Azure.Search.Documents/src/Indexes/Models/CustomEntityLookupSkill.cs new file mode 100644 index 000000000000..fae2c6cbc4ec --- /dev/null +++ b/sdk/search/Azure.Search.Documents/src/Indexes/Models/CustomEntityLookupSkill.cs @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes.Models +{ + public partial class CustomEntityLookupSkill + { + /// The inline CustomEntity definition. + public IList InlineEntitiesDefinition { get; } + } +} diff --git a/sdk/search/Azure.Search.Documents/src/Indexes/Models/DocumentExtractionSkill.cs b/sdk/search/Azure.Search.Documents/src/Indexes/Models/DocumentExtractionSkill.cs new file mode 100644 index 000000000000..418b73eaacfe --- /dev/null +++ b/sdk/search/Azure.Search.Documents/src/Indexes/Models/DocumentExtractionSkill.cs @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes.Models +{ + public partial class DocumentExtractionSkill + { + /// A dictionary of configurations for the skill. + public IDictionary Configuration { get; } + } +} diff --git a/sdk/search/Azure.Search.Documents/src/Indexes/Models/KeyPhraseExtractionSkill.cs b/sdk/search/Azure.Search.Documents/src/Indexes/Models/KeyPhraseExtractionSkill.cs new file mode 100644 index 000000000000..4e2a9e82d303 --- /dev/null +++ b/sdk/search/Azure.Search.Documents/src/Indexes/Models/KeyPhraseExtractionSkill.cs @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace Azure.Search.Documents.Indexes.Models +{ + public partial class KeyPhraseExtractionSkill + { + /// The version of the model to use when calling the Text Analytics service. It will default to the latest available when not specified. We recommend you do not specify this value unless absolutely necessary. + internal string ModelVersion { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents/src/Indexes/Models/LanguageDetectionSkill.cs b/sdk/search/Azure.Search.Documents/src/Indexes/Models/LanguageDetectionSkill.cs new file mode 100644 index 000000000000..ca807292d8fe --- /dev/null +++ b/sdk/search/Azure.Search.Documents/src/Indexes/Models/LanguageDetectionSkill.cs @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace Azure.Search.Documents.Indexes.Models +{ + public partial class LanguageDetectionSkill + { + /// The version of the model to use when calling the Text Analytics service. + /// It will default to the latest available when not specified. We recommend you do not specify this value unless absolutely necessary. + /// + internal string ModelVersion { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents/src/Indexes/Models/SearchIndex.cs b/sdk/search/Azure.Search.Documents/src/Indexes/Models/SearchIndex.cs index f2391184cc1f..6d5cf755cfab 100644 --- a/sdk/search/Azure.Search.Documents/src/Indexes/Models/SearchIndex.cs +++ b/sdk/search/Azure.Search.Documents/src/Indexes/Models/SearchIndex.cs @@ -24,19 +24,8 @@ public partial class SearchIndex /// The name of the index. /// is an empty string. /// is null. - public SearchIndex(string name) + public SearchIndex(string name) : this(name, new List()) { - Argument.AssertNotNullOrEmpty(name, nameof(name)); - - Name = name; - - Analyzers = new ChangeTrackingList(); - CharFilters = new ChangeTrackingList(); - Fields = new List(); - ScoringProfiles = new ChangeTrackingList(); - Suggesters = new ChangeTrackingList(); - TokenFilters = new ChangeTrackingList(); - Tokenizers = new ChangeTrackingList(); } /// @@ -60,6 +49,7 @@ public SearchIndex(string name, IEnumerable fields) Suggesters = new ChangeTrackingList(); TokenFilters = new ChangeTrackingList(); Tokenizers = new ChangeTrackingList(); + Normalizers = new ChangeTrackingList(); } /// @@ -159,6 +149,11 @@ public IList Fields /// public IList Tokenizers { get; } + /// + /// Gets the normalizers for the index. + /// + public IList Normalizers { get; } + /// /// The of the . /// diff --git a/sdk/search/Azure.Search.Documents/src/Indexes/Models/SearchServiceCounters.cs b/sdk/search/Azure.Search.Documents/src/Indexes/Models/SearchServiceCounters.cs index 785c9675f5ca..ed46a2b4075b 100644 --- a/sdk/search/Azure.Search.Documents/src/Indexes/Models/SearchServiceCounters.cs +++ b/sdk/search/Azure.Search.Documents/src/Indexes/Models/SearchServiceCounters.cs @@ -1,6 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +using System; using Azure.Core; namespace Azure.Search.Documents.Indexes.Models @@ -8,5 +9,31 @@ namespace Azure.Search.Documents.Indexes.Models [CodeGenModel("ServiceCounters")] public partial class SearchServiceCounters { + /// Initializes a new instance of SearchServiceCounters. + /// Total number of documents across all indexes in the service. + /// Total number of indexes. + /// Total number of indexers. + /// Total number of data sources. + /// Total size of used storage in bytes. + /// Total number of synonym maps. + /// Total number of skillsets. + /// , , , , , or is null. + internal SearchServiceCounters( + SearchResourceCounter documentCounter, + SearchResourceCounter indexCounter, + SearchResourceCounter indexerCounter, + SearchResourceCounter dataSourceCounter, + SearchResourceCounter storageSizeCounter, + SearchResourceCounter synonymMapCounter, + SearchResourceCounter skillsetCounter) + { + DocumentCounter = documentCounter ?? throw new ArgumentNullException(nameof(documentCounter)); + IndexCounter = indexCounter ?? throw new ArgumentNullException(nameof(indexCounter)); + IndexerCounter = indexerCounter ?? throw new ArgumentNullException(nameof(indexerCounter)); + DataSourceCounter = dataSourceCounter ?? throw new ArgumentNullException(nameof(dataSourceCounter)); + StorageSizeCounter = storageSizeCounter ?? throw new ArgumentNullException(nameof(storageSizeCounter)); + SynonymMapCounter = synonymMapCounter ?? throw new ArgumentNullException(nameof(synonymMapCounter)); + SkillsetCounter = skillsetCounter; + } } } diff --git a/sdk/search/Azure.Search.Documents/src/Models/AnswerResult.cs b/sdk/search/Azure.Search.Documents/src/Models/AnswerResult.cs new file mode 100644 index 000000000000..f0ca11dc8130 --- /dev/null +++ b/sdk/search/Azure.Search.Documents/src/Models/AnswerResult.cs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace Azure.Search.Documents.Models +{ + internal partial class AnswerResult + { + } +} diff --git a/sdk/search/Azure.Search.Documents/src/Models/Answers.cs b/sdk/search/Azure.Search.Documents/src/Models/Answers.cs new file mode 100644 index 000000000000..119ab4311301 --- /dev/null +++ b/sdk/search/Azure.Search.Documents/src/Models/Answers.cs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace Azure.Search.Documents.Models +{ + internal readonly partial struct Answers + { + } +} diff --git a/sdk/search/Azure.Search.Documents/src/Models/CaptionResult.cs b/sdk/search/Azure.Search.Documents/src/Models/CaptionResult.cs new file mode 100644 index 000000000000..bcba71e4d6a5 --- /dev/null +++ b/sdk/search/Azure.Search.Documents/src/Models/CaptionResult.cs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace Azure.Search.Documents.Models +{ + internal partial class CaptionResult + { + } +} diff --git a/sdk/search/Azure.Search.Documents/src/Models/CharFilterName.cs b/sdk/search/Azure.Search.Documents/src/Models/CharFilterName.cs index 3b75fa2eca5c..7a74b304344b 100644 --- a/sdk/search/Azure.Search.Documents/src/Models/CharFilterName.cs +++ b/sdk/search/Azure.Search.Documents/src/Models/CharFilterName.cs @@ -3,7 +3,7 @@ namespace Azure.Search.Documents.Indexes.Models { - internal partial struct CharFilterName + public partial struct CharFilterName { } -} \ No newline at end of file +} diff --git a/sdk/search/Azure.Search.Documents/src/Models/QueryLanguage.cs b/sdk/search/Azure.Search.Documents/src/Models/QueryLanguage.cs new file mode 100644 index 000000000000..5153ae503232 --- /dev/null +++ b/sdk/search/Azure.Search.Documents/src/Models/QueryLanguage.cs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace Azure.Search.Documents.Models +{ + internal readonly partial struct QueryLanguage + { + } +} diff --git a/sdk/search/Azure.Search.Documents/src/Models/SearchModelFactory.cs b/sdk/search/Azure.Search.Documents/src/Models/SearchModelFactory.cs index 92a55973f922..85f5f4627d87 100644 --- a/sdk/search/Azure.Search.Documents/src/Models/SearchModelFactory.cs +++ b/sdk/search/Azure.Search.Documents/src/Models/SearchModelFactory.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using Azure.Search.Documents.Indexes.Models; namespace Azure.Search.Documents.Models @@ -204,6 +205,7 @@ public static SearchResourceCounter SearchResourceCounter( /// Total size of used storage in bytes. /// Total number of synonym maps. /// A new SearchServiceCounters instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] public static SearchServiceCounters SearchServiceCounters( SearchResourceCounter documentCounter, SearchResourceCounter indexCounter, @@ -211,7 +213,26 @@ public static SearchServiceCounters SearchServiceCounters( SearchResourceCounter dataSourceCounter, SearchResourceCounter storageSizeCounter, SearchResourceCounter synonymMapCounter) => - new SearchServiceCounters(documentCounter, indexCounter, indexerCounter, dataSourceCounter, storageSizeCounter, synonymMapCounter); + SearchServiceCounters(documentCounter, indexCounter, indexerCounter, dataSourceCounter, storageSizeCounter, synonymMapCounter, skillsetCounter: null); + + /// Initializes a new instance of SearchServiceCounters. + /// Total number of documents across all indexes in the service. + /// Total number of indexes. + /// Total number of indexers. + /// Total number of data sources. + /// Total size of used storage in bytes. + /// Total number of synonym maps. + /// Total number of skillsets. + /// A new SearchServiceCounters instance for mocking. + public static SearchServiceCounters SearchServiceCounters( + SearchResourceCounter documentCounter, + SearchResourceCounter indexCounter, + SearchResourceCounter indexerCounter, + SearchResourceCounter dataSourceCounter, + SearchResourceCounter storageSizeCounter, + SearchResourceCounter synonymMapCounter, + SearchResourceCounter skillsetCounter) => + new SearchServiceCounters(documentCounter, indexCounter, indexerCounter, dataSourceCounter, storageSizeCounter, synonymMapCounter, skillsetCounter); /// Initializes a new instance of SearchServiceLimits. /// The maximum allowed fields per index. diff --git a/sdk/search/Azure.Search.Documents/src/Models/SearchQueryType.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Models/SearchQueryType.Serialization.cs new file mode 100644 index 000000000000..97fc1c3d23fb --- /dev/null +++ b/sdk/search/Azure.Search.Documents/src/Models/SearchQueryType.Serialization.cs @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +#nullable disable + +using System; + +namespace Azure.Search.Documents.Models +{ + /// + /// TODO: Remove this custom serializer when enabling Semantic search + /// + internal static partial class SearchQueryTypeExtensions + { + public static string ToSerialString(this SearchQueryType value) => value switch + { + SearchQueryType.Simple => "simple", + SearchQueryType.Full => "full", + // SearchQueryType.Semantic => "semantic", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, $"Unknown {nameof(SearchQueryType)} value.") + }; + + public static SearchQueryType ToSearchQueryType(this string value) + { + if (string.Equals(value, "simple", StringComparison.InvariantCultureIgnoreCase)) + return SearchQueryType.Simple; + if (string.Equals(value, "full", StringComparison.InvariantCultureIgnoreCase)) + return SearchQueryType.Full; + //if (string.Equals(value, "semantic", StringComparison.InvariantCultureIgnoreCase)) + // return SearchQueryType.Semantic; + throw new ArgumentOutOfRangeException(nameof(value), value, $"Unknown {nameof(SearchQueryType)} value."); + } + } +} diff --git a/sdk/search/Azure.Search.Documents/src/Models/Speller.cs b/sdk/search/Azure.Search.Documents/src/Models/Speller.cs new file mode 100644 index 000000000000..8c67e03b0e3c --- /dev/null +++ b/sdk/search/Azure.Search.Documents/src/Models/Speller.cs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace Azure.Search.Documents.Models +{ + internal readonly partial struct Speller + { + } +} diff --git a/sdk/search/Azure.Search.Documents/src/Options/SearchOptions.cs b/sdk/search/Azure.Search.Documents/src/Options/SearchOptions.cs index e01695991a4f..ed75a4568cba 100644 --- a/sdk/search/Azure.Search.Documents/src/Options/SearchOptions.cs +++ b/sdk/search/Azure.Search.Documents/src/Options/SearchOptions.cs @@ -162,6 +162,15 @@ internal string OrderByRaw [CodeGenMember("scoringParameters")] public IList ScoringParameters { get; internal set; } = new List(); + /// A value that specifies the language of the search query. + internal QueryLanguage? QueryLanguage { get; set; } + + /// A value that specified the type of the speller to use to spell-correct individual search query terms. + internal Speller? Speller { get; set; } + + /// A value that specifies whether answers should be returned as part of the search response. + internal Answers? Answers { get; set; } + /// /// Shallow copy one SearchOptions instance to another. /// diff --git a/sdk/search/Azure.Search.Documents/src/autorest.md b/sdk/search/Azure.Search.Documents/src/autorest.md index fc666a244919..070383b2d2a4 100644 --- a/sdk/search/Azure.Search.Documents/src/autorest.md +++ b/sdk/search/Azure.Search.Documents/src/autorest.md @@ -13,8 +13,8 @@ copy them locally in `/sdk/search/generate.ps1` and reference them here. ```yaml title: SearchServiceClient input-file: -- https://raw.githubusercontent.com/Azure/azure-rest-api-specs/55c3979124d193ab8cd4c5409a3e9f67739ca571/specification/search/data-plane/Azure.Search/preview/2020-06-30/searchindex.json -- https://raw.githubusercontent.com/Azure/azure-rest-api-specs/55c3979124d193ab8cd4c5409a3e9f67739ca571/specification/search/data-plane/Azure.Search/preview/2020-06-30/searchservice.json +- https://raw.githubusercontent.com/Azure/azure-rest-api-specs/e6fa7db931a3e5182e5685630971b64987719938/specification/search/data-plane/Azure.Search/preview/2020-06-30-Preview/searchindex.json +- https://raw.githubusercontent.com/Azure/azure-rest-api-specs/e6fa7db931a3e5182e5685630971b64987719938/specification/search/data-plane/Azure.Search/preview/2020-06-30-Preview/searchservice.json ``` ## Release hacks @@ -31,6 +31,13 @@ These should eventually be fixed in the code generator. ## Swagger hacks These should eventually be fixed in the swagger files. +``` yaml +directive: + from: swagger-document + where: $.definitions.LexicalNormalizer + transform: > + $["discriminator"] = "@odata.type"; +``` ### Mark definitions as objects The modeler warns about models without an explicit type. diff --git a/sdk/search/Azure.Search.Documents/tests/Models/SearchIndexTests.cs b/sdk/search/Azure.Search.Documents/tests/Models/SearchIndexTests.cs index 477cb4087f73..894c46f68c3d 100644 --- a/sdk/search/Azure.Search.Documents/tests/Models/SearchIndexTests.cs +++ b/sdk/search/Azure.Search.Documents/tests/Models/SearchIndexTests.cs @@ -14,7 +14,7 @@ public class SearchIndexTests [TestCase("\"0123abcd\"", "\"0123abcd\"")] public void ParsesETag(string value, string expected) { - SearchIndex sut = new SearchIndex(null, new SearchField[0], null, null, null, null, null, null, null, null, null, null, value); + SearchIndex sut = new SearchIndex(null, new SearchField[0], null, null, null, null, null, null, null, null, null, null, null, value); Assert.AreEqual(expected, sut.ETag?.ToString()); } diff --git a/sdk/search/Azure.Search.Documents/tests/SearchIndexerClientTests.cs b/sdk/search/Azure.Search.Documents/tests/SearchIndexerClientTests.cs index 1b63731ac143..c3bc11cebdca 100644 --- a/sdk/search/Azure.Search.Documents/tests/SearchIndexerClientTests.cs +++ b/sdk/search/Azure.Search.Documents/tests/SearchIndexerClientTests.cs @@ -541,6 +541,8 @@ SearchIndexerSkill CreateSkill(Type t, string[] inputNames, string[] outputNames return t switch { + Type _ when t == typeof(CustomEntityLookupSkill) => new CustomEntityLookupSkill(inputs, outputs) { EntitiesDefinitionUri = "https://microsoft.com" }, + // TODO: Should TextSplitMode be added to constructor (required input)? Type _ when t == typeof(SplitSkill) => new SplitSkill(inputs, outputs) { TextSplitMode = TextSplitMode.Pages }, @@ -555,6 +557,8 @@ SearchIndexerSkill CreateSkill(Type t, string[] inputNames, string[] outputNames .Select(t => t switch { Type _ when t == typeof(ConditionalSkill) => CreateSkill(t, new[] { "condition", "whenTrue", "whenFalse" }, new[] { "output" }), + Type _ when t == typeof(CustomEntityLookupSkill) => CreateSkill(t, new[] { "text", "languageCode" }, new[] { "entities" }), + Type _ when t == typeof(DocumentExtractionSkill) => CreateSkill(t, new[] { "file_data" }, new[] { "content", "normalized_images" }), Type _ when t == typeof(EntityRecognitionSkill) => CreateSkill(t, new[] { "languageCode", "text" }, new[] { "persons" }), Type _ when t == typeof(ImageAnalysisSkill) => CreateSkill(t, new[] { "image" }, new[] { "categories" }), Type _ when t == typeof(KeyPhraseExtractionSkill) => CreateSkill(t, new[] { "text", "languageCode" }, new[] { "keyPhrases" }), diff --git a/sdk/search/Azure.Search.Documents/tests/SessionRecords/SearchIndexerClientTests/RoundtripAllSkills.json b/sdk/search/Azure.Search.Documents/tests/SessionRecords/SearchIndexerClientTests/RoundtripAllSkills.json index 73f4664733f4..c8f56389b100 100644 --- a/sdk/search/Azure.Search.Documents/tests/SessionRecords/SearchIndexerClientTests/RoundtripAllSkills.json +++ b/sdk/search/Azure.Search.Documents/tests/SessionRecords/SearchIndexerClientTests/RoundtripAllSkills.json @@ -6,14 +6,14 @@ "RequestHeaders": { "Accept": "application/json; odata.metadata=minimal", "api-key": "Sanitized", - "Content-Length": "3029", + "Content-Length": "3541", "Content-Type": "application/json", - "traceparent": "00-357c8322df08db408d45814584a35a6b-ad4ed7e68d34304d-00", + "traceparent": "00-3786bf6405fe7146889c4019b6dae311-54fa83c404e47f4d-00", "User-Agent": [ - "azsdk-net-Search.Documents/11.3.0-alpha.20210326.1", - "(.NET Core 4.6.29719.03; Microsoft Windows 10.0.19043 )" + "azsdk-net-Search.Documents/11.3.0-alpha.20210402.1", + "(.NET Framework 4.8.4341.0; Microsoft Windows 10.0.19043 )" ], - "x-ms-client-request-id": "7c15986df0790821cfd9e7040b8a411b", + "x-ms-client-request-id": "5d016cb905478992346230c9ebac18e1", "x-ms-return-client-request-id": "true" }, "RequestBody": { @@ -42,6 +42,45 @@ } ] }, + { + "entitiesDefinitionUri": "https://microsoft.com", + "@odata.type": "#Microsoft.Skills.Text.CustomEntityLookupSkill", + "inputs": [ + { + "name": "text", + "source": "/document/content" + }, + { + "name": "languageCode", + "source": "/document/content" + } + ], + "outputs": [ + { + "name": "entities", + "targetName": "upyugkjy" + } + ] + }, + { + "@odata.type": "#Microsoft.Skills.Util.DocumentExtractionSkill", + "inputs": [ + { + "name": "file_data", + "source": "/document/content" + } + ], + "outputs": [ + { + "name": "content", + "targetName": "cojtwncd" + }, + { + "name": "normalized_images", + "targetName": "xyafuysk" + } + ] + }, { "@odata.type": "#Microsoft.Skills.Text.EntityRecognitionSkill", "inputs": [ @@ -57,7 +96,7 @@ "outputs": [ { "name": "persons", - "targetName": "upyugkjy" + "targetName": "lripadri" } ] }, @@ -72,7 +111,7 @@ "outputs": [ { "name": "categories", - "targetName": "cojtwncd" + "targetName": "oxeepvou" } ] }, @@ -91,7 +130,7 @@ "outputs": [ { "name": "keyPhrases", - "targetName": "xyafuysk" + "targetName": "gnhofmax" } ] }, @@ -106,15 +145,15 @@ "outputs": [ { "name": "languageCode", - "targetName": "lripadri" + "targetName": "djmltsdu" }, { "name": "languageName", - "targetName": "oxeepvou" + "targetName": "wojnbsyy" }, { "name": "score", - "targetName": "gnhofmax" + "targetName": "vaeyixnb" } ] }, @@ -137,7 +176,7 @@ "outputs": [ { "name": "mergedText", - "targetName": "djmltsdu" + "targetName": "jexhrdex" } ] }, @@ -152,11 +191,11 @@ "outputs": [ { "name": "text", - "targetName": "wojnbsyy" + "targetName": "rkmppgnu" }, { "name": "layoutText", - "targetName": "vaeyixnb" + "targetName": "tjgbmatn" } ] }, @@ -175,7 +214,7 @@ "outputs": [ { "name": "score", - "targetName": "jexhrdex" + "targetName": "nisfhboe" } ] }, @@ -190,7 +229,7 @@ "outputs": [ { "name": "output", - "targetName": "rkmppgnu" + "targetName": "vlbotvcs" } ] }, @@ -210,7 +249,7 @@ "outputs": [ { "name": "textItems", - "targetName": "tjgbmatn" + "targetName": "jkvqfjip" } ] }, @@ -234,15 +273,15 @@ "outputs": [ { "name": "translatedText", - "targetName": "nisfhboe" + "targetName": "ljeyqloi" }, { "name": "translatedToLanguageCode", - "targetName": "vlbotvcs" + "targetName": "kktjkyqp" }, { "name": "translatedFromLanguageCode", - "targetName": "jkvqfjip" + "targetName": "viseexax" } ] }, @@ -258,7 +297,7 @@ "outputs": [ { "name": "output", - "targetName": "ljeyqloi" + "targetName": "gnrbedhd" } ] } @@ -270,24 +309,24 @@ "StatusCode": 201, "ResponseHeaders": { "Cache-Control": "no-cache", - "client-request-id": "7c15986d-f079-0821-cfd9-e7040b8a411b", - "Content-Length": "5156", + "client-request-id": "5d016cb9-0547-8992-3462-30c9ebac18e1", + "Content-Length": "6085", "Content-Type": "application/json; odata.metadata=minimal", - "Date": "Sat, 27 Mar 2021 18:45:30 GMT", - "elapsed-time": "229", - "ETag": "W/\u00220x8D8F1507F808C0E\u0022", + "Date": "Fri, 02 Apr 2021 19:02:41 GMT", + "elapsed-time": "191", + "ETag": "W/\u00220x8D8F609E3F387FC\u0022", "Expires": "-1", "Location": "https://mohitc-acs.search.windows.net/skillsets(\u0027fpmjeogx\u0027)?api-version=2020-06-30", "OData-Version": "4.0", "Pragma": "no-cache", "Preference-Applied": "odata.include-annotations=\u0022*\u0022", - "request-id": "7c15986d-f079-0821-cfd9-e7040b8a411b", + "request-id": "5d016cb9-0547-8992-3462-30c9ebac18e1", "Strict-Transport-Security": "max-age=15724800; includeSubDomains", - "x-ms-client-request-id": "7c15986d-f079-0821-cfd9-e7040b8a411b" + "x-ms-client-request-id": "5d016cb9-0547-8992-3462-30c9ebac18e1" }, "ResponseBody": { "@odata.context": "https://mohitc-acs.search.windows.net/$metadata#skillsets/$entity", - "@odata.etag": "\u00220x8D8F1507F808C0E\u0022", + "@odata.etag": "\u00220x8D8F609E3F387FC\u0022", "name": "fpmjeogx", "description": null, "skills": [ @@ -323,6 +362,65 @@ } ] }, + { + "@odata.type": "#Microsoft.Skills.Text.CustomEntityLookupSkill", + "name": null, + "description": null, + "context": null, + "defaultLanguageCode": null, + "entitiesDefinitionUri": "https://microsoft.com", + "globalDefaultCaseSensitive": null, + "globalDefaultAccentSensitive": null, + "globalDefaultFuzzyEditDistance": null, + "inputs": [ + { + "name": "text", + "source": "/document/content", + "sourceContext": null, + "inputs": [] + }, + { + "name": "languageCode", + "source": "/document/content", + "sourceContext": null, + "inputs": [] + } + ], + "outputs": [ + { + "name": "entities", + "targetName": "upyugkjy" + } + ], + "inlineEntitiesDefinition": [] + }, + { + "@odata.type": "#Microsoft.Skills.Util.DocumentExtractionSkill", + "name": null, + "description": null, + "context": null, + "parsingMode": null, + "dataToExtract": null, + "inputs": [ + { + "name": "file_data", + "source": "/document/content", + "sourceContext": null, + "inputs": [] + } + ], + "outputs": [ + { + "name": "content", + "targetName": "cojtwncd" + }, + { + "name": "normalized_images", + "targetName": "xyafuysk" + } + ], + "configuration": null + }, { "@odata.type": "#Microsoft.Skills.Text.EntityRecognitionSkill", "name": null, @@ -349,7 +447,7 @@ "outputs": [ { "name": "persons", - "targetName": "upyugkjy" + "targetName": "lripadri" } ] }, @@ -372,7 +470,7 @@ "outputs": [ { "name": "categories", - "targetName": "cojtwncd" + "targetName": "oxeepvou" } ] }, @@ -401,7 +499,7 @@ "outputs": [ { "name": "keyPhrases", - "targetName": "xyafuysk" + "targetName": "gnhofmax" } ] }, @@ -423,15 +521,15 @@ "outputs": [ { "name": "languageCode", - "targetName": "lripadri" + "targetName": "djmltsdu" }, { "name": "languageName", - "targetName": "oxeepvou" + "targetName": "wojnbsyy" }, { "name": "score", - "targetName": "gnhofmax" + "targetName": "vaeyixnb" } ] }, @@ -465,7 +563,7 @@ "outputs": [ { "name": "mergedText", - "targetName": "djmltsdu" + "targetName": "jexhrdex" } ] }, @@ -489,11 +587,11 @@ "outputs": [ { "name": "text", - "targetName": "wojnbsyy" + "targetName": "rkmppgnu" }, { "name": "layoutText", - "targetName": "vaeyixnb" + "targetName": "tjgbmatn" } ] }, @@ -520,7 +618,7 @@ "outputs": [ { "name": "score", - "targetName": "jexhrdex" + "targetName": "nisfhboe" } ] }, @@ -540,7 +638,7 @@ "outputs": [ { "name": "output", - "targetName": "rkmppgnu" + "targetName": "vlbotvcs" } ] }, @@ -569,7 +667,7 @@ "outputs": [ { "name": "textItems", - "targetName": "tjgbmatn" + "targetName": "jkvqfjip" } ] }, @@ -604,15 +702,15 @@ "outputs": [ { "name": "translatedText", - "targetName": "nisfhboe" + "targetName": "ljeyqloi" }, { "name": "translatedToLanguageCode", - "targetName": "vlbotvcs" + "targetName": "kktjkyqp" }, { "name": "translatedFromLanguageCode", - "targetName": "jkvqfjip" + "targetName": "viseexax" } ] }, @@ -637,7 +735,7 @@ "outputs": [ { "name": "output", - "targetName": "ljeyqloi" + "targetName": "gnrbedhd" } ], "httpHeaders": null diff --git a/sdk/search/Azure.Search.Documents/tests/SessionRecords/SearchIndexerClientTests/RoundtripAllSkillsAsync.json b/sdk/search/Azure.Search.Documents/tests/SessionRecords/SearchIndexerClientTests/RoundtripAllSkillsAsync.json index d9d08cc3bc97..a1e50c4909c2 100644 --- a/sdk/search/Azure.Search.Documents/tests/SessionRecords/SearchIndexerClientTests/RoundtripAllSkillsAsync.json +++ b/sdk/search/Azure.Search.Documents/tests/SessionRecords/SearchIndexerClientTests/RoundtripAllSkillsAsync.json @@ -6,14 +6,14 @@ "RequestHeaders": { "Accept": "application/json; odata.metadata=minimal", "api-key": "Sanitized", - "Content-Length": "3029", + "Content-Length": "3541", "Content-Type": "application/json", - "traceparent": "00-fd584930920bee4798caff14c7e9fe6b-f92c4d712cb90541-00", + "traceparent": "00-cb2176a4cef27f459fce7bc822c0474e-549def3b4f12dd48-00", "User-Agent": [ - "azsdk-net-Search.Documents/11.3.0-alpha.20210326.1", - "(.NET Core 4.6.29719.03; Microsoft Windows 10.0.19043 )" + "azsdk-net-Search.Documents/11.3.0-alpha.20210402.1", + "(.NET Framework 4.8.4341.0; Microsoft Windows 10.0.19043 )" ], - "x-ms-client-request-id": "36f442407343fbea34a8a7608ea1160a", + "x-ms-client-request-id": "8e39ba448961d14a4b538fa82f0f897a", "x-ms-return-client-request-id": "true" }, "RequestBody": { @@ -42,6 +42,45 @@ } ] }, + { + "entitiesDefinitionUri": "https://microsoft.com", + "@odata.type": "#Microsoft.Skills.Text.CustomEntityLookupSkill", + "inputs": [ + { + "name": "text", + "source": "/document/content" + }, + { + "name": "languageCode", + "source": "/document/content" + } + ], + "outputs": [ + { + "name": "entities", + "targetName": "xnehbjyk" + } + ] + }, + { + "@odata.type": "#Microsoft.Skills.Util.DocumentExtractionSkill", + "inputs": [ + { + "name": "file_data", + "source": "/document/content" + } + ], + "outputs": [ + { + "name": "content", + "targetName": "alqyjdbi" + }, + { + "name": "normalized_images", + "targetName": "ptidacek" + } + ] + }, { "@odata.type": "#Microsoft.Skills.Text.EntityRecognitionSkill", "inputs": [ @@ -57,7 +96,7 @@ "outputs": [ { "name": "persons", - "targetName": "xnehbjyk" + "targetName": "niyhrstv" } ] }, @@ -72,7 +111,7 @@ "outputs": [ { "name": "categories", - "targetName": "alqyjdbi" + "targetName": "wgomeenc" } ] }, @@ -91,7 +130,7 @@ "outputs": [ { "name": "keyPhrases", - "targetName": "ptidacek" + "targetName": "fuvknxeo" } ] }, @@ -106,15 +145,15 @@ "outputs": [ { "name": "languageCode", - "targetName": "niyhrstv" + "targetName": "dmqnsedu" }, { "name": "languageName", - "targetName": "wgomeenc" + "targetName": "jtsskqrg" }, { "name": "score", - "targetName": "fuvknxeo" + "targetName": "qtbcoodl" } ] }, @@ -137,7 +176,7 @@ "outputs": [ { "name": "mergedText", - "targetName": "dmqnsedu" + "targetName": "fgxegswp" } ] }, @@ -152,11 +191,11 @@ "outputs": [ { "name": "text", - "targetName": "jtsskqrg" + "targetName": "ejefcfds" }, { "name": "layoutText", - "targetName": "qtbcoodl" + "targetName": "dtcklurn" } ] }, @@ -175,7 +214,7 @@ "outputs": [ { "name": "score", - "targetName": "fgxegswp" + "targetName": "dpsswbyn" } ] }, @@ -190,7 +229,7 @@ "outputs": [ { "name": "output", - "targetName": "ejefcfds" + "targetName": "ieilgxop" } ] }, @@ -210,7 +249,7 @@ "outputs": [ { "name": "textItems", - "targetName": "dtcklurn" + "targetName": "wdnammdl" } ] }, @@ -234,15 +273,15 @@ "outputs": [ { "name": "translatedText", - "targetName": "dpsswbyn" + "targetName": "pixulsyk" }, { "name": "translatedToLanguageCode", - "targetName": "ieilgxop" + "targetName": "ojbpydrd" }, { "name": "translatedFromLanguageCode", - "targetName": "wdnammdl" + "targetName": "jpvwwqmf" } ] }, @@ -258,7 +297,7 @@ "outputs": [ { "name": "output", - "targetName": "pixulsyk" + "targetName": "fmmhhqbp" } ] } @@ -270,24 +309,24 @@ "StatusCode": 201, "ResponseHeaders": { "Cache-Control": "no-cache", - "client-request-id": "36f44240-7343-fbea-34a8-a7608ea1160a", - "Content-Length": "5156", + "client-request-id": "8e39ba44-8961-d14a-4b53-8fa82f0f897a", + "Content-Length": "6085", "Content-Type": "application/json; odata.metadata=minimal", - "Date": "Sat, 27 Mar 2021 18:46:33 GMT", - "elapsed-time": "134", - "ETag": "W/\u00220x8D8F150A4A4F5B1\u0022", + "Date": "Fri, 02 Apr 2021 19:02:41 GMT", + "elapsed-time": "137", + "ETag": "W/\u00220x8D8F609E42A8004\u0022", "Expires": "-1", "Location": "https://mohitc-acs.search.windows.net/skillsets(\u0027lefvvewn\u0027)?api-version=2020-06-30", "OData-Version": "4.0", "Pragma": "no-cache", "Preference-Applied": "odata.include-annotations=\u0022*\u0022", - "request-id": "36f44240-7343-fbea-34a8-a7608ea1160a", + "request-id": "8e39ba44-8961-d14a-4b53-8fa82f0f897a", "Strict-Transport-Security": "max-age=15724800; includeSubDomains", - "x-ms-client-request-id": "36f44240-7343-fbea-34a8-a7608ea1160a" + "x-ms-client-request-id": "8e39ba44-8961-d14a-4b53-8fa82f0f897a" }, "ResponseBody": { "@odata.context": "https://mohitc-acs.search.windows.net/$metadata#skillsets/$entity", - "@odata.etag": "\u00220x8D8F150A4A4F5B1\u0022", + "@odata.etag": "\u00220x8D8F609E42A8004\u0022", "name": "lefvvewn", "description": null, "skills": [ @@ -323,6 +362,65 @@ } ] }, + { + "@odata.type": "#Microsoft.Skills.Text.CustomEntityLookupSkill", + "name": null, + "description": null, + "context": null, + "defaultLanguageCode": null, + "entitiesDefinitionUri": "https://microsoft.com", + "globalDefaultCaseSensitive": null, + "globalDefaultAccentSensitive": null, + "globalDefaultFuzzyEditDistance": null, + "inputs": [ + { + "name": "text", + "source": "/document/content", + "sourceContext": null, + "inputs": [] + }, + { + "name": "languageCode", + "source": "/document/content", + "sourceContext": null, + "inputs": [] + } + ], + "outputs": [ + { + "name": "entities", + "targetName": "xnehbjyk" + } + ], + "inlineEntitiesDefinition": [] + }, + { + "@odata.type": "#Microsoft.Skills.Util.DocumentExtractionSkill", + "name": null, + "description": null, + "context": null, + "parsingMode": null, + "dataToExtract": null, + "inputs": [ + { + "name": "file_data", + "source": "/document/content", + "sourceContext": null, + "inputs": [] + } + ], + "outputs": [ + { + "name": "content", + "targetName": "alqyjdbi" + }, + { + "name": "normalized_images", + "targetName": "ptidacek" + } + ], + "configuration": null + }, { "@odata.type": "#Microsoft.Skills.Text.EntityRecognitionSkill", "name": null, @@ -349,7 +447,7 @@ "outputs": [ { "name": "persons", - "targetName": "xnehbjyk" + "targetName": "niyhrstv" } ] }, @@ -372,7 +470,7 @@ "outputs": [ { "name": "categories", - "targetName": "alqyjdbi" + "targetName": "wgomeenc" } ] }, @@ -401,7 +499,7 @@ "outputs": [ { "name": "keyPhrases", - "targetName": "ptidacek" + "targetName": "fuvknxeo" } ] }, @@ -423,15 +521,15 @@ "outputs": [ { "name": "languageCode", - "targetName": "niyhrstv" + "targetName": "dmqnsedu" }, { "name": "languageName", - "targetName": "wgomeenc" + "targetName": "jtsskqrg" }, { "name": "score", - "targetName": "fuvknxeo" + "targetName": "qtbcoodl" } ] }, @@ -465,7 +563,7 @@ "outputs": [ { "name": "mergedText", - "targetName": "dmqnsedu" + "targetName": "fgxegswp" } ] }, @@ -489,11 +587,11 @@ "outputs": [ { "name": "text", - "targetName": "jtsskqrg" + "targetName": "ejefcfds" }, { "name": "layoutText", - "targetName": "qtbcoodl" + "targetName": "dtcklurn" } ] }, @@ -520,7 +618,7 @@ "outputs": [ { "name": "score", - "targetName": "fgxegswp" + "targetName": "dpsswbyn" } ] }, @@ -540,7 +638,7 @@ "outputs": [ { "name": "output", - "targetName": "ejefcfds" + "targetName": "ieilgxop" } ] }, @@ -569,7 +667,7 @@ "outputs": [ { "name": "textItems", - "targetName": "dtcklurn" + "targetName": "wdnammdl" } ] }, @@ -604,15 +702,15 @@ "outputs": [ { "name": "translatedText", - "targetName": "dpsswbyn" + "targetName": "pixulsyk" }, { "name": "translatedToLanguageCode", - "targetName": "ieilgxop" + "targetName": "ojbpydrd" }, { "name": "translatedFromLanguageCode", - "targetName": "wdnammdl" + "targetName": "jpvwwqmf" } ] }, @@ -637,7 +735,7 @@ "outputs": [ { "name": "output", - "targetName": "pixulsyk" + "targetName": "fmmhhqbp" } ], "httpHeaders": null