diff --git a/sdk/search/Azure.Search.Documents/CHANGELOG.md b/sdk/search/Azure.Search.Documents/CHANGELOG.md index 662c6150df694..d7f80b4219e2e 100644 --- a/sdk/search/Azure.Search.Documents/CHANGELOG.md +++ b/sdk/search/Azure.Search.Documents/CHANGELOG.md @@ -1,14 +1,20 @@ # Release History -## 11.7.0-beta.2 (Unreleased) +## 11.7.0-beta.2 (2024-11-25) ### Features Added - -### Breaking Changes +- `FacetResults` is now a recursive data structure to support hierarchical aggregation and facet filtering. +- `QueryAnswer` now supports a `MaxCharLength` option to limit the character length of the answer. +- `QueryCaption` now supports a `MaxCharLength` option to limit the character length of the caption. +- `VectorizableTextQuery` now supports a `QueryRewrites` option to specify the number query rewrites the service will generate. +- `SemanticSearchOptions` now supports a `QueryRewrites` option to specify the number query rewrites the service will generate. +- `VectorSearchCompression` now supports configuring the `RescoringOptions`. +- `IndexingParametersConfiguration` now supports two additional options for `MarkdownParsingSubmode` and `MarkdownHeaderDepth`. +- Added a new skill: `DocumentIntelligenceLayoutSkill` that extracts content and layout information (as markdown), via Azure AI Services, from files within the enrichment pipeline. +- Added 2 subtypes of `CognitiveServiceAccounts`: `AzureCognitiveServiceAccount` and `AzureCognitiveServiceAccountKey`. ### Bugs Fixed - -### Other Changes +- Fixed a bug in the `SearchResult.DocumentDebugInfo` property by changing its type from `IReadOnlyList` to `DocumentDebugInfo`. ([#46958](https://github.com/Azure/azure-sdk-for-net/issues/46958)) ## 11.7.0-beta.1 (2024-09-24) diff --git a/sdk/search/Azure.Search.Documents/api/Azure.Search.Documents.net8.0.cs b/sdk/search/Azure.Search.Documents/api/Azure.Search.Documents.net8.0.cs index 987177dd403bf..36813d9980e52 100644 --- a/sdk/search/Azure.Search.Documents/api/Azure.Search.Documents.net8.0.cs +++ b/sdk/search/Azure.Search.Documents/api/Azure.Search.Documents.net8.0.cs @@ -79,7 +79,7 @@ public SearchClient(System.Uri endpoint, string indexName, Azure.Core.TokenCrede } public partial class SearchClientOptions : Azure.Core.ClientOptions { - public SearchClientOptions(Azure.Search.Documents.SearchClientOptions.ServiceVersion version = Azure.Search.Documents.SearchClientOptions.ServiceVersion.V2024_09_01_Preview) { } + public SearchClientOptions(Azure.Search.Documents.SearchClientOptions.ServiceVersion version = Azure.Search.Documents.SearchClientOptions.ServiceVersion.V2024_11_01_Preview) { } public Azure.Search.Documents.SearchAudience? Audience { get { throw null; } set { } } public Azure.Core.Serialization.ObjectSerializer Serializer { get { throw null; } set { } } public Azure.Search.Documents.SearchClientOptions.ServiceVersion Version { get { throw null; } } @@ -88,7 +88,7 @@ public enum ServiceVersion V2020_06_30 = 1, V2023_11_01 = 2, V2024_07_01 = 3, - V2024_09_01_Preview = 4, + V2024_11_01_Preview = 4, } } public static partial class SearchFilter @@ -370,6 +370,18 @@ public VectorSearchFieldAttribute() { } } namespace Azure.Search.Documents.Indexes.Models { + public partial class AIServicesAccountIdentity : Azure.Search.Documents.Indexes.Models.CognitiveServicesAccount + { + public AIServicesAccountIdentity(Azure.Search.Documents.Indexes.Models.SearchIndexerDataIdentity identity, string subdomainUrl) { } + public Azure.Search.Documents.Indexes.Models.SearchIndexerDataIdentity Identity { get { throw null; } set { } } + public string SubdomainUrl { get { throw null; } set { } } + } + public partial class AIServicesAccountKey : Azure.Search.Documents.Indexes.Models.CognitiveServicesAccount + { + public AIServicesAccountKey(string key, string subdomainUrl) { } + public string Key { get { throw null; } set { } } + public string SubdomainUrl { get { throw null; } set { } } + } public partial class AIServicesVisionParameters { public AIServicesVisionParameters(string modelVersion, System.Uri resourceUri) { } @@ -559,6 +571,7 @@ public BinaryQuantizationCompression(string compressionName) : base (default(str public static Azure.Search.Documents.Indexes.Models.BlobIndexerParsingMode Json { get { throw null; } } public static Azure.Search.Documents.Indexes.Models.BlobIndexerParsingMode JsonArray { get { throw null; } } public static Azure.Search.Documents.Indexes.Models.BlobIndexerParsingMode JsonLines { get { throw null; } } + public static Azure.Search.Documents.Indexes.Models.BlobIndexerParsingMode Markdown { get { throw null; } } public static Azure.Search.Documents.Indexes.Models.BlobIndexerParsingMode Text { get { throw null; } } public bool Equals(Azure.Search.Documents.Indexes.Models.BlobIndexerParsingMode other) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] @@ -781,6 +794,51 @@ public DocumentExtractionSkill(System.Collections.Generic.IEnumerable inputs, System.Collections.Generic.IEnumerable outputs) { } + public Azure.Search.Documents.Indexes.Models.DocumentIntelligenceLayoutSkillMarkdownHeaderDepth? MarkdownHeaderDepth { get { throw null; } set { } } + public Azure.Search.Documents.Indexes.Models.DocumentIntelligenceLayoutSkillOutputMode? OutputMode { get { throw null; } set { } } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DocumentIntelligenceLayoutSkillMarkdownHeaderDepth : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DocumentIntelligenceLayoutSkillMarkdownHeaderDepth(string value) { throw null; } + public static Azure.Search.Documents.Indexes.Models.DocumentIntelligenceLayoutSkillMarkdownHeaderDepth H1 { get { throw null; } } + public static Azure.Search.Documents.Indexes.Models.DocumentIntelligenceLayoutSkillMarkdownHeaderDepth H2 { get { throw null; } } + public static Azure.Search.Documents.Indexes.Models.DocumentIntelligenceLayoutSkillMarkdownHeaderDepth H3 { get { throw null; } } + public static Azure.Search.Documents.Indexes.Models.DocumentIntelligenceLayoutSkillMarkdownHeaderDepth H4 { get { throw null; } } + public static Azure.Search.Documents.Indexes.Models.DocumentIntelligenceLayoutSkillMarkdownHeaderDepth H5 { get { throw null; } } + public static Azure.Search.Documents.Indexes.Models.DocumentIntelligenceLayoutSkillMarkdownHeaderDepth H6 { get { throw null; } } + public bool Equals(Azure.Search.Documents.Indexes.Models.DocumentIntelligenceLayoutSkillMarkdownHeaderDepth 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.DocumentIntelligenceLayoutSkillMarkdownHeaderDepth left, Azure.Search.Documents.Indexes.Models.DocumentIntelligenceLayoutSkillMarkdownHeaderDepth right) { throw null; } + public static implicit operator Azure.Search.Documents.Indexes.Models.DocumentIntelligenceLayoutSkillMarkdownHeaderDepth (string value) { throw null; } + public static bool operator !=(Azure.Search.Documents.Indexes.Models.DocumentIntelligenceLayoutSkillMarkdownHeaderDepth left, Azure.Search.Documents.Indexes.Models.DocumentIntelligenceLayoutSkillMarkdownHeaderDepth right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DocumentIntelligenceLayoutSkillOutputMode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DocumentIntelligenceLayoutSkillOutputMode(string value) { throw null; } + public static Azure.Search.Documents.Indexes.Models.DocumentIntelligenceLayoutSkillOutputMode OneToMany { get { throw null; } } + public bool Equals(Azure.Search.Documents.Indexes.Models.DocumentIntelligenceLayoutSkillOutputMode 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.DocumentIntelligenceLayoutSkillOutputMode left, Azure.Search.Documents.Indexes.Models.DocumentIntelligenceLayoutSkillOutputMode right) { throw null; } + public static implicit operator Azure.Search.Documents.Indexes.Models.DocumentIntelligenceLayoutSkillOutputMode (string value) { throw null; } + public static bool operator !=(Azure.Search.Documents.Indexes.Models.DocumentIntelligenceLayoutSkillOutputMode left, Azure.Search.Documents.Indexes.Models.DocumentIntelligenceLayoutSkillOutputMode right) { throw null; } + public override string ToString() { throw null; } + } public partial class EdgeNGramTokenFilter : Azure.Search.Documents.Indexes.Models.TokenFilter { public EdgeNGramTokenFilter(string name) { } @@ -1177,6 +1235,8 @@ public IndexingParametersConfiguration() { } public bool? IndexStorageMetadataOnlyForOversizedDocuments { get { throw null; } set { } } public object this[string key] { get { throw null; } set { } } public System.Collections.Generic.ICollection Keys { get { throw null; } } + public Azure.Search.Documents.Indexes.Models.MarkdownHeaderDepth? MarkdownHeaderDepth { get { throw null; } set { } } + public Azure.Search.Documents.Indexes.Models.MarkdownParsingSubmode? MarkdownParsingSubmode { get { throw null; } set { } } public Azure.Search.Documents.Indexes.Models.BlobIndexerParsingMode? ParsingMode { get { throw null; } set { } } public Azure.Search.Documents.Indexes.Models.BlobIndexerPdfTextRotationAlgorithm? PdfTextRotationAlgorithm { get { throw null; } set { } } public System.TimeSpan? QueryTimeout { get { throw null; } set { } } @@ -1648,6 +1708,46 @@ public partial class MappingCharFilter : Azure.Search.Documents.Indexes.Models.C public MappingCharFilter(string name, System.Collections.Generic.IEnumerable mappings) { } public System.Collections.Generic.IList Mappings { get { throw null; } } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct MarkdownHeaderDepth : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public MarkdownHeaderDepth(string value) { throw null; } + public static Azure.Search.Documents.Indexes.Models.MarkdownHeaderDepth H1 { get { throw null; } } + public static Azure.Search.Documents.Indexes.Models.MarkdownHeaderDepth H2 { get { throw null; } } + public static Azure.Search.Documents.Indexes.Models.MarkdownHeaderDepth H3 { get { throw null; } } + public static Azure.Search.Documents.Indexes.Models.MarkdownHeaderDepth H4 { get { throw null; } } + public static Azure.Search.Documents.Indexes.Models.MarkdownHeaderDepth H5 { get { throw null; } } + public static Azure.Search.Documents.Indexes.Models.MarkdownHeaderDepth H6 { get { throw null; } } + public bool Equals(Azure.Search.Documents.Indexes.Models.MarkdownHeaderDepth 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.MarkdownHeaderDepth left, Azure.Search.Documents.Indexes.Models.MarkdownHeaderDepth right) { throw null; } + public static implicit operator Azure.Search.Documents.Indexes.Models.MarkdownHeaderDepth (string value) { throw null; } + public static bool operator !=(Azure.Search.Documents.Indexes.Models.MarkdownHeaderDepth left, Azure.Search.Documents.Indexes.Models.MarkdownHeaderDepth right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct MarkdownParsingSubmode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public MarkdownParsingSubmode(string value) { throw null; } + public static Azure.Search.Documents.Indexes.Models.MarkdownParsingSubmode OneToMany { get { throw null; } } + public static Azure.Search.Documents.Indexes.Models.MarkdownParsingSubmode OneToOne { get { throw null; } } + public bool Equals(Azure.Search.Documents.Indexes.Models.MarkdownParsingSubmode 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.MarkdownParsingSubmode left, Azure.Search.Documents.Indexes.Models.MarkdownParsingSubmode right) { throw null; } + public static implicit operator Azure.Search.Documents.Indexes.Models.MarkdownParsingSubmode (string value) { throw null; } + public static bool operator !=(Azure.Search.Documents.Indexes.Models.MarkdownParsingSubmode left, Azure.Search.Documents.Indexes.Models.MarkdownParsingSubmode right) { throw null; } + public override string ToString() { throw null; } + } public partial class MergeSkill : Azure.Search.Documents.Indexes.Models.SearchIndexerSkill { public MergeSkill(System.Collections.Generic.IEnumerable inputs, System.Collections.Generic.IEnumerable outputs) { } @@ -2112,6 +2212,13 @@ public PiiDetectionSkill(System.Collections.Generic.IEnumerable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public VectorSearchCompressionRescoreStorageMethod(string value) { throw null; } + public static Azure.Search.Documents.Indexes.Models.VectorSearchCompressionRescoreStorageMethod DiscardOriginals { get { throw null; } } + public static Azure.Search.Documents.Indexes.Models.VectorSearchCompressionRescoreStorageMethod PreserveOriginals { get { throw null; } } + public bool Equals(Azure.Search.Documents.Indexes.Models.VectorSearchCompressionRescoreStorageMethod 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.VectorSearchCompressionRescoreStorageMethod left, Azure.Search.Documents.Indexes.Models.VectorSearchCompressionRescoreStorageMethod right) { throw null; } + public static implicit operator Azure.Search.Documents.Indexes.Models.VectorSearchCompressionRescoreStorageMethod (string value) { throw null; } + public static bool operator !=(Azure.Search.Documents.Indexes.Models.VectorSearchCompressionRescoreStorageMethod left, Azure.Search.Documents.Indexes.Models.VectorSearchCompressionRescoreStorageMethod right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct VectorSearchCompressionTarget : System.IEquatable { private readonly object _dummy; @@ -3248,6 +3374,11 @@ internal AutocompleteResults() { } public double? Coverage { get { throw null; } } public System.Collections.Generic.IReadOnlyList Results { get { throw null; } } } + public partial class DebugInfo + { + internal DebugInfo() { } + public Azure.Search.Documents.Models.QueryRewritesDebugInfo QueryRewrites { get { throw null; } } + } public partial class DocumentDebugInfo { internal DocumentDebugInfo() { } @@ -3258,6 +3389,7 @@ public partial class FacetResult : System.Collections.Generic.IEnumerable> Facets { get { throw null; } } public Azure.Search.Documents.Models.FacetType FacetType { get { throw null; } } public object From { get { throw null; } } public object this[string key] { get { throw null; } } @@ -3372,6 +3504,7 @@ public partial class QueryAnswer public QueryAnswer(Azure.Search.Documents.Models.QueryAnswerType answerType) { } public Azure.Search.Documents.Models.QueryAnswerType AnswerType { get { throw null; } } public int? Count { get { throw null; } set { } } + public int? MaxCharLength { get { throw null; } set { } } public double? Threshold { get { throw null; } set { } } } public partial class QueryAnswerResult @@ -3406,6 +3539,7 @@ public partial class QueryCaption public QueryCaption(Azure.Search.Documents.Models.QueryCaptionType captionType) { } public Azure.Search.Documents.Models.QueryCaptionType CaptionType { get { throw null; } } public bool HighlightEnabled { get { throw null; } set { } } + public int? MaxCharLength { get { throw null; } set { } } } public partial class QueryCaptionResult { @@ -3438,8 +3572,11 @@ internal QueryCaptionResult() { } private readonly object _dummy; private readonly int _dummyPrimitive; public QueryDebugMode(string value) { throw null; } + public static Azure.Search.Documents.Models.QueryDebugMode All { get { throw null; } } public static Azure.Search.Documents.Models.QueryDebugMode Disabled { get { throw null; } } + public static Azure.Search.Documents.Models.QueryDebugMode QueryRewrites { get { throw null; } } public static Azure.Search.Documents.Models.QueryDebugMode Semantic { get { throw null; } } + public static Azure.Search.Documents.Models.QueryDebugMode Vector { get { throw null; } } public bool Equals(Azure.Search.Documents.Models.QueryDebugMode other) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override bool Equals(object obj) { throw null; } @@ -3558,6 +3695,42 @@ internal QueryResultDocumentSubscores() { } public Azure.Search.Documents.Models.TextResult Text { get { throw null; } } public System.Collections.Generic.IReadOnlyList> Vectors { get { throw null; } } } + public partial class QueryRewrites + { + public QueryRewrites(Azure.Search.Documents.Models.QueryRewritesType rewritesType) { } + public int? Count { get { throw null; } set { } } + public Azure.Search.Documents.Models.QueryRewritesType RewritesType { get { throw null; } } + } + public partial class QueryRewritesDebugInfo + { + internal QueryRewritesDebugInfo() { } + public Azure.Search.Documents.Models.QueryRewritesValuesDebugInfo Text { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Vectors { get { throw null; } } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct QueryRewritesType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public QueryRewritesType(string value) { throw null; } + public static Azure.Search.Documents.Models.QueryRewritesType Generative { get { throw null; } } + public static Azure.Search.Documents.Models.QueryRewritesType None { get { throw null; } } + public bool Equals(Azure.Search.Documents.Models.QueryRewritesType 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.Models.QueryRewritesType left, Azure.Search.Documents.Models.QueryRewritesType right) { throw null; } + public static implicit operator Azure.Search.Documents.Models.QueryRewritesType (string value) { throw null; } + public static bool operator !=(Azure.Search.Documents.Models.QueryRewritesType left, Azure.Search.Documents.Models.QueryRewritesType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class QueryRewritesValuesDebugInfo + { + internal QueryRewritesValuesDebugInfo() { } + public string InputQuery { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Rewrites { get { throw null; } } + } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct QuerySpellerType : System.IEquatable { @@ -3653,7 +3826,10 @@ public static partial class SearchModelFactory public static Azure.Search.Documents.Indexes.Models.CognitiveServicesAccount CognitiveServicesAccount(string oDataType, string description) { throw null; } public static Azure.Search.Documents.Indexes.Models.DataChangeDetectionPolicy DataChangeDetectionPolicy(string oDataType) { throw null; } public static Azure.Search.Documents.Indexes.Models.DataDeletionDetectionPolicy DataDeletionDetectionPolicy(string oDataType) { throw null; } + public static Azure.Search.Documents.Models.DebugInfo DebugInfo(Azure.Search.Documents.Models.QueryRewritesDebugInfo queryRewrites = null) { throw null; } public static Azure.Search.Documents.Models.DocumentDebugInfo DocumentDebugInfo(Azure.Search.Documents.Models.SemanticDebugInfo semantic = null, Azure.Search.Documents.Models.VectorsDebugInfo vectors = null) { throw null; } + public static Azure.Search.Documents.Models.FacetResult FacetResult(long? count = default(long?), System.Collections.Generic.IReadOnlyDictionary> facets = null, System.Collections.Generic.IReadOnlyDictionary additionalProperties = null) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.Search.Documents.Models.FacetResult FacetResult(long? count = default(long?), System.Collections.Generic.IReadOnlyDictionary additionalProperties = null) { throw null; } public static Azure.Search.Documents.Models.IndexDocumentsResult IndexDocumentsResult(System.Collections.Generic.IEnumerable results) { throw null; } public static Azure.Search.Documents.Indexes.Models.IndexerChangeTrackingState IndexerChangeTrackingState(string allDocumentsInitialState, string allDocumentsFinalState, string resetDocumentsInitialState, string resetDocumentsFinalState) { throw null; } @@ -3671,6 +3847,8 @@ public static partial class SearchModelFactory public static Azure.Search.Documents.Models.QueryResultDocumentRerankerInput QueryResultDocumentRerankerInput(string title = null, string content = null, string keywords = null) { throw null; } public static Azure.Search.Documents.Models.QueryResultDocumentSemanticField QueryResultDocumentSemanticField(string name = null, Azure.Search.Documents.Models.SemanticFieldState? state = default(Azure.Search.Documents.Models.SemanticFieldState?)) { throw null; } public static Azure.Search.Documents.Models.QueryResultDocumentSubscores QueryResultDocumentSubscores(Azure.Search.Documents.Models.TextResult text = null, System.Collections.Generic.IEnumerable> vectors = null, double? documentBoost = default(double?)) { throw null; } + public static Azure.Search.Documents.Models.QueryRewritesDebugInfo QueryRewritesDebugInfo(Azure.Search.Documents.Models.QueryRewritesValuesDebugInfo text = null, System.Collections.Generic.IEnumerable vectors = null) { throw null; } + public static Azure.Search.Documents.Models.QueryRewritesValuesDebugInfo QueryRewritesValuesDebugInfo(string inputQuery = null, System.Collections.Generic.IEnumerable rewrites = null) { throw null; } public static Azure.Search.Documents.Indexes.Models.ScoringFunction ScoringFunction(string type, string fieldName, double boost, Azure.Search.Documents.Indexes.Models.ScoringFunctionInterpolation? interpolation) { throw null; } public static Azure.Search.Documents.Indexes.Models.SearchIndexerError SearchIndexerError(string key, string errorMessage, int statusCode, string name, string details, string documentationLink) { throw null; } public static Azure.Search.Documents.Indexes.Models.SearchIndexerLimits SearchIndexerLimits(System.TimeSpan? maxRunTime, long? maxDocumentExtractionSize, long? maxDocumentContentCharactersToExtract) { throw null; } @@ -3686,10 +3864,14 @@ public static partial class SearchModelFactory public static Azure.Search.Documents.Models.SearchResultsPage SearchResultsPage(Azure.Search.Documents.Models.SearchResults results) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] 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; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] 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, Azure.Search.Documents.Models.SemanticSearchResults semanticSearch) { 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, Azure.Search.Documents.Models.SemanticSearchResults semanticSearch, Azure.Search.Documents.Models.DebugInfo debugInfo) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] 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.Models.SearchResult SearchResult(T document, double? score, System.Collections.Generic.IDictionary> highlights, Azure.Search.Documents.Models.SemanticSearchResult semanticSearch) { throw null; } + public static Azure.Search.Documents.Models.SearchResult SearchResult(T document, double? score, System.Collections.Generic.IDictionary> highlights, Azure.Search.Documents.Models.SemanticSearchResult semanticSearch, Azure.Search.Documents.Models.DocumentDebugInfo documentDebugInfo) { 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; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] @@ -3704,7 +3886,9 @@ public static partial class SearchModelFactory public static Azure.Search.Documents.Models.SearchSuggestion SearchSuggestion(T document, string text) { throw null; } public static Azure.Search.Documents.Models.SemanticDebugInfo SemanticDebugInfo(Azure.Search.Documents.Models.QueryResultDocumentSemanticField titleField = null, System.Collections.Generic.IEnumerable contentFields = null, System.Collections.Generic.IEnumerable keywordFields = null, Azure.Search.Documents.Models.QueryResultDocumentRerankerInput rerankerInput = null) { throw null; } public static Azure.Search.Documents.Models.SemanticSearchResult SemanticSearchResult(double? rerankerScore, System.Collections.Generic.IReadOnlyList captions) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.Search.Documents.Models.SemanticSearchResults SemanticSearchResults(System.Collections.Generic.IReadOnlyList answers, Azure.Search.Documents.Models.SemanticErrorReason? errorReason, Azure.Search.Documents.Models.SemanticSearchResultsType? resultsType) { throw null; } + public static Azure.Search.Documents.Models.SemanticSearchResults SemanticSearchResults(System.Collections.Generic.IReadOnlyList answers, Azure.Search.Documents.Models.SemanticErrorReason? errorReason, Azure.Search.Documents.Models.SemanticSearchResultsType? resultsType, Azure.Search.Documents.Models.SemanticQueryRewritesResultType? semanticQueryRewritesResultType) { throw null; } public static Azure.Search.Documents.Indexes.Models.SimilarityAlgorithm SimilarityAlgorithm(string oDataType) { throw null; } public static Azure.Search.Documents.Models.SingleVectorFieldResult SingleVectorFieldResult(double? searchScore = default(double?), double? vectorSimilarity = default(double?)) { throw null; } public static Azure.Search.Documents.Models.SuggestResults SuggestResults(System.Collections.Generic.IReadOnlyList> results, double? coverage) { throw null; } @@ -3723,6 +3907,7 @@ public partial class SearchResultsPage : Azure.Page> Facets { get { throw null; } } public Azure.Search.Documents.Models.SemanticSearchResults SemanticSearch { get { throw null; } } public long? TotalCount { get { throw null; } } @@ -3733,6 +3918,7 @@ public partial class SearchResults { internal SearchResults() { } public double? Coverage { get { throw null; } } + public Azure.Search.Documents.Models.DebugInfo DebugInfo { get { throw null; } } public System.Collections.Generic.IDictionary> Facets { get { throw null; } } public Azure.Search.Documents.Models.SemanticSearchResults SemanticSearch { get { throw null; } } public long? TotalCount { get { throw null; } } @@ -3743,7 +3929,7 @@ public partial class SearchResult { internal SearchResult() { } public T Document { get { throw null; } } - public System.Collections.Generic.IList DocumentDebugInfo { get { throw null; } } + public Azure.Search.Documents.Models.DocumentDebugInfo DocumentDebugInfo { get { throw null; } } public System.Collections.Generic.IDictionary> Highlights { get { throw null; } } public double? Score { get { throw null; } } public Azure.Search.Documents.Models.SemanticSearchResult SemanticSearch { get { throw null; } } @@ -3823,6 +4009,23 @@ internal SemanticDebugInfo() { } public static bool operator !=(Azure.Search.Documents.Models.SemanticFieldState left, Azure.Search.Documents.Models.SemanticFieldState right) { throw null; } public override string ToString() { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct SemanticQueryRewritesResultType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public SemanticQueryRewritesResultType(string value) { throw null; } + public static Azure.Search.Documents.Models.SemanticQueryRewritesResultType OriginalQueryOnly { get { throw null; } } + public bool Equals(Azure.Search.Documents.Models.SemanticQueryRewritesResultType 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.Models.SemanticQueryRewritesResultType left, Azure.Search.Documents.Models.SemanticQueryRewritesResultType right) { throw null; } + public static implicit operator Azure.Search.Documents.Models.SemanticQueryRewritesResultType (string value) { throw null; } + public static bool operator !=(Azure.Search.Documents.Models.SemanticQueryRewritesResultType left, Azure.Search.Documents.Models.SemanticQueryRewritesResultType right) { throw null; } + public override string ToString() { throw null; } + } public partial class SemanticSearchOptions { public SemanticSearchOptions() { } @@ -3831,6 +4034,7 @@ public SemanticSearchOptions() { } public System.TimeSpan? MaxWait { get { throw null; } set { } } public Azure.Search.Documents.Models.QueryAnswer QueryAnswer { get { throw null; } set { } } public Azure.Search.Documents.Models.QueryCaption QueryCaption { get { throw null; } set { } } + public Azure.Search.Documents.Models.QueryRewrites QueryRewrites { get { throw null; } set { } } public string SemanticConfigurationName { get { throw null; } set { } } public System.Collections.Generic.IList SemanticFields { get { throw null; } } public string SemanticQuery { get { throw null; } set { } } @@ -3847,6 +4051,7 @@ public SemanticSearchResults() { } public System.Collections.Generic.IReadOnlyList Answers { get { throw null; } } public Azure.Search.Documents.Models.SemanticErrorReason? ErrorReason { get { throw null; } } public Azure.Search.Documents.Models.SemanticSearchResultsType? ResultsType { get { throw null; } } + public Azure.Search.Documents.Models.SemanticQueryRewritesResultType? SemanticQueryRewritesResultType { get { throw null; } } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct SemanticSearchResultsType : System.IEquatable @@ -3920,6 +4125,7 @@ public VectorizableImageUrlQuery() { } public partial class VectorizableTextQuery : Azure.Search.Documents.Models.VectorQuery { public VectorizableTextQuery(string text) { } + public Azure.Search.Documents.Models.QueryRewritesType? QueryRewrites { get { throw null; } set { } } public string Text { get { throw null; } } } public partial class VectorizedQuery : Azure.Search.Documents.Models.VectorQuery 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 987177dd403bf..36813d9980e52 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 @@ -79,7 +79,7 @@ public SearchClient(System.Uri endpoint, string indexName, Azure.Core.TokenCrede } public partial class SearchClientOptions : Azure.Core.ClientOptions { - public SearchClientOptions(Azure.Search.Documents.SearchClientOptions.ServiceVersion version = Azure.Search.Documents.SearchClientOptions.ServiceVersion.V2024_09_01_Preview) { } + public SearchClientOptions(Azure.Search.Documents.SearchClientOptions.ServiceVersion version = Azure.Search.Documents.SearchClientOptions.ServiceVersion.V2024_11_01_Preview) { } public Azure.Search.Documents.SearchAudience? Audience { get { throw null; } set { } } public Azure.Core.Serialization.ObjectSerializer Serializer { get { throw null; } set { } } public Azure.Search.Documents.SearchClientOptions.ServiceVersion Version { get { throw null; } } @@ -88,7 +88,7 @@ public enum ServiceVersion V2020_06_30 = 1, V2023_11_01 = 2, V2024_07_01 = 3, - V2024_09_01_Preview = 4, + V2024_11_01_Preview = 4, } } public static partial class SearchFilter @@ -370,6 +370,18 @@ public VectorSearchFieldAttribute() { } } namespace Azure.Search.Documents.Indexes.Models { + public partial class AIServicesAccountIdentity : Azure.Search.Documents.Indexes.Models.CognitiveServicesAccount + { + public AIServicesAccountIdentity(Azure.Search.Documents.Indexes.Models.SearchIndexerDataIdentity identity, string subdomainUrl) { } + public Azure.Search.Documents.Indexes.Models.SearchIndexerDataIdentity Identity { get { throw null; } set { } } + public string SubdomainUrl { get { throw null; } set { } } + } + public partial class AIServicesAccountKey : Azure.Search.Documents.Indexes.Models.CognitiveServicesAccount + { + public AIServicesAccountKey(string key, string subdomainUrl) { } + public string Key { get { throw null; } set { } } + public string SubdomainUrl { get { throw null; } set { } } + } public partial class AIServicesVisionParameters { public AIServicesVisionParameters(string modelVersion, System.Uri resourceUri) { } @@ -559,6 +571,7 @@ public BinaryQuantizationCompression(string compressionName) : base (default(str public static Azure.Search.Documents.Indexes.Models.BlobIndexerParsingMode Json { get { throw null; } } public static Azure.Search.Documents.Indexes.Models.BlobIndexerParsingMode JsonArray { get { throw null; } } public static Azure.Search.Documents.Indexes.Models.BlobIndexerParsingMode JsonLines { get { throw null; } } + public static Azure.Search.Documents.Indexes.Models.BlobIndexerParsingMode Markdown { get { throw null; } } public static Azure.Search.Documents.Indexes.Models.BlobIndexerParsingMode Text { get { throw null; } } public bool Equals(Azure.Search.Documents.Indexes.Models.BlobIndexerParsingMode other) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] @@ -781,6 +794,51 @@ public DocumentExtractionSkill(System.Collections.Generic.IEnumerable inputs, System.Collections.Generic.IEnumerable outputs) { } + public Azure.Search.Documents.Indexes.Models.DocumentIntelligenceLayoutSkillMarkdownHeaderDepth? MarkdownHeaderDepth { get { throw null; } set { } } + public Azure.Search.Documents.Indexes.Models.DocumentIntelligenceLayoutSkillOutputMode? OutputMode { get { throw null; } set { } } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DocumentIntelligenceLayoutSkillMarkdownHeaderDepth : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DocumentIntelligenceLayoutSkillMarkdownHeaderDepth(string value) { throw null; } + public static Azure.Search.Documents.Indexes.Models.DocumentIntelligenceLayoutSkillMarkdownHeaderDepth H1 { get { throw null; } } + public static Azure.Search.Documents.Indexes.Models.DocumentIntelligenceLayoutSkillMarkdownHeaderDepth H2 { get { throw null; } } + public static Azure.Search.Documents.Indexes.Models.DocumentIntelligenceLayoutSkillMarkdownHeaderDepth H3 { get { throw null; } } + public static Azure.Search.Documents.Indexes.Models.DocumentIntelligenceLayoutSkillMarkdownHeaderDepth H4 { get { throw null; } } + public static Azure.Search.Documents.Indexes.Models.DocumentIntelligenceLayoutSkillMarkdownHeaderDepth H5 { get { throw null; } } + public static Azure.Search.Documents.Indexes.Models.DocumentIntelligenceLayoutSkillMarkdownHeaderDepth H6 { get { throw null; } } + public bool Equals(Azure.Search.Documents.Indexes.Models.DocumentIntelligenceLayoutSkillMarkdownHeaderDepth 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.DocumentIntelligenceLayoutSkillMarkdownHeaderDepth left, Azure.Search.Documents.Indexes.Models.DocumentIntelligenceLayoutSkillMarkdownHeaderDepth right) { throw null; } + public static implicit operator Azure.Search.Documents.Indexes.Models.DocumentIntelligenceLayoutSkillMarkdownHeaderDepth (string value) { throw null; } + public static bool operator !=(Azure.Search.Documents.Indexes.Models.DocumentIntelligenceLayoutSkillMarkdownHeaderDepth left, Azure.Search.Documents.Indexes.Models.DocumentIntelligenceLayoutSkillMarkdownHeaderDepth right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DocumentIntelligenceLayoutSkillOutputMode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DocumentIntelligenceLayoutSkillOutputMode(string value) { throw null; } + public static Azure.Search.Documents.Indexes.Models.DocumentIntelligenceLayoutSkillOutputMode OneToMany { get { throw null; } } + public bool Equals(Azure.Search.Documents.Indexes.Models.DocumentIntelligenceLayoutSkillOutputMode 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.DocumentIntelligenceLayoutSkillOutputMode left, Azure.Search.Documents.Indexes.Models.DocumentIntelligenceLayoutSkillOutputMode right) { throw null; } + public static implicit operator Azure.Search.Documents.Indexes.Models.DocumentIntelligenceLayoutSkillOutputMode (string value) { throw null; } + public static bool operator !=(Azure.Search.Documents.Indexes.Models.DocumentIntelligenceLayoutSkillOutputMode left, Azure.Search.Documents.Indexes.Models.DocumentIntelligenceLayoutSkillOutputMode right) { throw null; } + public override string ToString() { throw null; } + } public partial class EdgeNGramTokenFilter : Azure.Search.Documents.Indexes.Models.TokenFilter { public EdgeNGramTokenFilter(string name) { } @@ -1177,6 +1235,8 @@ public IndexingParametersConfiguration() { } public bool? IndexStorageMetadataOnlyForOversizedDocuments { get { throw null; } set { } } public object this[string key] { get { throw null; } set { } } public System.Collections.Generic.ICollection Keys { get { throw null; } } + public Azure.Search.Documents.Indexes.Models.MarkdownHeaderDepth? MarkdownHeaderDepth { get { throw null; } set { } } + public Azure.Search.Documents.Indexes.Models.MarkdownParsingSubmode? MarkdownParsingSubmode { get { throw null; } set { } } public Azure.Search.Documents.Indexes.Models.BlobIndexerParsingMode? ParsingMode { get { throw null; } set { } } public Azure.Search.Documents.Indexes.Models.BlobIndexerPdfTextRotationAlgorithm? PdfTextRotationAlgorithm { get { throw null; } set { } } public System.TimeSpan? QueryTimeout { get { throw null; } set { } } @@ -1648,6 +1708,46 @@ public partial class MappingCharFilter : Azure.Search.Documents.Indexes.Models.C public MappingCharFilter(string name, System.Collections.Generic.IEnumerable mappings) { } public System.Collections.Generic.IList Mappings { get { throw null; } } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct MarkdownHeaderDepth : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public MarkdownHeaderDepth(string value) { throw null; } + public static Azure.Search.Documents.Indexes.Models.MarkdownHeaderDepth H1 { get { throw null; } } + public static Azure.Search.Documents.Indexes.Models.MarkdownHeaderDepth H2 { get { throw null; } } + public static Azure.Search.Documents.Indexes.Models.MarkdownHeaderDepth H3 { get { throw null; } } + public static Azure.Search.Documents.Indexes.Models.MarkdownHeaderDepth H4 { get { throw null; } } + public static Azure.Search.Documents.Indexes.Models.MarkdownHeaderDepth H5 { get { throw null; } } + public static Azure.Search.Documents.Indexes.Models.MarkdownHeaderDepth H6 { get { throw null; } } + public bool Equals(Azure.Search.Documents.Indexes.Models.MarkdownHeaderDepth 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.MarkdownHeaderDepth left, Azure.Search.Documents.Indexes.Models.MarkdownHeaderDepth right) { throw null; } + public static implicit operator Azure.Search.Documents.Indexes.Models.MarkdownHeaderDepth (string value) { throw null; } + public static bool operator !=(Azure.Search.Documents.Indexes.Models.MarkdownHeaderDepth left, Azure.Search.Documents.Indexes.Models.MarkdownHeaderDepth right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct MarkdownParsingSubmode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public MarkdownParsingSubmode(string value) { throw null; } + public static Azure.Search.Documents.Indexes.Models.MarkdownParsingSubmode OneToMany { get { throw null; } } + public static Azure.Search.Documents.Indexes.Models.MarkdownParsingSubmode OneToOne { get { throw null; } } + public bool Equals(Azure.Search.Documents.Indexes.Models.MarkdownParsingSubmode 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.MarkdownParsingSubmode left, Azure.Search.Documents.Indexes.Models.MarkdownParsingSubmode right) { throw null; } + public static implicit operator Azure.Search.Documents.Indexes.Models.MarkdownParsingSubmode (string value) { throw null; } + public static bool operator !=(Azure.Search.Documents.Indexes.Models.MarkdownParsingSubmode left, Azure.Search.Documents.Indexes.Models.MarkdownParsingSubmode right) { throw null; } + public override string ToString() { throw null; } + } public partial class MergeSkill : Azure.Search.Documents.Indexes.Models.SearchIndexerSkill { public MergeSkill(System.Collections.Generic.IEnumerable inputs, System.Collections.Generic.IEnumerable outputs) { } @@ -2112,6 +2212,13 @@ public PiiDetectionSkill(System.Collections.Generic.IEnumerable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public VectorSearchCompressionRescoreStorageMethod(string value) { throw null; } + public static Azure.Search.Documents.Indexes.Models.VectorSearchCompressionRescoreStorageMethod DiscardOriginals { get { throw null; } } + public static Azure.Search.Documents.Indexes.Models.VectorSearchCompressionRescoreStorageMethod PreserveOriginals { get { throw null; } } + public bool Equals(Azure.Search.Documents.Indexes.Models.VectorSearchCompressionRescoreStorageMethod 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.VectorSearchCompressionRescoreStorageMethod left, Azure.Search.Documents.Indexes.Models.VectorSearchCompressionRescoreStorageMethod right) { throw null; } + public static implicit operator Azure.Search.Documents.Indexes.Models.VectorSearchCompressionRescoreStorageMethod (string value) { throw null; } + public static bool operator !=(Azure.Search.Documents.Indexes.Models.VectorSearchCompressionRescoreStorageMethod left, Azure.Search.Documents.Indexes.Models.VectorSearchCompressionRescoreStorageMethod right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct VectorSearchCompressionTarget : System.IEquatable { private readonly object _dummy; @@ -3248,6 +3374,11 @@ internal AutocompleteResults() { } public double? Coverage { get { throw null; } } public System.Collections.Generic.IReadOnlyList Results { get { throw null; } } } + public partial class DebugInfo + { + internal DebugInfo() { } + public Azure.Search.Documents.Models.QueryRewritesDebugInfo QueryRewrites { get { throw null; } } + } public partial class DocumentDebugInfo { internal DocumentDebugInfo() { } @@ -3258,6 +3389,7 @@ public partial class FacetResult : System.Collections.Generic.IEnumerable> Facets { get { throw null; } } public Azure.Search.Documents.Models.FacetType FacetType { get { throw null; } } public object From { get { throw null; } } public object this[string key] { get { throw null; } } @@ -3372,6 +3504,7 @@ public partial class QueryAnswer public QueryAnswer(Azure.Search.Documents.Models.QueryAnswerType answerType) { } public Azure.Search.Documents.Models.QueryAnswerType AnswerType { get { throw null; } } public int? Count { get { throw null; } set { } } + public int? MaxCharLength { get { throw null; } set { } } public double? Threshold { get { throw null; } set { } } } public partial class QueryAnswerResult @@ -3406,6 +3539,7 @@ public partial class QueryCaption public QueryCaption(Azure.Search.Documents.Models.QueryCaptionType captionType) { } public Azure.Search.Documents.Models.QueryCaptionType CaptionType { get { throw null; } } public bool HighlightEnabled { get { throw null; } set { } } + public int? MaxCharLength { get { throw null; } set { } } } public partial class QueryCaptionResult { @@ -3438,8 +3572,11 @@ internal QueryCaptionResult() { } private readonly object _dummy; private readonly int _dummyPrimitive; public QueryDebugMode(string value) { throw null; } + public static Azure.Search.Documents.Models.QueryDebugMode All { get { throw null; } } public static Azure.Search.Documents.Models.QueryDebugMode Disabled { get { throw null; } } + public static Azure.Search.Documents.Models.QueryDebugMode QueryRewrites { get { throw null; } } public static Azure.Search.Documents.Models.QueryDebugMode Semantic { get { throw null; } } + public static Azure.Search.Documents.Models.QueryDebugMode Vector { get { throw null; } } public bool Equals(Azure.Search.Documents.Models.QueryDebugMode other) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override bool Equals(object obj) { throw null; } @@ -3558,6 +3695,42 @@ internal QueryResultDocumentSubscores() { } public Azure.Search.Documents.Models.TextResult Text { get { throw null; } } public System.Collections.Generic.IReadOnlyList> Vectors { get { throw null; } } } + public partial class QueryRewrites + { + public QueryRewrites(Azure.Search.Documents.Models.QueryRewritesType rewritesType) { } + public int? Count { get { throw null; } set { } } + public Azure.Search.Documents.Models.QueryRewritesType RewritesType { get { throw null; } } + } + public partial class QueryRewritesDebugInfo + { + internal QueryRewritesDebugInfo() { } + public Azure.Search.Documents.Models.QueryRewritesValuesDebugInfo Text { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Vectors { get { throw null; } } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct QueryRewritesType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public QueryRewritesType(string value) { throw null; } + public static Azure.Search.Documents.Models.QueryRewritesType Generative { get { throw null; } } + public static Azure.Search.Documents.Models.QueryRewritesType None { get { throw null; } } + public bool Equals(Azure.Search.Documents.Models.QueryRewritesType 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.Models.QueryRewritesType left, Azure.Search.Documents.Models.QueryRewritesType right) { throw null; } + public static implicit operator Azure.Search.Documents.Models.QueryRewritesType (string value) { throw null; } + public static bool operator !=(Azure.Search.Documents.Models.QueryRewritesType left, Azure.Search.Documents.Models.QueryRewritesType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class QueryRewritesValuesDebugInfo + { + internal QueryRewritesValuesDebugInfo() { } + public string InputQuery { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Rewrites { get { throw null; } } + } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct QuerySpellerType : System.IEquatable { @@ -3653,7 +3826,10 @@ public static partial class SearchModelFactory public static Azure.Search.Documents.Indexes.Models.CognitiveServicesAccount CognitiveServicesAccount(string oDataType, string description) { throw null; } public static Azure.Search.Documents.Indexes.Models.DataChangeDetectionPolicy DataChangeDetectionPolicy(string oDataType) { throw null; } public static Azure.Search.Documents.Indexes.Models.DataDeletionDetectionPolicy DataDeletionDetectionPolicy(string oDataType) { throw null; } + public static Azure.Search.Documents.Models.DebugInfo DebugInfo(Azure.Search.Documents.Models.QueryRewritesDebugInfo queryRewrites = null) { throw null; } public static Azure.Search.Documents.Models.DocumentDebugInfo DocumentDebugInfo(Azure.Search.Documents.Models.SemanticDebugInfo semantic = null, Azure.Search.Documents.Models.VectorsDebugInfo vectors = null) { throw null; } + public static Azure.Search.Documents.Models.FacetResult FacetResult(long? count = default(long?), System.Collections.Generic.IReadOnlyDictionary> facets = null, System.Collections.Generic.IReadOnlyDictionary additionalProperties = null) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.Search.Documents.Models.FacetResult FacetResult(long? count = default(long?), System.Collections.Generic.IReadOnlyDictionary additionalProperties = null) { throw null; } public static Azure.Search.Documents.Models.IndexDocumentsResult IndexDocumentsResult(System.Collections.Generic.IEnumerable results) { throw null; } public static Azure.Search.Documents.Indexes.Models.IndexerChangeTrackingState IndexerChangeTrackingState(string allDocumentsInitialState, string allDocumentsFinalState, string resetDocumentsInitialState, string resetDocumentsFinalState) { throw null; } @@ -3671,6 +3847,8 @@ public static partial class SearchModelFactory public static Azure.Search.Documents.Models.QueryResultDocumentRerankerInput QueryResultDocumentRerankerInput(string title = null, string content = null, string keywords = null) { throw null; } public static Azure.Search.Documents.Models.QueryResultDocumentSemanticField QueryResultDocumentSemanticField(string name = null, Azure.Search.Documents.Models.SemanticFieldState? state = default(Azure.Search.Documents.Models.SemanticFieldState?)) { throw null; } public static Azure.Search.Documents.Models.QueryResultDocumentSubscores QueryResultDocumentSubscores(Azure.Search.Documents.Models.TextResult text = null, System.Collections.Generic.IEnumerable> vectors = null, double? documentBoost = default(double?)) { throw null; } + public static Azure.Search.Documents.Models.QueryRewritesDebugInfo QueryRewritesDebugInfo(Azure.Search.Documents.Models.QueryRewritesValuesDebugInfo text = null, System.Collections.Generic.IEnumerable vectors = null) { throw null; } + public static Azure.Search.Documents.Models.QueryRewritesValuesDebugInfo QueryRewritesValuesDebugInfo(string inputQuery = null, System.Collections.Generic.IEnumerable rewrites = null) { throw null; } public static Azure.Search.Documents.Indexes.Models.ScoringFunction ScoringFunction(string type, string fieldName, double boost, Azure.Search.Documents.Indexes.Models.ScoringFunctionInterpolation? interpolation) { throw null; } public static Azure.Search.Documents.Indexes.Models.SearchIndexerError SearchIndexerError(string key, string errorMessage, int statusCode, string name, string details, string documentationLink) { throw null; } public static Azure.Search.Documents.Indexes.Models.SearchIndexerLimits SearchIndexerLimits(System.TimeSpan? maxRunTime, long? maxDocumentExtractionSize, long? maxDocumentContentCharactersToExtract) { throw null; } @@ -3686,10 +3864,14 @@ public static partial class SearchModelFactory public static Azure.Search.Documents.Models.SearchResultsPage SearchResultsPage(Azure.Search.Documents.Models.SearchResults results) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] 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; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] 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, Azure.Search.Documents.Models.SemanticSearchResults semanticSearch) { 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, Azure.Search.Documents.Models.SemanticSearchResults semanticSearch, Azure.Search.Documents.Models.DebugInfo debugInfo) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] 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.Models.SearchResult SearchResult(T document, double? score, System.Collections.Generic.IDictionary> highlights, Azure.Search.Documents.Models.SemanticSearchResult semanticSearch) { throw null; } + public static Azure.Search.Documents.Models.SearchResult SearchResult(T document, double? score, System.Collections.Generic.IDictionary> highlights, Azure.Search.Documents.Models.SemanticSearchResult semanticSearch, Azure.Search.Documents.Models.DocumentDebugInfo documentDebugInfo) { 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; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] @@ -3704,7 +3886,9 @@ public static partial class SearchModelFactory public static Azure.Search.Documents.Models.SearchSuggestion SearchSuggestion(T document, string text) { throw null; } public static Azure.Search.Documents.Models.SemanticDebugInfo SemanticDebugInfo(Azure.Search.Documents.Models.QueryResultDocumentSemanticField titleField = null, System.Collections.Generic.IEnumerable contentFields = null, System.Collections.Generic.IEnumerable keywordFields = null, Azure.Search.Documents.Models.QueryResultDocumentRerankerInput rerankerInput = null) { throw null; } public static Azure.Search.Documents.Models.SemanticSearchResult SemanticSearchResult(double? rerankerScore, System.Collections.Generic.IReadOnlyList captions) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.Search.Documents.Models.SemanticSearchResults SemanticSearchResults(System.Collections.Generic.IReadOnlyList answers, Azure.Search.Documents.Models.SemanticErrorReason? errorReason, Azure.Search.Documents.Models.SemanticSearchResultsType? resultsType) { throw null; } + public static Azure.Search.Documents.Models.SemanticSearchResults SemanticSearchResults(System.Collections.Generic.IReadOnlyList answers, Azure.Search.Documents.Models.SemanticErrorReason? errorReason, Azure.Search.Documents.Models.SemanticSearchResultsType? resultsType, Azure.Search.Documents.Models.SemanticQueryRewritesResultType? semanticQueryRewritesResultType) { throw null; } public static Azure.Search.Documents.Indexes.Models.SimilarityAlgorithm SimilarityAlgorithm(string oDataType) { throw null; } public static Azure.Search.Documents.Models.SingleVectorFieldResult SingleVectorFieldResult(double? searchScore = default(double?), double? vectorSimilarity = default(double?)) { throw null; } public static Azure.Search.Documents.Models.SuggestResults SuggestResults(System.Collections.Generic.IReadOnlyList> results, double? coverage) { throw null; } @@ -3723,6 +3907,7 @@ public partial class SearchResultsPage : Azure.Page> Facets { get { throw null; } } public Azure.Search.Documents.Models.SemanticSearchResults SemanticSearch { get { throw null; } } public long? TotalCount { get { throw null; } } @@ -3733,6 +3918,7 @@ public partial class SearchResults { internal SearchResults() { } public double? Coverage { get { throw null; } } + public Azure.Search.Documents.Models.DebugInfo DebugInfo { get { throw null; } } public System.Collections.Generic.IDictionary> Facets { get { throw null; } } public Azure.Search.Documents.Models.SemanticSearchResults SemanticSearch { get { throw null; } } public long? TotalCount { get { throw null; } } @@ -3743,7 +3929,7 @@ public partial class SearchResult { internal SearchResult() { } public T Document { get { throw null; } } - public System.Collections.Generic.IList DocumentDebugInfo { get { throw null; } } + public Azure.Search.Documents.Models.DocumentDebugInfo DocumentDebugInfo { get { throw null; } } public System.Collections.Generic.IDictionary> Highlights { get { throw null; } } public double? Score { get { throw null; } } public Azure.Search.Documents.Models.SemanticSearchResult SemanticSearch { get { throw null; } } @@ -3823,6 +4009,23 @@ internal SemanticDebugInfo() { } public static bool operator !=(Azure.Search.Documents.Models.SemanticFieldState left, Azure.Search.Documents.Models.SemanticFieldState right) { throw null; } public override string ToString() { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct SemanticQueryRewritesResultType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public SemanticQueryRewritesResultType(string value) { throw null; } + public static Azure.Search.Documents.Models.SemanticQueryRewritesResultType OriginalQueryOnly { get { throw null; } } + public bool Equals(Azure.Search.Documents.Models.SemanticQueryRewritesResultType 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.Models.SemanticQueryRewritesResultType left, Azure.Search.Documents.Models.SemanticQueryRewritesResultType right) { throw null; } + public static implicit operator Azure.Search.Documents.Models.SemanticQueryRewritesResultType (string value) { throw null; } + public static bool operator !=(Azure.Search.Documents.Models.SemanticQueryRewritesResultType left, Azure.Search.Documents.Models.SemanticQueryRewritesResultType right) { throw null; } + public override string ToString() { throw null; } + } public partial class SemanticSearchOptions { public SemanticSearchOptions() { } @@ -3831,6 +4034,7 @@ public SemanticSearchOptions() { } public System.TimeSpan? MaxWait { get { throw null; } set { } } public Azure.Search.Documents.Models.QueryAnswer QueryAnswer { get { throw null; } set { } } public Azure.Search.Documents.Models.QueryCaption QueryCaption { get { throw null; } set { } } + public Azure.Search.Documents.Models.QueryRewrites QueryRewrites { get { throw null; } set { } } public string SemanticConfigurationName { get { throw null; } set { } } public System.Collections.Generic.IList SemanticFields { get { throw null; } } public string SemanticQuery { get { throw null; } set { } } @@ -3847,6 +4051,7 @@ public SemanticSearchResults() { } public System.Collections.Generic.IReadOnlyList Answers { get { throw null; } } public Azure.Search.Documents.Models.SemanticErrorReason? ErrorReason { get { throw null; } } public Azure.Search.Documents.Models.SemanticSearchResultsType? ResultsType { get { throw null; } } + public Azure.Search.Documents.Models.SemanticQueryRewritesResultType? SemanticQueryRewritesResultType { get { throw null; } } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct SemanticSearchResultsType : System.IEquatable @@ -3920,6 +4125,7 @@ public VectorizableImageUrlQuery() { } public partial class VectorizableTextQuery : Azure.Search.Documents.Models.VectorQuery { public VectorizableTextQuery(string text) { } + public Azure.Search.Documents.Models.QueryRewritesType? QueryRewrites { get { throw null; } set { } } public string Text { get { throw null; } } } public partial class VectorizedQuery : Azure.Search.Documents.Models.VectorQuery diff --git a/sdk/search/Azure.Search.Documents/assets.json b/sdk/search/Azure.Search.Documents/assets.json index 7e35b800eb79e..fe807d0776259 100644 --- a/sdk/search/Azure.Search.Documents/assets.json +++ b/sdk/search/Azure.Search.Documents/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", "TagPrefix": "net/search/Azure.Search.Documents", - "Tag": "net/search/Azure.Search.Documents_1b05ea0ca5" + "Tag": "net/search/Azure.Search.Documents_b66f2d868d" } diff --git a/sdk/search/Azure.Search.Documents/src/Generated/AliasesRestClient.cs b/sdk/search/Azure.Search.Documents/src/Generated/AliasesRestClient.cs index 677bb77903b94..4d6b40140ad79 100644 --- a/sdk/search/Azure.Search.Documents/src/Generated/AliasesRestClient.cs +++ b/sdk/search/Azure.Search.Documents/src/Generated/AliasesRestClient.cs @@ -32,7 +32,7 @@ internal partial class AliasesRestClient /// The tracking ID sent with the request to help with debugging. /// Api Version. /// , , or is null. - public AliasesRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string endpoint, Guid? xMsClientRequestId = null, string apiVersion = "2024-09-01-preview") + public AliasesRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string endpoint, Guid? xMsClientRequestId = null, string apiVersion = "2024-11-01-preview") { ClientDiagnostics = clientDiagnostics ?? throw new ArgumentNullException(nameof(clientDiagnostics)); _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); diff --git a/sdk/search/Azure.Search.Documents/src/Generated/DataSourcesRestClient.cs b/sdk/search/Azure.Search.Documents/src/Generated/DataSourcesRestClient.cs index 95d44366b9b23..92c11d867206a 100644 --- a/sdk/search/Azure.Search.Documents/src/Generated/DataSourcesRestClient.cs +++ b/sdk/search/Azure.Search.Documents/src/Generated/DataSourcesRestClient.cs @@ -32,7 +32,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 = "2024-09-01-preview") + public DataSourcesRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string endpoint, Guid? xMsClientRequestId = null, string apiVersion = "2024-11-01-preview") { ClientDiagnostics = clientDiagnostics ?? throw new ArgumentNullException(nameof(clientDiagnostics)); _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); diff --git a/sdk/search/Azure.Search.Documents/src/Generated/DocumentsRestClient.cs b/sdk/search/Azure.Search.Documents/src/Generated/DocumentsRestClient.cs index 0d70b65884c2b..985065d34e6e8 100644 --- a/sdk/search/Azure.Search.Documents/src/Generated/DocumentsRestClient.cs +++ b/sdk/search/Azure.Search.Documents/src/Generated/DocumentsRestClient.cs @@ -36,7 +36,7 @@ internal partial class DocumentsRestClient /// Api Version. /// , , , or is null. /// is an empty string, and was expected to be non-empty. - public DocumentsRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string endpoint, string indexName, Guid? xMsClientRequestId = null, string apiVersion = "2024-09-01-preview") + public DocumentsRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string endpoint, string indexName, Guid? xMsClientRequestId = null, string apiVersion = "2024-11-01-preview") { ClientDiagnostics = clientDiagnostics ?? throw new ArgumentNullException(nameof(clientDiagnostics)); _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); diff --git a/sdk/search/Azure.Search.Documents/src/Generated/IndexersRestClient.cs b/sdk/search/Azure.Search.Documents/src/Generated/IndexersRestClient.cs index 9f01d26b906f5..685b624de7979 100644 --- a/sdk/search/Azure.Search.Documents/src/Generated/IndexersRestClient.cs +++ b/sdk/search/Azure.Search.Documents/src/Generated/IndexersRestClient.cs @@ -33,7 +33,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 = "2024-09-01-preview") + public IndexersRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string endpoint, Guid? xMsClientRequestId = null, string apiVersion = "2024-11-01-preview") { ClientDiagnostics = clientDiagnostics ?? throw new ArgumentNullException(nameof(clientDiagnostics)); _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); diff --git a/sdk/search/Azure.Search.Documents/src/Generated/IndexesRestClient.cs b/sdk/search/Azure.Search.Documents/src/Generated/IndexesRestClient.cs index a1ef741d102c0..8dfe31f111ef6 100644 --- a/sdk/search/Azure.Search.Documents/src/Generated/IndexesRestClient.cs +++ b/sdk/search/Azure.Search.Documents/src/Generated/IndexesRestClient.cs @@ -32,7 +32,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 = "2024-09-01-preview") + public IndexesRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string endpoint, Guid? xMsClientRequestId = null, string apiVersion = "2024-11-01-preview") { ClientDiagnostics = clientDiagnostics ?? throw new ArgumentNullException(nameof(clientDiagnostics)); _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/AIServicesAccountIdentity.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/AIServicesAccountIdentity.Serialization.cs new file mode 100644 index 0000000000000..a28372654f271 --- /dev/null +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/AIServicesAccountIdentity.Serialization.cs @@ -0,0 +1,96 @@ +// 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 AIServicesAccountIdentity : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Identity != null) + { + writer.WritePropertyName("identity"u8); + writer.WriteObjectValue(Identity); + } + else + { + writer.WriteNull("identity"); + } + writer.WritePropertyName("subdomainUrl"u8); + writer.WriteStringValue(SubdomainUrl); + writer.WritePropertyName("@odata.type"u8); + writer.WriteStringValue(ODataType); + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + writer.WriteEndObject(); + } + + internal static AIServicesAccountIdentity DeserializeAIServicesAccountIdentity(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + SearchIndexerDataIdentity identity = default; + string subdomainUrl = default; + string odataType = default; + string description = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("identity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + identity = null; + continue; + } + identity = SearchIndexerDataIdentity.DeserializeSearchIndexerDataIdentity(property.Value); + continue; + } + if (property.NameEquals("subdomainUrl"u8)) + { + subdomainUrl = property.Value.GetString(); + continue; + } + if (property.NameEquals("@odata.type"u8)) + { + odataType = property.Value.GetString(); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + } + return new AIServicesAccountIdentity(odataType, description, identity, subdomainUrl); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new AIServicesAccountIdentity FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeAIServicesAccountIdentity(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/AIServicesAccountIdentity.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/AIServicesAccountIdentity.cs new file mode 100644 index 0000000000000..21d3f28612591 --- /dev/null +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/AIServicesAccountIdentity.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Search.Documents.Indexes.Models +{ + /// The multi-region account of an Azure AI service resource that's attached to a skillset. + public partial class AIServicesAccountIdentity : CognitiveServicesAccount + { + /// Initializes a new instance of . + /// + /// The user-assigned managed identity used for connections to AI Service. If not specified, the system-assigned managed identity is used. On updates to the skillset, if the identity is unspecified, the value remains unchanged. If set to "none", the value of this property is cleared. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + /// The subdomain url for the corresponding AI Service. + /// is null. + public AIServicesAccountIdentity(SearchIndexerDataIdentity identity, string subdomainUrl) + { + Argument.AssertNotNull(subdomainUrl, nameof(subdomainUrl)); + + Identity = identity; + SubdomainUrl = subdomainUrl; + ODataType = "#Microsoft.Azure.Search.AIServicesByIdentity"; + } + + /// Initializes a new instance of . + /// A URI fragment specifying the type of Azure AI service resource attached to a skillset. + /// Description of the Azure AI service resource attached to a skillset. + /// + /// The user-assigned managed identity used for connections to AI Service. If not specified, the system-assigned managed identity is used. On updates to the skillset, if the identity is unspecified, the value remains unchanged. If set to "none", the value of this property is cleared. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + /// The subdomain url for the corresponding AI Service. + internal AIServicesAccountIdentity(string oDataType, string description, SearchIndexerDataIdentity identity, string subdomainUrl) : base(oDataType, description) + { + Identity = identity; + SubdomainUrl = subdomainUrl; + ODataType = oDataType ?? "#Microsoft.Azure.Search.AIServicesByIdentity"; + } + + /// + /// The user-assigned managed identity used for connections to AI Service. If not specified, the system-assigned managed identity is used. On updates to the skillset, if the identity is unspecified, the value remains unchanged. If set to "none", the value of this property is cleared. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + public SearchIndexerDataIdentity Identity { get; set; } + /// The subdomain url for the corresponding AI Service. + public string SubdomainUrl { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/AIServicesAccountKey.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/AIServicesAccountKey.Serialization.cs new file mode 100644 index 0000000000000..7a4b7eb9f4c9c --- /dev/null +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/AIServicesAccountKey.Serialization.cs @@ -0,0 +1,84 @@ +// 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 AIServicesAccountKey : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("key"u8); + writer.WriteStringValue(Key); + writer.WritePropertyName("subdomainUrl"u8); + writer.WriteStringValue(SubdomainUrl); + writer.WritePropertyName("@odata.type"u8); + writer.WriteStringValue(ODataType); + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + writer.WriteEndObject(); + } + + internal static AIServicesAccountKey DeserializeAIServicesAccountKey(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string key = default; + string subdomainUrl = default; + string odataType = default; + string description = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("key"u8)) + { + key = property.Value.GetString(); + continue; + } + if (property.NameEquals("subdomainUrl"u8)) + { + subdomainUrl = property.Value.GetString(); + continue; + } + if (property.NameEquals("@odata.type"u8)) + { + odataType = property.Value.GetString(); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + } + return new AIServicesAccountKey(odataType, description, key, subdomainUrl); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new AIServicesAccountKey FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeAIServicesAccountKey(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/AIServicesAccountKey.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/AIServicesAccountKey.cs new file mode 100644 index 0000000000000..9fc583eb0fd60 --- /dev/null +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/AIServicesAccountKey.cs @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Search.Documents.Indexes.Models +{ + /// The account key of an Azure AI service resource that's attached to a skillset, to be used with the resource's subdomain. + public partial class AIServicesAccountKey : CognitiveServicesAccount + { + /// Initializes a new instance of . + /// The key used to provision the Azure AI service resource attached to a skillset. + /// The subdomain url for the corresponding AI Service. + /// or is null. + public AIServicesAccountKey(string key, string subdomainUrl) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(subdomainUrl, nameof(subdomainUrl)); + + Key = key; + SubdomainUrl = subdomainUrl; + ODataType = "#Microsoft.Azure.Search.AIServicesByKey"; + } + + /// Initializes a new instance of . + /// A URI fragment specifying the type of Azure AI service resource attached to a skillset. + /// Description of the Azure AI service resource attached to a skillset. + /// The key used to provision the Azure AI service resource attached to a skillset. + /// The subdomain url for the corresponding AI Service. + internal AIServicesAccountKey(string oDataType, string description, string key, string subdomainUrl) : base(oDataType, description) + { + Key = key; + SubdomainUrl = subdomainUrl; + ODataType = oDataType ?? "#Microsoft.Azure.Search.AIServicesByKey"; + } + + /// The key used to provision the Azure AI service resource attached to a skillset. + public string Key { get; set; } + /// The subdomain url for the corresponding AI Service. + public string SubdomainUrl { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/BinaryQuantizationCompression.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/BinaryQuantizationCompression.Serialization.cs index fcbcaf9b841eb..b9157d38df02b 100644 --- a/sdk/search/Azure.Search.Documents/src/Generated/Models/BinaryQuantizationCompression.Serialization.cs +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/BinaryQuantizationCompression.Serialization.cs @@ -36,6 +36,18 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WriteNull("defaultOversampling"); } } + if (Optional.IsDefined(RescoringOptions)) + { + if (RescoringOptions != null) + { + writer.WritePropertyName("rescoringOptions"u8); + writer.WriteObjectValue(RescoringOptions); + } + else + { + writer.WriteNull("rescoringOptions"); + } + } if (Optional.IsDefined(TruncationDimension)) { if (TruncationDimension != null) @@ -61,6 +73,7 @@ internal static BinaryQuantizationCompression DeserializeBinaryQuantizationCompr VectorSearchCompressionKind kind = default; bool? rerankWithOriginalVectors = default; double? defaultOversampling = default; + RescoringOptions rescoringOptions = default; int? truncationDimension = default; foreach (var property in element.EnumerateObject()) { @@ -93,6 +106,16 @@ internal static BinaryQuantizationCompression DeserializeBinaryQuantizationCompr defaultOversampling = property.Value.GetDouble(); continue; } + if (property.NameEquals("rescoringOptions"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + rescoringOptions = null; + continue; + } + rescoringOptions = RescoringOptions.DeserializeRescoringOptions(property.Value); + continue; + } if (property.NameEquals("truncationDimension"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -104,7 +127,13 @@ internal static BinaryQuantizationCompression DeserializeBinaryQuantizationCompr continue; } } - return new BinaryQuantizationCompression(name, kind, rerankWithOriginalVectors, defaultOversampling, truncationDimension); + return new BinaryQuantizationCompression( + name, + kind, + rerankWithOriginalVectors, + defaultOversampling, + rescoringOptions, + truncationDimension); } /// Deserializes the model from a raw response. diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/BinaryQuantizationCompression.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/BinaryQuantizationCompression.cs index 5744abba047c6..fc8caec0912b6 100644 --- a/sdk/search/Azure.Search.Documents/src/Generated/Models/BinaryQuantizationCompression.cs +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/BinaryQuantizationCompression.cs @@ -27,8 +27,9 @@ public BinaryQuantizationCompression(string compressionName) : base(compressionN /// The name of the kind of compression method being configured for use with vector search. /// If set to true, once the ordered set of results calculated using compressed vectors are obtained, they will be reranked again by recalculating the full-precision similarity scores. This will improve recall at the expense of latency. /// Default oversampling factor. Oversampling will internally request more documents (specified by this multiplier) in the initial search. This increases the set of results that will be reranked using recomputed similarity scores from full-precision vectors. Minimum value is 1, meaning no oversampling (1x). This parameter can only be set when rerankWithOriginalVectors is true. Higher values improve recall at the expense of latency. + /// Contains the options for rescoring. /// The number of dimensions to truncate the vectors to. Truncating the vectors reduces the size of the vectors and the amount of data that needs to be transferred during search. This can save storage cost and improve search performance at the expense of recall. It should be only used for embeddings trained with Matryoshka Representation Learning (MRL) such as OpenAI text-embedding-3-large (small). The default value is null, which means no truncation. - internal BinaryQuantizationCompression(string compressionName, VectorSearchCompressionKind kind, bool? rerankWithOriginalVectors, double? defaultOversampling, int? truncationDimension) : base(compressionName, kind, rerankWithOriginalVectors, defaultOversampling, truncationDimension) + internal BinaryQuantizationCompression(string compressionName, VectorSearchCompressionKind kind, bool? rerankWithOriginalVectors, double? defaultOversampling, RescoringOptions rescoringOptions, int? truncationDimension) : base(compressionName, kind, rerankWithOriginalVectors, defaultOversampling, rescoringOptions, truncationDimension) { Kind = kind; } diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/BlobIndexerParsingMode.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/BlobIndexerParsingMode.cs index 85eb9e9eb23f1..a7a0e11f98aac 100644 --- a/sdk/search/Azure.Search.Documents/src/Generated/Models/BlobIndexerParsingMode.cs +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/BlobIndexerParsingMode.cs @@ -28,6 +28,7 @@ public BlobIndexerParsingMode(string value) private const string JsonValue = "json"; private const string JsonArrayValue = "jsonArray"; private const string JsonLinesValue = "jsonLines"; + private const string MarkdownValue = "markdown"; /// Set to default for normal file processing. public static BlobIndexerParsingMode Default { get; } = new BlobIndexerParsingMode(DefaultValue); @@ -41,6 +42,8 @@ public BlobIndexerParsingMode(string value) public static BlobIndexerParsingMode JsonArray { get; } = new BlobIndexerParsingMode(JsonArrayValue); /// Set to jsonLines to extract individual JSON entities, separated by a new line, as separate documents. public static BlobIndexerParsingMode JsonLines { get; } = new BlobIndexerParsingMode(JsonLinesValue); + /// Set to markdown to extract content from markdown files. + public static BlobIndexerParsingMode Markdown { get; } = new BlobIndexerParsingMode(MarkdownValue); /// Determines if two values are the same. public static bool operator ==(BlobIndexerParsingMode left, BlobIndexerParsingMode right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/CognitiveServicesAccount.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/CognitiveServicesAccount.Serialization.cs index 299341426c187..b9ce6451c3d40 100644 --- a/sdk/search/Azure.Search.Documents/src/Generated/Models/CognitiveServicesAccount.Serialization.cs +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/CognitiveServicesAccount.Serialization.cs @@ -36,6 +36,8 @@ internal static CognitiveServicesAccount DeserializeCognitiveServicesAccount(Jso { switch (discriminator.GetString()) { + case "#Microsoft.Azure.Search.AIServicesByIdentity": return AIServicesAccountIdentity.DeserializeAIServicesAccountIdentity(element); + case "#Microsoft.Azure.Search.AIServicesByKey": return AIServicesAccountKey.DeserializeAIServicesAccountKey(element); case "#Microsoft.Azure.Search.CognitiveServicesByKey": return CognitiveServicesAccountKey.DeserializeCognitiveServicesAccountKey(element); case "#Microsoft.Azure.Search.DefaultCognitiveServices": return DefaultCognitiveServicesAccount.DeserializeDefaultCognitiveServicesAccount(element); } diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/CognitiveServicesAccount.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/CognitiveServicesAccount.cs index 58a8ac32e2b67..d9a85ae2aab0f 100644 --- a/sdk/search/Azure.Search.Documents/src/Generated/Models/CognitiveServicesAccount.cs +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/CognitiveServicesAccount.cs @@ -10,7 +10,7 @@ namespace Azure.Search.Documents.Indexes.Models /// /// Base type for describing any Azure AI service resource attached to a skillset. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include and . + /// The available derived classes include , , and . /// public partial class CognitiveServicesAccount { diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/DebugInfo.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/DebugInfo.Serialization.cs new file mode 100644 index 0000000000000..31c08d33c7e26 --- /dev/null +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/DebugInfo.Serialization.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; + +namespace Azure.Search.Documents.Models +{ + public partial class DebugInfo + { + internal static DebugInfo DeserializeDebugInfo(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + QueryRewritesDebugInfo queryRewrites = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("queryRewrites"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + queryRewrites = QueryRewritesDebugInfo.DeserializeQueryRewritesDebugInfo(property.Value); + continue; + } + } + return new DebugInfo(queryRewrites); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static DebugInfo FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeDebugInfo(document.RootElement); + } + } +} diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/DebugInfo.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/DebugInfo.cs new file mode 100644 index 0000000000000..b50ff0c0537f4 --- /dev/null +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/DebugInfo.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Search.Documents.Models +{ + /// Contains debugging information that can be used to further explore your search results. + public partial class DebugInfo + { + /// Initializes a new instance of . + internal DebugInfo() + { + } + + /// Initializes a new instance of . + /// Contains debugging information specific to query rewrites. + internal DebugInfo(QueryRewritesDebugInfo queryRewrites) + { + QueryRewrites = queryRewrites; + } + + /// Contains debugging information specific to query rewrites. + public QueryRewritesDebugInfo QueryRewrites { get; } + } +} diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/DocumentIntelligenceLayoutSkill.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/DocumentIntelligenceLayoutSkill.Serialization.cs new file mode 100644 index 0000000000000..99c9d068715e4 --- /dev/null +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/DocumentIntelligenceLayoutSkill.Serialization.cs @@ -0,0 +1,181 @@ +// 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 DocumentIntelligenceLayoutSkill : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(OutputMode)) + { + if (OutputMode != null) + { + writer.WritePropertyName("outputMode"u8); + writer.WriteStringValue(OutputMode.Value.ToString()); + } + else + { + writer.WriteNull("outputMode"); + } + } + if (Optional.IsDefined(MarkdownHeaderDepth)) + { + if (MarkdownHeaderDepth != null) + { + writer.WritePropertyName("markdownHeaderDepth"u8); + writer.WriteStringValue(MarkdownHeaderDepth.Value.ToString()); + } + else + { + writer.WriteNull("markdownHeaderDepth"); + } + } + writer.WritePropertyName("@odata.type"u8); + writer.WriteStringValue(ODataType); + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + if (Optional.IsDefined(Context)) + { + writer.WritePropertyName("context"u8); + writer.WriteStringValue(Context); + } + writer.WritePropertyName("inputs"u8); + writer.WriteStartArray(); + foreach (var item in Inputs) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + writer.WritePropertyName("outputs"u8); + writer.WriteStartArray(); + foreach (var item in Outputs) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + writer.WriteEndObject(); + } + + internal static DocumentIntelligenceLayoutSkill DeserializeDocumentIntelligenceLayoutSkill(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DocumentIntelligenceLayoutSkillOutputMode? outputMode = default; + DocumentIntelligenceLayoutSkillMarkdownHeaderDepth? markdownHeaderDepth = default; + string odataType = default; + string name = default; + string description = default; + string context = default; + IList inputs = default; + IList outputs = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("outputMode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + outputMode = null; + continue; + } + outputMode = new DocumentIntelligenceLayoutSkillOutputMode(property.Value.GetString()); + continue; + } + if (property.NameEquals("markdownHeaderDepth"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + markdownHeaderDepth = null; + continue; + } + markdownHeaderDepth = new DocumentIntelligenceLayoutSkillMarkdownHeaderDepth(property.Value.GetString()); + continue; + } + if (property.NameEquals("@odata.type"u8)) + { + odataType = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("context"u8)) + { + context = property.Value.GetString(); + continue; + } + if (property.NameEquals("inputs"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(InputFieldMappingEntry.DeserializeInputFieldMappingEntry(item)); + } + inputs = array; + continue; + } + if (property.NameEquals("outputs"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(OutputFieldMappingEntry.DeserializeOutputFieldMappingEntry(item)); + } + outputs = array; + continue; + } + } + return new DocumentIntelligenceLayoutSkill( + odataType, + name, + description, + context, + inputs, + outputs, + outputMode, + markdownHeaderDepth); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new DocumentIntelligenceLayoutSkill FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeDocumentIntelligenceLayoutSkill(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/DocumentIntelligenceLayoutSkill.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/DocumentIntelligenceLayoutSkill.cs new file mode 100644 index 0000000000000..75eafce1323a3 --- /dev/null +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/DocumentIntelligenceLayoutSkill.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; + +namespace Azure.Search.Documents.Indexes.Models +{ + /// A skill that extracts content and layout information (as markdown), via Azure AI Services, from files within the enrichment pipeline. + public partial class DocumentIntelligenceLayoutSkill : SearchIndexerSkill + { + /// Initializes a new instance of . + /// 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 DocumentIntelligenceLayoutSkill(IEnumerable inputs, IEnumerable outputs) : base(inputs, outputs) + { + Argument.AssertNotNull(inputs, nameof(inputs)); + Argument.AssertNotNull(outputs, nameof(outputs)); + + ODataType = "#Microsoft.Skills.Util.DocumentIntelligenceLayoutSkill"; + } + + /// Initializes a new instance of . + /// A URI fragment specifying the type of 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. + /// Controls the cardinality of the output produced by the skill. Default is 'oneToMany'. + /// The depth of headers in the markdown output. Default is h6. + internal DocumentIntelligenceLayoutSkill(string oDataType, string name, string description, string context, IList inputs, IList outputs, DocumentIntelligenceLayoutSkillOutputMode? outputMode, DocumentIntelligenceLayoutSkillMarkdownHeaderDepth? markdownHeaderDepth) : base(oDataType, name, description, context, inputs, outputs) + { + OutputMode = outputMode; + MarkdownHeaderDepth = markdownHeaderDepth; + ODataType = oDataType ?? "#Microsoft.Skills.Util.DocumentIntelligenceLayoutSkill"; + } + + /// Controls the cardinality of the output produced by the skill. Default is 'oneToMany'. + public DocumentIntelligenceLayoutSkillOutputMode? OutputMode { get; set; } + /// The depth of headers in the markdown output. Default is h6. + public DocumentIntelligenceLayoutSkillMarkdownHeaderDepth? MarkdownHeaderDepth { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/DocumentIntelligenceLayoutSkillMarkdownHeaderDepth.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/DocumentIntelligenceLayoutSkillMarkdownHeaderDepth.cs new file mode 100644 index 0000000000000..b6b8060a33cf7 --- /dev/null +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/DocumentIntelligenceLayoutSkillMarkdownHeaderDepth.cs @@ -0,0 +1,63 @@ +// 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 depth of headers in the markdown output. Default is h6. + public readonly partial struct DocumentIntelligenceLayoutSkillMarkdownHeaderDepth : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DocumentIntelligenceLayoutSkillMarkdownHeaderDepth(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string H1Value = "h1"; + private const string H2Value = "h2"; + private const string H3Value = "h3"; + private const string H4Value = "h4"; + private const string H5Value = "h5"; + private const string H6Value = "h6"; + + /// Header level 1. + public static DocumentIntelligenceLayoutSkillMarkdownHeaderDepth H1 { get; } = new DocumentIntelligenceLayoutSkillMarkdownHeaderDepth(H1Value); + /// Header level 2. + public static DocumentIntelligenceLayoutSkillMarkdownHeaderDepth H2 { get; } = new DocumentIntelligenceLayoutSkillMarkdownHeaderDepth(H2Value); + /// Header level 3. + public static DocumentIntelligenceLayoutSkillMarkdownHeaderDepth H3 { get; } = new DocumentIntelligenceLayoutSkillMarkdownHeaderDepth(H3Value); + /// Header level 4. + public static DocumentIntelligenceLayoutSkillMarkdownHeaderDepth H4 { get; } = new DocumentIntelligenceLayoutSkillMarkdownHeaderDepth(H4Value); + /// Header level 5. + public static DocumentIntelligenceLayoutSkillMarkdownHeaderDepth H5 { get; } = new DocumentIntelligenceLayoutSkillMarkdownHeaderDepth(H5Value); + /// Header level 6. + public static DocumentIntelligenceLayoutSkillMarkdownHeaderDepth H6 { get; } = new DocumentIntelligenceLayoutSkillMarkdownHeaderDepth(H6Value); + /// Determines if two values are the same. + public static bool operator ==(DocumentIntelligenceLayoutSkillMarkdownHeaderDepth left, DocumentIntelligenceLayoutSkillMarkdownHeaderDepth right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DocumentIntelligenceLayoutSkillMarkdownHeaderDepth left, DocumentIntelligenceLayoutSkillMarkdownHeaderDepth right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DocumentIntelligenceLayoutSkillMarkdownHeaderDepth(string value) => new DocumentIntelligenceLayoutSkillMarkdownHeaderDepth(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DocumentIntelligenceLayoutSkillMarkdownHeaderDepth other && Equals(other); + /// + public bool Equals(DocumentIntelligenceLayoutSkillMarkdownHeaderDepth other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/DocumentIntelligenceLayoutSkillOutputMode.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/DocumentIntelligenceLayoutSkillOutputMode.cs new file mode 100644 index 0000000000000..50559c358b555 --- /dev/null +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/DocumentIntelligenceLayoutSkillOutputMode.cs @@ -0,0 +1,48 @@ +// 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 +{ + /// Controls the cardinality of the output produced by the skill. Default is 'oneToMany'. + public readonly partial struct DocumentIntelligenceLayoutSkillOutputMode : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DocumentIntelligenceLayoutSkillOutputMode(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string OneToManyValue = "oneToMany"; + + /// Specify the deepest markdown header section to parse. + public static DocumentIntelligenceLayoutSkillOutputMode OneToMany { get; } = new DocumentIntelligenceLayoutSkillOutputMode(OneToManyValue); + /// Determines if two values are the same. + public static bool operator ==(DocumentIntelligenceLayoutSkillOutputMode left, DocumentIntelligenceLayoutSkillOutputMode right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DocumentIntelligenceLayoutSkillOutputMode left, DocumentIntelligenceLayoutSkillOutputMode right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DocumentIntelligenceLayoutSkillOutputMode(string value) => new DocumentIntelligenceLayoutSkillOutputMode(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DocumentIntelligenceLayoutSkillOutputMode other && Equals(other); + /// + public bool Equals(DocumentIntelligenceLayoutSkillOutputMode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/FacetResult.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/FacetResult.Serialization.cs index 94a2ad5b3051a..d40fe03b16fda 100644 --- a/sdk/search/Azure.Search.Documents/src/Generated/Models/FacetResult.Serialization.cs +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/FacetResult.Serialization.cs @@ -19,6 +19,7 @@ internal static FacetResult DeserializeFacetResult(JsonElement element) return null; } long? count = default; + IReadOnlyDictionary> searchFacets = default; IReadOnlyDictionary additionalProperties = default; Dictionary additionalPropertiesDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -32,10 +33,36 @@ internal static FacetResult DeserializeFacetResult(JsonElement element) count = property.Value.GetInt64(); continue; } + if (property.NameEquals("@search.facets"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary> dictionary = new Dictionary>(); + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(property0.Name, null); + } + else + { + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(DeserializeFacetResult(item)); + } + dictionary.Add(property0.Name, array); + } + } + searchFacets = dictionary; + continue; + } additionalPropertiesDictionary.Add(property.Name, property.Value.GetObject()); } additionalProperties = additionalPropertiesDictionary; - return new FacetResult(count, additionalProperties); + return new FacetResult(count, searchFacets ?? new ChangeTrackingDictionary>(), additionalProperties); } /// Deserializes the model from a raw response. diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/FacetResult.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/FacetResult.cs index 1d1e5251d686e..fa48a3d346a97 100644 --- a/sdk/search/Azure.Search.Documents/src/Generated/Models/FacetResult.cs +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/FacetResult.cs @@ -15,19 +15,24 @@ public partial class FacetResult /// Initializes a new instance of . internal FacetResult() { + Facets = new ChangeTrackingDictionary>(); AdditionalProperties = new ChangeTrackingDictionary(); } /// Initializes a new instance of . /// The approximate count of documents falling within the bucket described by this facet. + /// The nested facet query results for the search operation, organized as a collection of buckets for each faceted field; null if the query did not contain any nested facets. /// Additional Properties. - internal FacetResult(long? count, IReadOnlyDictionary additionalProperties) + internal FacetResult(long? count, IReadOnlyDictionary> facets, IReadOnlyDictionary additionalProperties) { Count = count; + Facets = facets; AdditionalProperties = additionalProperties; } /// The approximate count of documents falling within the bucket described by this facet. public long? Count { get; } + /// The nested facet query results for the search operation, organized as a collection of buckets for each faceted field; null if the query did not contain any nested facets. + public IReadOnlyDictionary> Facets { get; } } } diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/IndexingParametersConfiguration.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/IndexingParametersConfiguration.Serialization.cs index 6179c10a859bd..5dcb8ab792b7c 100644 --- a/sdk/search/Azure.Search.Documents/src/Generated/Models/IndexingParametersConfiguration.Serialization.cs +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/IndexingParametersConfiguration.Serialization.cs @@ -61,6 +61,30 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("firstLineContainsHeaders"u8); writer.WriteBooleanValue(FirstLineContainsHeaders.Value); } + if (Optional.IsDefined(MarkdownParsingSubmode)) + { + if (MarkdownParsingSubmode != null) + { + writer.WritePropertyName("markdownParsingSubmode"u8); + writer.WriteStringValue(MarkdownParsingSubmode.Value.ToString()); + } + else + { + writer.WriteNull("markdownParsingSubmode"); + } + } + if (Optional.IsDefined(MarkdownHeaderDepth)) + { + if (MarkdownHeaderDepth != null) + { + writer.WritePropertyName("markdownHeaderDepth"u8); + writer.WriteStringValue(MarkdownHeaderDepth.Value.ToString()); + } + else + { + writer.WriteNull("markdownHeaderDepth"); + } + } if (Optional.IsDefined(DocumentRoot)) { writer.WritePropertyName("documentRoot"u8); @@ -119,6 +143,8 @@ internal static IndexingParametersConfiguration DeserializeIndexingParametersCon string delimitedTextHeaders = default; string delimitedTextDelimiter = default; bool? firstLineContainsHeaders = default; + MarkdownParsingSubmode? markdownParsingSubmode = default; + MarkdownHeaderDepth? markdownHeaderDepth = default; string documentRoot = default; BlobIndexerDataToExtract? dataToExtract = default; BlobIndexerImageAction? imageAction = default; @@ -195,6 +221,26 @@ internal static IndexingParametersConfiguration DeserializeIndexingParametersCon firstLineContainsHeaders = property.Value.GetBoolean(); continue; } + if (property.NameEquals("markdownParsingSubmode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + markdownParsingSubmode = null; + continue; + } + markdownParsingSubmode = new MarkdownParsingSubmode(property.Value.GetString()); + continue; + } + if (property.NameEquals("markdownHeaderDepth"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + markdownHeaderDepth = null; + continue; + } + markdownHeaderDepth = new MarkdownHeaderDepth(property.Value.GetString()); + continue; + } if (property.NameEquals("documentRoot"u8)) { documentRoot = property.Value.GetString(); @@ -263,6 +309,8 @@ internal static IndexingParametersConfiguration DeserializeIndexingParametersCon delimitedTextHeaders, delimitedTextDelimiter, firstLineContainsHeaders, + markdownParsingSubmode, + markdownHeaderDepth, documentRoot, dataToExtract, imageAction, diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/IndexingParametersConfiguration.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/IndexingParametersConfiguration.cs index d71817c7b4b58..65198da470e34 100644 --- a/sdk/search/Azure.Search.Documents/src/Generated/Models/IndexingParametersConfiguration.cs +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/IndexingParametersConfiguration.cs @@ -28,6 +28,8 @@ public IndexingParametersConfiguration() /// For CSV blobs, specifies a comma-delimited list of column headers, useful for mapping source fields to destination fields in an index. /// For CSV blobs, specifies the end-of-line single-character delimiter for CSV files where each line starts a new document (for example, "|"). /// For CSV blobs, indicates that the first (non-blank) line of each blob contains headers. + /// Specifies the submode that will determine whether a markdown file will be parsed into exactly one search document or multiple search documents. Default is `oneToMany`. + /// Specifies the max header depth that will be considered while grouping markdown content. Default is `h6`. /// For JSON arrays, given a structured or semi-structured document, you can specify a path to the array using this property. /// Specifies the data to extract from Azure blob storage and tells the indexer which data to extract from image content when "imageAction" is set to a value other than "none". This applies to embedded image content in a .PDF or other application, or image files such as .jpg and .png, in Azure blobs. /// Determines how to process embedded images and image files in Azure blob storage. Setting the "imageAction" configuration to any value other than "none" requires that a skillset also be attached to that indexer. @@ -36,7 +38,7 @@ public IndexingParametersConfiguration() /// Specifies the environment in which the indexer should execute. /// Increases the timeout beyond the 5-minute default for Azure SQL database data sources, specified in the format "hh:mm:ss". /// Additional Properties. - internal IndexingParametersConfiguration(BlobIndexerParsingMode? parsingMode, string excludedFileNameExtensions, string indexedFileNameExtensions, bool? failOnUnsupportedContentType, bool? failOnUnprocessableDocument, bool? indexStorageMetadataOnlyForOversizedDocuments, string delimitedTextHeaders, string delimitedTextDelimiter, bool? firstLineContainsHeaders, string documentRoot, BlobIndexerDataToExtract? dataToExtract, BlobIndexerImageAction? imageAction, bool? allowSkillsetToReadFileData, BlobIndexerPdfTextRotationAlgorithm? pdfTextRotationAlgorithm, IndexerExecutionEnvironment? executionEnvironment, string queryTimeout, IDictionary additionalProperties) + internal IndexingParametersConfiguration(BlobIndexerParsingMode? parsingMode, string excludedFileNameExtensions, string indexedFileNameExtensions, bool? failOnUnsupportedContentType, bool? failOnUnprocessableDocument, bool? indexStorageMetadataOnlyForOversizedDocuments, string delimitedTextHeaders, string delimitedTextDelimiter, bool? firstLineContainsHeaders, MarkdownParsingSubmode? markdownParsingSubmode, MarkdownHeaderDepth? markdownHeaderDepth, string documentRoot, BlobIndexerDataToExtract? dataToExtract, BlobIndexerImageAction? imageAction, bool? allowSkillsetToReadFileData, BlobIndexerPdfTextRotationAlgorithm? pdfTextRotationAlgorithm, IndexerExecutionEnvironment? executionEnvironment, string queryTimeout, IDictionary additionalProperties) { ParsingMode = parsingMode; ExcludedFileNameExtensions = excludedFileNameExtensions; @@ -47,6 +49,8 @@ internal IndexingParametersConfiguration(BlobIndexerParsingMode? parsingMode, st DelimitedTextHeaders = delimitedTextHeaders; DelimitedTextDelimiter = delimitedTextDelimiter; FirstLineContainsHeaders = firstLineContainsHeaders; + MarkdownParsingSubmode = markdownParsingSubmode; + MarkdownHeaderDepth = markdownHeaderDepth; DocumentRoot = documentRoot; DataToExtract = dataToExtract; ImageAction = imageAction; @@ -75,6 +79,10 @@ internal IndexingParametersConfiguration(BlobIndexerParsingMode? parsingMode, st public string DelimitedTextDelimiter { get; set; } /// For CSV blobs, indicates that the first (non-blank) line of each blob contains headers. public bool? FirstLineContainsHeaders { get; set; } + /// Specifies the submode that will determine whether a markdown file will be parsed into exactly one search document or multiple search documents. Default is `oneToMany`. + public MarkdownParsingSubmode? MarkdownParsingSubmode { get; set; } + /// Specifies the max header depth that will be considered while grouping markdown content. Default is `h6`. + public MarkdownHeaderDepth? MarkdownHeaderDepth { get; set; } /// For JSON arrays, given a structured or semi-structured document, you can specify a path to the array using this property. public string DocumentRoot { get; set; } /// Specifies the data to extract from Azure blob storage and tells the indexer which data to extract from image content when "imageAction" is set to a value other than "none". This applies to embedded image content in a .PDF or other application, or image files such as .jpg and .png, in Azure blobs. diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/MarkdownHeaderDepth.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/MarkdownHeaderDepth.cs new file mode 100644 index 0000000000000..eb933891ce05c --- /dev/null +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/MarkdownHeaderDepth.cs @@ -0,0 +1,63 @@ +// 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 +{ + /// Specifies the max header depth that will be considered while grouping markdown content. Default is `h6`. + public readonly partial struct MarkdownHeaderDepth : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public MarkdownHeaderDepth(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string H1Value = "h1"; + private const string H2Value = "h2"; + private const string H3Value = "h3"; + private const string H4Value = "h4"; + private const string H5Value = "h5"; + private const string H6Value = "h6"; + + /// Indicates that headers up to a level of h1 will be considered while grouping markdown content. + public static MarkdownHeaderDepth H1 { get; } = new MarkdownHeaderDepth(H1Value); + /// Indicates that headers up to a level of h2 will be considered while grouping markdown content. + public static MarkdownHeaderDepth H2 { get; } = new MarkdownHeaderDepth(H2Value); + /// Indicates that headers up to a level of h3 will be considered while grouping markdown content. + public static MarkdownHeaderDepth H3 { get; } = new MarkdownHeaderDepth(H3Value); + /// Indicates that headers up to a level of h4 will be considered while grouping markdown content. + public static MarkdownHeaderDepth H4 { get; } = new MarkdownHeaderDepth(H4Value); + /// Indicates that headers up to a level of h5 will be considered while grouping markdown content. + public static MarkdownHeaderDepth H5 { get; } = new MarkdownHeaderDepth(H5Value); + /// Indicates that headers up to a level of h6 will be considered while grouping markdown content. This is the default. + public static MarkdownHeaderDepth H6 { get; } = new MarkdownHeaderDepth(H6Value); + /// Determines if two values are the same. + public static bool operator ==(MarkdownHeaderDepth left, MarkdownHeaderDepth right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(MarkdownHeaderDepth left, MarkdownHeaderDepth right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator MarkdownHeaderDepth(string value) => new MarkdownHeaderDepth(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is MarkdownHeaderDepth other && Equals(other); + /// + public bool Equals(MarkdownHeaderDepth other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/MarkdownParsingSubmode.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/MarkdownParsingSubmode.cs new file mode 100644 index 0000000000000..f272b7fc8e97c --- /dev/null +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/MarkdownParsingSubmode.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.Indexes.Models +{ + /// Specifies the submode that will determine whether a markdown file will be parsed into exactly one search document or multiple search documents. Default is `oneToMany`. + public readonly partial struct MarkdownParsingSubmode : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public MarkdownParsingSubmode(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string OneToManyValue = "oneToMany"; + private const string OneToOneValue = "oneToOne"; + + /// Indicates that each section of the markdown file (up to a specified depth) will be parsed into individual search documents. This can result in a single markdown file producing multiple search documents. This is the default sub-mode. + public static MarkdownParsingSubmode OneToMany { get; } = new MarkdownParsingSubmode(OneToManyValue); + /// Indicates that each markdown file will be parsed into a single search document. + public static MarkdownParsingSubmode OneToOne { get; } = new MarkdownParsingSubmode(OneToOneValue); + /// Determines if two values are the same. + public static bool operator ==(MarkdownParsingSubmode left, MarkdownParsingSubmode right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(MarkdownParsingSubmode left, MarkdownParsingSubmode right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator MarkdownParsingSubmode(string value) => new MarkdownParsingSubmode(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is MarkdownParsingSubmode other && Equals(other); + /// + public bool Equals(MarkdownParsingSubmode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/QueryAnswerType.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/QueryAnswerType.cs index 0f0cd8f4faf05..814f115eedbf8 100644 --- a/sdk/search/Azure.Search.Documents/src/Generated/Models/QueryAnswerType.cs +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/QueryAnswerType.cs @@ -10,7 +10,7 @@ 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. The confidence threshold can be configured by appending the pipe character `|` followed by the `threshold-<confidence threshold>` option after the answers parameter value, such as `extractive|threshold-0.9`. Default threshold is 0.7. + /// 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. The confidence threshold can be configured by appending the pipe character `|` followed by the `threshold-<confidence threshold>` option after the answers parameter value, such as `extractive|threshold-0.9`. Default threshold is 0.7. The maximum character length of answers can be configured by appending the pipe character '|' followed by the 'count-<number of maximum character length>', such as 'extractive|maxcharlength-600'. public readonly partial struct QueryAnswerType : IEquatable { private readonly string _value; diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/QueryCaptionType.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/QueryCaptionType.cs index c663d22c8e605..f15e069885913 100644 --- a/sdk/search/Azure.Search.Documents/src/Generated/Models/QueryCaptionType.cs +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/QueryCaptionType.cs @@ -10,7 +10,7 @@ namespace Azure.Search.Documents.Models { - /// This parameter is only valid if the query type is `semantic`. If set, the query returns captions extracted from key passages in the highest ranked documents. When Captions is set to `extractive`, highlighting is enabled by default, and can be configured by appending the pipe character `|` followed by the `highlight-<true/false>` option, such as `extractive|highlight-true`. Defaults to `None`. + /// This parameter is only valid if the query type is `semantic`. If set, the query returns captions extracted from key passages in the highest ranked documents. When Captions is set to `extractive`, highlighting is enabled by default, and can be configured by appending the pipe character `|` followed by the `highlight-<true/false>` option, such as `extractive|highlight-true`. Defaults to `None`. The maximum character length of captions can be configured by appending the pipe character '|' followed by the 'count-<number of maximum character length>', such as 'extractive|maxcharlength-600'. public readonly partial struct QueryCaptionType : IEquatable { private readonly string _value; diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/QueryDebugMode.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/QueryDebugMode.cs index b16ba6570892f..28bc67685efc9 100644 --- a/sdk/search/Azure.Search.Documents/src/Generated/Models/QueryDebugMode.cs +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/QueryDebugMode.cs @@ -10,7 +10,7 @@ namespace Azure.Search.Documents.Models { - /// Enables a debugging tool that can be used to further explore your search results. + /// Enables a debugging tool that can be used to further explore your search results. You can enable multiple debug modes simultaneously by separating them with a | character, for example: semantic|queryRewrites. public readonly partial struct QueryDebugMode : IEquatable { private readonly string _value; @@ -24,11 +24,20 @@ public QueryDebugMode(string value) private const string DisabledValue = "disabled"; private const string SemanticValue = "semantic"; + private const string VectorValue = "vector"; + private const string QueryRewritesValue = "queryRewrites"; + private const string AllValue = "all"; /// No query debugging information will be returned. public static QueryDebugMode Disabled { get; } = new QueryDebugMode(DisabledValue); /// Allows the user to further explore their reranked results. public static QueryDebugMode Semantic { get; } = new QueryDebugMode(SemanticValue); + /// Allows the user to further explore their hybrid and vector query results. + public static QueryDebugMode Vector { get; } = new QueryDebugMode(VectorValue); + /// Allows the user to explore the list of query rewrites generated for their search request. + public static QueryDebugMode QueryRewrites { get; } = new QueryDebugMode(QueryRewritesValue); + /// Turn on all debug options. + public static QueryDebugMode All { get; } = new QueryDebugMode(AllValue); /// Determines if two values are the same. public static bool operator ==(QueryDebugMode left, QueryDebugMode right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/QueryRewritesDebugInfo.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/QueryRewritesDebugInfo.Serialization.cs new file mode 100644 index 0000000000000..ff03080d81322 --- /dev/null +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/QueryRewritesDebugInfo.Serialization.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; + +namespace Azure.Search.Documents.Models +{ + public partial class QueryRewritesDebugInfo + { + internal static QueryRewritesDebugInfo DeserializeQueryRewritesDebugInfo(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + QueryRewritesValuesDebugInfo text = default; + IReadOnlyList vectors = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("text"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + text = QueryRewritesValuesDebugInfo.DeserializeQueryRewritesValuesDebugInfo(property.Value); + continue; + } + if (property.NameEquals("vectors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(QueryRewritesValuesDebugInfo.DeserializeQueryRewritesValuesDebugInfo(item)); + } + vectors = array; + continue; + } + } + return new QueryRewritesDebugInfo(text, vectors ?? new ChangeTrackingList()); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static QueryRewritesDebugInfo FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeQueryRewritesDebugInfo(document.RootElement); + } + } +} diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/QueryRewritesDebugInfo.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/QueryRewritesDebugInfo.cs new file mode 100644 index 0000000000000..29f0f869191ef --- /dev/null +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/QueryRewritesDebugInfo.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; + +namespace Azure.Search.Documents.Models +{ + /// Contains debugging information specific to query rewrites. + public partial class QueryRewritesDebugInfo + { + /// Initializes a new instance of . + internal QueryRewritesDebugInfo() + { + Vectors = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// List of query rewrites generated for the text query. + /// List of query rewrites generated for the vectorizable text queries. + internal QueryRewritesDebugInfo(QueryRewritesValuesDebugInfo text, IReadOnlyList vectors) + { + Text = text; + Vectors = vectors; + } + + /// List of query rewrites generated for the text query. + public QueryRewritesValuesDebugInfo Text { get; } + /// List of query rewrites generated for the vectorizable text queries. + public IReadOnlyList Vectors { get; } + } +} diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/QueryRewritesType.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/QueryRewritesType.cs new file mode 100644 index 0000000000000..021ee136c23d3 --- /dev/null +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/QueryRewritesType.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`. When QueryRewrites is set to `generative`, the query terms are sent to a generate model which will produce 10 (default) rewrites to help increase the recall of the request. The requested count can be configured by appending the pipe character `|` followed by the `count-<number of rewrites>` option, such as `generative|count-3`. Defaults to `None`. + public readonly partial struct QueryRewritesType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public QueryRewritesType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NoneValue = "none"; + private const string GenerativeValue = "generative"; + + /// Do not generate additional query rewrites for this query. + public static QueryRewritesType None { get; } = new QueryRewritesType(NoneValue); + /// Generate alternative query terms to increase the recall of a search request. + public static QueryRewritesType Generative { get; } = new QueryRewritesType(GenerativeValue); + /// Determines if two values are the same. + public static bool operator ==(QueryRewritesType left, QueryRewritesType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(QueryRewritesType left, QueryRewritesType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator QueryRewritesType(string value) => new QueryRewritesType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is QueryRewritesType other && Equals(other); + /// + public bool Equals(QueryRewritesType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/QueryRewritesValuesDebugInfo.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/QueryRewritesValuesDebugInfo.Serialization.cs new file mode 100644 index 0000000000000..a1d641a36434a --- /dev/null +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/QueryRewritesValuesDebugInfo.Serialization.cs @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; + +namespace Azure.Search.Documents.Models +{ + public partial class QueryRewritesValuesDebugInfo + { + internal static QueryRewritesValuesDebugInfo DeserializeQueryRewritesValuesDebugInfo(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string inputQuery = default; + IReadOnlyList rewrites = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("inputQuery"u8)) + { + inputQuery = property.Value.GetString(); + continue; + } + if (property.NameEquals("rewrites"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + rewrites = array; + continue; + } + } + return new QueryRewritesValuesDebugInfo(inputQuery, rewrites ?? new ChangeTrackingList()); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static QueryRewritesValuesDebugInfo FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeQueryRewritesValuesDebugInfo(document.RootElement); + } + } +} diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/QueryRewritesValuesDebugInfo.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/QueryRewritesValuesDebugInfo.cs new file mode 100644 index 0000000000000..953d64ae67196 --- /dev/null +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/QueryRewritesValuesDebugInfo.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; + +namespace Azure.Search.Documents.Models +{ + /// Contains debugging information specific to query rewrites. + public partial class QueryRewritesValuesDebugInfo + { + /// Initializes a new instance of . + internal QueryRewritesValuesDebugInfo() + { + Rewrites = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The input text to the generative query rewriting model. There may be cases where the user query and the input to the generative model are not identical. + /// List of query rewrites. + internal QueryRewritesValuesDebugInfo(string inputQuery, IReadOnlyList rewrites) + { + InputQuery = inputQuery; + Rewrites = rewrites; + } + + /// The input text to the generative query rewriting model. There may be cases where the user query and the input to the generative model are not identical. + public string InputQuery { get; } + /// List of query rewrites. + public IReadOnlyList Rewrites { get; } + } +} diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/RescoringOptions.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/RescoringOptions.Serialization.cs new file mode 100644 index 0000000000000..4dc692a0a3278 --- /dev/null +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/RescoringOptions.Serialization.cs @@ -0,0 +1,118 @@ +// 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 RescoringOptions : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(EnableRescoring)) + { + if (EnableRescoring != null) + { + writer.WritePropertyName("enableRescoring"u8); + writer.WriteBooleanValue(EnableRescoring.Value); + } + else + { + writer.WriteNull("enableRescoring"); + } + } + if (Optional.IsDefined(DefaultOversampling)) + { + if (DefaultOversampling != null) + { + writer.WritePropertyName("defaultOversampling"u8); + writer.WriteNumberValue(DefaultOversampling.Value); + } + else + { + writer.WriteNull("defaultOversampling"); + } + } + if (Optional.IsDefined(RescoreStorageMethod)) + { + if (RescoreStorageMethod != null) + { + writer.WritePropertyName("rescoreStorageMethod"u8); + writer.WriteStringValue(RescoreStorageMethod.Value.ToString()); + } + else + { + writer.WriteNull("rescoreStorageMethod"); + } + } + writer.WriteEndObject(); + } + + internal static RescoringOptions DeserializeRescoringOptions(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool? enableRescoring = default; + double? defaultOversampling = default; + VectorSearchCompressionRescoreStorageMethod? rescoreStorageMethod = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("enableRescoring"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + enableRescoring = null; + continue; + } + enableRescoring = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("defaultOversampling"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + defaultOversampling = null; + continue; + } + defaultOversampling = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("rescoreStorageMethod"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + rescoreStorageMethod = null; + continue; + } + rescoreStorageMethod = new VectorSearchCompressionRescoreStorageMethod(property.Value.GetString()); + continue; + } + } + return new RescoringOptions(enableRescoring, defaultOversampling, rescoreStorageMethod); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static RescoringOptions FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeRescoringOptions(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/RescoringOptions.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/RescoringOptions.cs new file mode 100644 index 0000000000000..e267c291cf03b --- /dev/null +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/RescoringOptions.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Search.Documents.Indexes.Models +{ + /// Contains the options for rescoring. + public partial class RescoringOptions + { + /// Initializes a new instance of . + public RescoringOptions() + { + } + + /// Initializes a new instance of . + /// If set to true, after the initial search on the compressed vectors, the similarity scores are recalculated using the full-precision vectors. This will improve recall at the expense of latency. + /// Default oversampling factor. Oversampling retrieves a greater set of potential documents to offset the resolution loss due to quantization. This increases the set of results that will be rescored on full-precision vectors. Minimum value is 1, meaning no oversampling (1x). This parameter can only be set when 'enableRescoring' is true. Higher values improve recall at the expense of latency. + /// Controls the storage method for original vectors. This setting is immutable. + internal RescoringOptions(bool? enableRescoring, double? defaultOversampling, VectorSearchCompressionRescoreStorageMethod? rescoreStorageMethod) + { + EnableRescoring = enableRescoring; + DefaultOversampling = defaultOversampling; + RescoreStorageMethod = rescoreStorageMethod; + } + + /// If set to true, after the initial search on the compressed vectors, the similarity scores are recalculated using the full-precision vectors. This will improve recall at the expense of latency. + public bool? EnableRescoring { get; set; } + /// Default oversampling factor. Oversampling retrieves a greater set of potential documents to offset the resolution loss due to quantization. This increases the set of results that will be rescored on full-precision vectors. Minimum value is 1, meaning no oversampling (1x). This parameter can only be set when 'enableRescoring' is true. Higher values improve recall at the expense of latency. + public double? DefaultOversampling { get; set; } + /// Controls the storage method for original vectors. This setting is immutable. + public VectorSearchCompressionRescoreStorageMethod? RescoreStorageMethod { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/ScalarQuantizationCompression.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/ScalarQuantizationCompression.Serialization.cs index 4aa40f5a50071..2b9bbefaa19b0 100644 --- a/sdk/search/Azure.Search.Documents/src/Generated/Models/ScalarQuantizationCompression.Serialization.cs +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/ScalarQuantizationCompression.Serialization.cs @@ -41,6 +41,18 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WriteNull("defaultOversampling"); } } + if (Optional.IsDefined(RescoringOptions)) + { + if (RescoringOptions != null) + { + writer.WritePropertyName("rescoringOptions"u8); + writer.WriteObjectValue(RescoringOptions); + } + else + { + writer.WriteNull("rescoringOptions"); + } + } if (Optional.IsDefined(TruncationDimension)) { if (TruncationDimension != null) @@ -67,6 +79,7 @@ internal static ScalarQuantizationCompression DeserializeScalarQuantizationCompr VectorSearchCompressionKind kind = default; bool? rerankWithOriginalVectors = default; double? defaultOversampling = default; + RescoringOptions rescoringOptions = default; int? truncationDimension = default; foreach (var property in element.EnumerateObject()) { @@ -108,6 +121,16 @@ internal static ScalarQuantizationCompression DeserializeScalarQuantizationCompr defaultOversampling = property.Value.GetDouble(); continue; } + if (property.NameEquals("rescoringOptions"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + rescoringOptions = null; + continue; + } + rescoringOptions = RescoringOptions.DeserializeRescoringOptions(property.Value); + continue; + } if (property.NameEquals("truncationDimension"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -124,6 +147,7 @@ internal static ScalarQuantizationCompression DeserializeScalarQuantizationCompr kind, rerankWithOriginalVectors, defaultOversampling, + rescoringOptions, truncationDimension, scalarQuantizationParameters); } diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/ScalarQuantizationCompression.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/ScalarQuantizationCompression.cs index 1b12f256d8d08..fa10f9817a63f 100644 --- a/sdk/search/Azure.Search.Documents/src/Generated/Models/ScalarQuantizationCompression.cs +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/ScalarQuantizationCompression.cs @@ -27,9 +27,10 @@ public ScalarQuantizationCompression(string compressionName) : base(compressionN /// The name of the kind of compression method being configured for use with vector search. /// If set to true, once the ordered set of results calculated using compressed vectors are obtained, they will be reranked again by recalculating the full-precision similarity scores. This will improve recall at the expense of latency. /// Default oversampling factor. Oversampling will internally request more documents (specified by this multiplier) in the initial search. This increases the set of results that will be reranked using recomputed similarity scores from full-precision vectors. Minimum value is 1, meaning no oversampling (1x). This parameter can only be set when rerankWithOriginalVectors is true. Higher values improve recall at the expense of latency. + /// Contains the options for rescoring. /// The number of dimensions to truncate the vectors to. Truncating the vectors reduces the size of the vectors and the amount of data that needs to be transferred during search. This can save storage cost and improve search performance at the expense of recall. It should be only used for embeddings trained with Matryoshka Representation Learning (MRL) such as OpenAI text-embedding-3-large (small). The default value is null, which means no truncation. /// Contains the parameters specific to Scalar Quantization. - internal ScalarQuantizationCompression(string compressionName, VectorSearchCompressionKind kind, bool? rerankWithOriginalVectors, double? defaultOversampling, int? truncationDimension, ScalarQuantizationParameters parameters) : base(compressionName, kind, rerankWithOriginalVectors, defaultOversampling, truncationDimension) + internal ScalarQuantizationCompression(string compressionName, VectorSearchCompressionKind kind, bool? rerankWithOriginalVectors, double? defaultOversampling, RescoringOptions rescoringOptions, int? truncationDimension, ScalarQuantizationParameters parameters) : base(compressionName, kind, rerankWithOriginalVectors, defaultOversampling, rescoringOptions, truncationDimension) { Parameters = parameters; Kind = kind; 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 7c024b5354900..e2ab7861359d1 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 @@ -27,6 +27,8 @@ internal static SearchDocumentsResult DeserializeSearchDocumentsResult(JsonEleme string odataNextLink = default; SemanticErrorReason? searchSemanticPartialResponseReason = default; SemanticSearchResultsType? searchSemanticPartialResponseType = default; + SemanticQueryRewritesResultType? searchSemanticQueryRewritesResultType = default; + DebugInfo searchDebug = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("@odata.count"u8)) @@ -130,6 +132,25 @@ internal static SearchDocumentsResult DeserializeSearchDocumentsResult(JsonEleme searchSemanticPartialResponseType = new SemanticSearchResultsType(property.Value.GetString()); continue; } + if (property.NameEquals("@search.semanticQueryRewritesResultType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + searchSemanticQueryRewritesResultType = new SemanticQueryRewritesResultType(property.Value.GetString()); + continue; + } + if (property.NameEquals("@search.debug"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + searchDebug = null; + continue; + } + searchDebug = DebugInfo.DeserializeDebugInfo(property.Value); + continue; + } } return new SearchDocumentsResult( odataCount, @@ -140,7 +161,9 @@ internal static SearchDocumentsResult DeserializeSearchDocumentsResult(JsonEleme value, odataNextLink, searchSemanticPartialResponseReason, - searchSemanticPartialResponseType); + searchSemanticPartialResponseType, + searchSemanticQueryRewritesResultType, + searchDebug); } /// Deserializes the model from a raw response. 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 dd01afb9b5564..972d1a451da59 100644 --- a/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchDocumentsResult.cs +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchDocumentsResult.cs @@ -32,7 +32,9 @@ internal SearchDocumentsResult(IEnumerable results) /// Continuation URL returned when the query can't return all the requested results in a single 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. /// Reason that a partial response was returned for a semantic ranking request. /// Type of partial response that was returned for a semantic ranking request. - internal SearchDocumentsResult(long? count, double? coverage, IReadOnlyDictionary> facets, IReadOnlyList answers, SearchOptions nextPageParameters, IReadOnlyList results, string nextLink, SemanticErrorReason? semanticPartialResponseReason, SemanticSearchResultsType? semanticPartialResponseType) + /// Type of query rewrite that was used to retrieve documents. + /// Debug information that applies to the search results as a whole. + internal SearchDocumentsResult(long? count, double? coverage, IReadOnlyDictionary> facets, IReadOnlyList answers, SearchOptions nextPageParameters, IReadOnlyList results, string nextLink, SemanticErrorReason? semanticPartialResponseReason, SemanticSearchResultsType? semanticPartialResponseType, SemanticQueryRewritesResultType? semanticQueryRewritesResultType, DebugInfo debugInfo) { Count = count; Coverage = coverage; @@ -43,6 +45,8 @@ internal SearchDocumentsResult(long? count, double? coverage, IReadOnlyDictionar NextLink = nextLink; SemanticPartialResponseReason = semanticPartialResponseReason; SemanticPartialResponseType = semanticPartialResponseType; + SemanticQueryRewritesResultType = semanticQueryRewritesResultType; + DebugInfo = debugInfo; } /// 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 the query can't return all the requested documents in a single response. @@ -63,5 +67,9 @@ internal SearchDocumentsResult(long? count, double? coverage, IReadOnlyDictionar public SemanticErrorReason? SemanticPartialResponseReason { get; } /// Type of partial response that was returned for a semantic ranking request. public SemanticSearchResultsType? SemanticPartialResponseType { get; } + /// Type of query rewrite that was used to retrieve documents. + public SemanticQueryRewritesResultType? SemanticQueryRewritesResultType { get; } + /// Debug information that applies to the search results as a whole. + public DebugInfo DebugInfo { get; } } } 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 ab55a8bad84a8..d755e1859971a 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 @@ -77,6 +77,7 @@ internal static SearchIndexerSkill DeserializeSearchIndexerSkill(JsonElement ele case "#Microsoft.Skills.Text.V3.SentimentSkill": return SentimentSkillV3.DeserializeSentimentSkillV3(element); case "#Microsoft.Skills.Util.ConditionalSkill": return ConditionalSkill.DeserializeConditionalSkill(element); case "#Microsoft.Skills.Util.DocumentExtractionSkill": return DocumentExtractionSkill.DeserializeDocumentExtractionSkill(element); + case "#Microsoft.Skills.Util.DocumentIntelligenceLayoutSkill": return DocumentIntelligenceLayoutSkill.DeserializeDocumentIntelligenceLayoutSkill(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/SearchIndexerSkill.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchIndexerSkill.cs index 654052bfd6d70..bf57982dd95dd 100644 --- a/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchIndexerSkill.cs +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchIndexerSkill.cs @@ -14,7 +14,7 @@ namespace Azure.Search.Documents.Indexes.Models /// /// Base type for skills. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , , , , , , , , , , , , , and . + /// The available derived classes include , , , , , , , , , , , , , , , , , , and . /// public partial class SearchIndexerSkill { diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchIndexerSkillset.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchIndexerSkillset.cs index fdcb717b4b167..764d79fd01c77 100644 --- a/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchIndexerSkillset.cs +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchIndexerSkillset.cs @@ -19,7 +19,7 @@ public partial class SearchIndexerSkillset /// /// A list of skills in the skillset. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , , , , , , , , , , , , , and . + /// The available derived classes include , , , , , , , , , , , , , , , , , , and . /// /// or is null. public SearchIndexerSkillset(string name, IEnumerable skills) @@ -37,12 +37,12 @@ public SearchIndexerSkillset(string name, IEnumerable skills /// /// A list of skills in the skillset. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , , , , , , , , , , , , , and . + /// The available derived classes include , , , , , , , , , , , , , , , , , , and . /// /// /// Details about the Azure AI service to be used when running skills. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include and . + /// The available derived classes include , , and . /// /// Definition of additional projections to Azure blob, table, or files, of enriched data. /// Definition of additional projections to secondary search index(es). @@ -67,7 +67,7 @@ internal SearchIndexerSkillset(string name, string description, IList /// Details about the Azure AI service to be used when running skills. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include and . + /// The available derived classes include , , and . /// public CognitiveServicesAccount CognitiveServicesAccount { get; set; } /// Definition of additional projections to Azure blob, table, or files, of enriched data. 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 0cbedf7f74d13..54edeede10e54 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 @@ -174,6 +174,11 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("captions"u8); writer.WriteStringValue(QueryCaptionRaw); } + if (Optional.IsDefined(QueryRewritesRaw)) + { + writer.WritePropertyName("queryRewrites"u8); + writer.WriteStringValue(QueryRewritesRaw); + } if (Optional.IsDefined(SemanticFieldsRaw)) { writer.WritePropertyName("semanticFields"u8); @@ -236,6 +241,7 @@ internal static SearchOptions DeserializeSearchOptions(JsonElement element) string semanticQuery = default; string answers = default; string captions = default; + string queryRewrites = default; string semanticFields = default; IList vectorQueries = default; VectorFilterMode? vectorFilterMode = default; @@ -449,6 +455,11 @@ internal static SearchOptions DeserializeSearchOptions(JsonElement element) captions = property.Value.GetString(); continue; } + if (property.NameEquals("queryRewrites"u8)) + { + queryRewrites = property.Value.GetString(); + continue; + } if (property.NameEquals("semanticFields"u8)) { semanticFields = property.Value.GetString(); @@ -516,6 +527,7 @@ internal static SearchOptions DeserializeSearchOptions(JsonElement element) semanticQuery, answers, captions, + queryRewrites, semanticFields, vectorQueries ?? new ChangeTrackingList(), vectorFilterMode, 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 3294808d5c879..658a7d2f4873b 100644 --- a/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchOptions.cs +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchOptions.cs @@ -20,79 +20,6 @@ public SearchOptions() ScoringParameters = new ChangeTrackingList(); VectorQueries = new ChangeTrackingList(); } - - /// Initializes a new instance of . - /// A value that specifies whether to fetch the total count of results. Default is false. Setting this value to true may have a performance impact. Note that the count returned is an approximation. - /// The list of facet expressions to apply to the search query. Each facet expression contains a field name, optionally followed by a comma-separated list of name:value pairs. - /// The OData $filter expression to apply to the search query. - /// The comma-separated list of field names to use for hit highlights. Only searchable fields can be used for hit highlighting. - /// A string tag that is appended to hit highlights. Must be set with highlightPreTag. Default is </em>. - /// A string tag that is prepended to hit highlights. Must be set with highlightPostTag. Default is <em>. - /// A number between 0 and 100 indicating the percentage of the index that must be covered by a search query in order for the query to be reported as a success. This parameter can be useful for ensuring search availability even for services with only one replica. The default is 100. - /// The comma-separated list of OData $orderby expressions by which to sort the results. Each expression can be either a field name or a call to either the geo.distance() or the search.score() functions. Each expression can be followed by asc to indicate ascending, or desc to indicate descending. The default is ascending order. Ties will be broken by the match scores of documents. If no $orderby is specified, the default sort order is descending by document match score. There can be at most 32 $orderby clauses. - /// A value that specifies the syntax of the search query. The default is 'simple'. Use 'full' if your query uses the Lucene query syntax. - /// A value that specifies whether we want to calculate scoring statistics (such as document frequency) globally for more consistent scoring, or locally, for lower latency. The default is 'local'. Use 'global' to aggregate scoring statistics globally before scoring. Using global scoring statistics can increase latency of search queries. - /// A value to be used to create a sticky session, which can help getting more consistent results. As long as the same sessionId is used, a best-effort attempt will be made to target the same replica set. Be wary that reusing the same sessionID values repeatedly can interfere with the load balancing of the requests across replicas and adversely affect the performance of the search service. The value used as sessionId cannot start with a '_' character. - /// The list of parameter values to be used in scoring functions (for example, referencePointParameter) using the format name-values. For example, if the scoring profile defines a function with a parameter called 'mylocation' the parameter string would be "mylocation--122.2,44.8" (without the quotes). - /// The name of a scoring profile to evaluate match scores for matching documents in order to sort the results. - /// Enables a debugging tool that can be used to further explore your reranked results. - /// 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. - /// 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. - /// The name of a semantic configuration that will be used when processing documents for queries of type semantic. - /// Allows the user to choose whether a semantic call should fail completely (default / current behavior), or to return partial results. - /// Allows the user to set an upper bound on the amount of time it takes for semantic enrichment to finish processing before the request fails. - /// Allows setting a separate search query that will be solely used for semantic reranking, semantic captions and semantic answers. Is useful for scenarios where there is a need to use different queries between the base retrieval and ranking phase, and the L2 semantic phase. - /// A value that specifies whether answers should be returned as part of the search response. - /// A value that specifies whether captions should be returned as part of the search response. - /// The comma-separated list of field names used for semantic ranking. - /// - /// The query parameters for vector and hybrid search queries. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , and . - /// - /// Determines whether or not filters are applied before or after the vector search is performed. Default is 'preFilter' for new indexes. - /// The query parameters to configure hybrid search behaviors. - 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, QueryDebugMode? debug, string searchText, string searchFieldsRaw, SearchMode? searchMode, QueryLanguage? queryLanguage, QuerySpellerType? querySpeller, string selectRaw, int? skip, int? size, string semanticConfigurationName, SemanticErrorMode? semanticErrorMode, int? semanticMaxWaitInMilliseconds, string semanticQuery, string queryAnswerRaw, string queryCaptionRaw, string semanticFieldsRaw, IList vectorQueries, VectorFilterMode? filterMode, HybridSearch hybridSearch) - { - IncludeTotalCount = includeTotalCount; - Facets = facets; - Filter = filter; - HighlightFieldsRaw = highlightFieldsRaw; - HighlightPostTag = highlightPostTag; - HighlightPreTag = highlightPreTag; - MinimumCoverage = minimumCoverage; - OrderByRaw = orderByRaw; - QueryType = queryType; - ScoringStatistics = scoringStatistics; - SessionId = sessionId; - ScoringParameters = scoringParameters; - ScoringProfile = scoringProfile; - Debug = debug; - SearchText = searchText; - SearchFieldsRaw = searchFieldsRaw; - SearchMode = searchMode; - QueryLanguage = queryLanguage; - QuerySpeller = querySpeller; - SelectRaw = selectRaw; - Skip = skip; - Size = size; - SemanticConfigurationName = semanticConfigurationName; - SemanticErrorMode = semanticErrorMode; - SemanticMaxWaitInMilliseconds = semanticMaxWaitInMilliseconds; - SemanticQuery = semanticQuery; - QueryAnswerRaw = queryAnswerRaw; - QueryCaptionRaw = queryCaptionRaw; - SemanticFieldsRaw = semanticFieldsRaw; - VectorQueries = vectorQueries; - FilterMode = filterMode; - HybridSearch = hybridSearch; - } /// A string tag that is appended to hit highlights. Must be set with highlightPreTag. Default is </em>. public string HighlightPostTag { get; set; } /// A string tag that is prepended to hit highlights. Must be set with highlightPostTag. Default is <em>. 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 c9b3b6dd852a6..c2aaf12b98ba3 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 @@ -22,7 +22,7 @@ internal static SearchResult DeserializeSearchResult(JsonElement element) double? searchRerankerScore = default; IReadOnlyDictionary> searchHighlights = default; IReadOnlyList searchCaptions = default; - IReadOnlyList searchDocumentDebugInfo = default; + DocumentDebugInfo searchDocumentDebugInfo = default; IReadOnlyDictionary additionalProperties = default; Dictionary additionalPropertiesDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -90,12 +90,7 @@ internal static SearchResult DeserializeSearchResult(JsonElement element) searchDocumentDebugInfo = null; continue; } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(Models.DocumentDebugInfo.DeserializeDocumentDebugInfo(item)); - } - searchDocumentDebugInfo = array; + searchDocumentDebugInfo = DocumentDebugInfo.DeserializeDocumentDebugInfo(property.Value); continue; } additionalPropertiesDictionary.Add(property.Name, property.Value.GetObject()); @@ -106,7 +101,7 @@ internal static SearchResult DeserializeSearchResult(JsonElement element) searchRerankerScore, searchHighlights ?? new ChangeTrackingDictionary>(), searchCaptions ?? new ChangeTrackingList(), - searchDocumentDebugInfo ?? new ChangeTrackingList(), + searchDocumentDebugInfo, 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 57fab92fcd80c..dc3fd651496eb 100644 --- a/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchResult.cs +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchResult.cs @@ -19,7 +19,6 @@ internal SearchResult(double score) Score = score; Highlights = new ChangeTrackingDictionary>(); Captions = new ChangeTrackingList(); - DocumentDebugInfo = new ChangeTrackingList(); AdditionalProperties = new ChangeTrackingDictionary(); } @@ -30,7 +29,7 @@ internal SearchResult(double score) /// 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'. /// Contains debugging information that can be used to further explore your search results. /// Additional Properties. - internal SearchResult(double score, double? rerankerScore, IReadOnlyDictionary> highlights, IReadOnlyList captions, IReadOnlyList documentDebugInfo, IReadOnlyDictionary additionalProperties) + internal SearchResult(double score, double? rerankerScore, IReadOnlyDictionary> highlights, IReadOnlyList captions, DocumentDebugInfo documentDebugInfo, IReadOnlyDictionary additionalProperties) { Score = score; RerankerScore = rerankerScore; @@ -49,7 +48,7 @@ internal SearchResult(double score, double? rerankerScore, IReadOnlyDictionary 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 IReadOnlyList Captions { get; } /// Contains debugging information that can be used to further explore your search results. - public IReadOnlyList DocumentDebugInfo { get; } + public DocumentDebugInfo DocumentDebugInfo { get; } /// Additional Properties. public IReadOnlyDictionary AdditionalProperties { get; } } diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/SemanticQueryRewritesResultType.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/SemanticQueryRewritesResultType.cs new file mode 100644 index 0000000000000..c62707a49a1ea --- /dev/null +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/SemanticQueryRewritesResultType.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Search.Documents.Models +{ + /// Type of query rewrite that was used for this request. + public readonly partial struct SemanticQueryRewritesResultType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public SemanticQueryRewritesResultType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string OriginalQueryOnlyValue = "originalQueryOnly"; + + /// Query rewrites were not successfully generated for this request. Only the original query was used to retrieve the results. + public static SemanticQueryRewritesResultType OriginalQueryOnly { get; } = new SemanticQueryRewritesResultType(OriginalQueryOnlyValue); + /// Determines if two values are the same. + public static bool operator ==(SemanticQueryRewritesResultType left, SemanticQueryRewritesResultType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(SemanticQueryRewritesResultType left, SemanticQueryRewritesResultType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator SemanticQueryRewritesResultType(string value) => new SemanticQueryRewritesResultType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is SemanticQueryRewritesResultType other && Equals(other); + /// + public bool Equals(SemanticQueryRewritesResultType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/UnknownVectorSearchCompression.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/UnknownVectorSearchCompression.Serialization.cs index 30bd51bddf5a2..0e7edefbd8f34 100644 --- a/sdk/search/Azure.Search.Documents/src/Generated/Models/UnknownVectorSearchCompression.Serialization.cs +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/UnknownVectorSearchCompression.Serialization.cs @@ -37,6 +37,18 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WriteNull("defaultOversampling"); } } + if (Optional.IsDefined(RescoringOptions)) + { + if (RescoringOptions != null) + { + writer.WritePropertyName("rescoringOptions"u8); + writer.WriteObjectValue(RescoringOptions); + } + else + { + writer.WriteNull("rescoringOptions"); + } + } if (Optional.IsDefined(TruncationDimension)) { if (TruncationDimension != null) @@ -62,6 +74,7 @@ internal static UnknownVectorSearchCompression DeserializeUnknownVectorSearchCom VectorSearchCompressionKind kind = "Unknown"; bool? rerankWithOriginalVectors = default; double? defaultOversampling = default; + RescoringOptions rescoringOptions = default; int? truncationDimension = default; foreach (var property in element.EnumerateObject()) { @@ -94,6 +107,16 @@ internal static UnknownVectorSearchCompression DeserializeUnknownVectorSearchCom defaultOversampling = property.Value.GetDouble(); continue; } + if (property.NameEquals("rescoringOptions"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + rescoringOptions = null; + continue; + } + rescoringOptions = RescoringOptions.DeserializeRescoringOptions(property.Value); + continue; + } if (property.NameEquals("truncationDimension"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -105,7 +128,13 @@ internal static UnknownVectorSearchCompression DeserializeUnknownVectorSearchCom continue; } } - return new UnknownVectorSearchCompression(name, kind, rerankWithOriginalVectors, defaultOversampling, truncationDimension); + return new UnknownVectorSearchCompression( + name, + kind, + rerankWithOriginalVectors, + defaultOversampling, + rescoringOptions, + truncationDimension); } /// Deserializes the model from a raw response. diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/UnknownVectorSearchCompression.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/UnknownVectorSearchCompression.cs index 93e86095b5e3c..612fd27720b5c 100644 --- a/sdk/search/Azure.Search.Documents/src/Generated/Models/UnknownVectorSearchCompression.cs +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/UnknownVectorSearchCompression.cs @@ -17,8 +17,9 @@ internal partial class UnknownVectorSearchCompression : VectorSearchCompression /// The name of the kind of compression method being configured for use with vector search. /// If set to true, once the ordered set of results calculated using compressed vectors are obtained, they will be reranked again by recalculating the full-precision similarity scores. This will improve recall at the expense of latency. /// Default oversampling factor. Oversampling will internally request more documents (specified by this multiplier) in the initial search. This increases the set of results that will be reranked using recomputed similarity scores from full-precision vectors. Minimum value is 1, meaning no oversampling (1x). This parameter can only be set when rerankWithOriginalVectors is true. Higher values improve recall at the expense of latency. + /// Contains the options for rescoring. /// The number of dimensions to truncate the vectors to. Truncating the vectors reduces the size of the vectors and the amount of data that needs to be transferred during search. This can save storage cost and improve search performance at the expense of recall. It should be only used for embeddings trained with Matryoshka Representation Learning (MRL) such as OpenAI text-embedding-3-large (small). The default value is null, which means no truncation. - internal UnknownVectorSearchCompression(string compressionName, VectorSearchCompressionKind kind, bool? rerankWithOriginalVectors, double? defaultOversampling, int? truncationDimension) : base(compressionName, kind, rerankWithOriginalVectors, defaultOversampling, truncationDimension) + internal UnknownVectorSearchCompression(string compressionName, VectorSearchCompressionKind kind, bool? rerankWithOriginalVectors, double? defaultOversampling, RescoringOptions rescoringOptions, int? truncationDimension) : base(compressionName, kind, rerankWithOriginalVectors, defaultOversampling, rescoringOptions, truncationDimension) { Kind = kind; } diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/VectorSearchCompression.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/VectorSearchCompression.Serialization.cs index 1a51ff1767ad7..690f77d5b99d6 100644 --- a/sdk/search/Azure.Search.Documents/src/Generated/Models/VectorSearchCompression.Serialization.cs +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/VectorSearchCompression.Serialization.cs @@ -37,6 +37,18 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WriteNull("defaultOversampling"); } } + if (Optional.IsDefined(RescoringOptions)) + { + if (RescoringOptions != null) + { + writer.WritePropertyName("rescoringOptions"u8); + writer.WriteObjectValue(RescoringOptions); + } + else + { + writer.WriteNull("rescoringOptions"); + } + } if (Optional.IsDefined(TruncationDimension)) { if (TruncationDimension != null) diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/VectorSearchCompression.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/VectorSearchCompression.cs index b5d297016c01c..d0b140a9f607f 100644 --- a/sdk/search/Azure.Search.Documents/src/Generated/Models/VectorSearchCompression.cs +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/VectorSearchCompression.cs @@ -31,13 +31,15 @@ protected VectorSearchCompression(string compressionName) /// The name of the kind of compression method being configured for use with vector search. /// If set to true, once the ordered set of results calculated using compressed vectors are obtained, they will be reranked again by recalculating the full-precision similarity scores. This will improve recall at the expense of latency. /// Default oversampling factor. Oversampling will internally request more documents (specified by this multiplier) in the initial search. This increases the set of results that will be reranked using recomputed similarity scores from full-precision vectors. Minimum value is 1, meaning no oversampling (1x). This parameter can only be set when rerankWithOriginalVectors is true. Higher values improve recall at the expense of latency. + /// Contains the options for rescoring. /// The number of dimensions to truncate the vectors to. Truncating the vectors reduces the size of the vectors and the amount of data that needs to be transferred during search. This can save storage cost and improve search performance at the expense of recall. It should be only used for embeddings trained with Matryoshka Representation Learning (MRL) such as OpenAI text-embedding-3-large (small). The default value is null, which means no truncation. - internal VectorSearchCompression(string compressionName, VectorSearchCompressionKind kind, bool? rerankWithOriginalVectors, double? defaultOversampling, int? truncationDimension) + internal VectorSearchCompression(string compressionName, VectorSearchCompressionKind kind, bool? rerankWithOriginalVectors, double? defaultOversampling, RescoringOptions rescoringOptions, int? truncationDimension) { CompressionName = compressionName; Kind = kind; RerankWithOriginalVectors = rerankWithOriginalVectors; DefaultOversampling = defaultOversampling; + RescoringOptions = rescoringOptions; TruncationDimension = truncationDimension; } /// The name of the kind of compression method being configured for use with vector search. @@ -46,6 +48,8 @@ internal VectorSearchCompression(string compressionName, VectorSearchCompression public bool? RerankWithOriginalVectors { get; set; } /// Default oversampling factor. Oversampling will internally request more documents (specified by this multiplier) in the initial search. This increases the set of results that will be reranked using recomputed similarity scores from full-precision vectors. Minimum value is 1, meaning no oversampling (1x). This parameter can only be set when rerankWithOriginalVectors is true. Higher values improve recall at the expense of latency. public double? DefaultOversampling { get; set; } + /// Contains the options for rescoring. + public RescoringOptions RescoringOptions { get; set; } /// The number of dimensions to truncate the vectors to. Truncating the vectors reduces the size of the vectors and the amount of data that needs to be transferred during search. This can save storage cost and improve search performance at the expense of recall. It should be only used for embeddings trained with Matryoshka Representation Learning (MRL) such as OpenAI text-embedding-3-large (small). The default value is null, which means no truncation. public int? TruncationDimension { get; set; } } diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/VectorSearchCompressionRescoreStorageMethod.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/VectorSearchCompressionRescoreStorageMethod.cs new file mode 100644 index 0000000000000..6a745f14d47c6 --- /dev/null +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/VectorSearchCompressionRescoreStorageMethod.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.Indexes.Models +{ + /// The storage method for the original full-precision vectors used for rescoring and internal index operations. + public readonly partial struct VectorSearchCompressionRescoreStorageMethod : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public VectorSearchCompressionRescoreStorageMethod(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string PreserveOriginalsValue = "preserveOriginals"; + private const string DiscardOriginalsValue = "discardOriginals"; + + /// This option preserves the original full-precision vectors. Choose this option for maximum flexibility and highest quality of compressed search results. This consumes more storage but allows for rescoring and oversampling. + public static VectorSearchCompressionRescoreStorageMethod PreserveOriginals { get; } = new VectorSearchCompressionRescoreStorageMethod(PreserveOriginalsValue); + /// This option discards the original full-precision vectors. Choose this option for maximum storage savings. Since this option does not allow for rescoring and oversampling, it will often cause slight to moderate reductions in quality. + public static VectorSearchCompressionRescoreStorageMethod DiscardOriginals { get; } = new VectorSearchCompressionRescoreStorageMethod(DiscardOriginalsValue); + /// Determines if two values are the same. + public static bool operator ==(VectorSearchCompressionRescoreStorageMethod left, VectorSearchCompressionRescoreStorageMethod right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(VectorSearchCompressionRescoreStorageMethod left, VectorSearchCompressionRescoreStorageMethod right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator VectorSearchCompressionRescoreStorageMethod(string value) => new VectorSearchCompressionRescoreStorageMethod(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is VectorSearchCompressionRescoreStorageMethod other && Equals(other); + /// + public bool Equals(VectorSearchCompressionRescoreStorageMethod other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/VectorizableTextQuery.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/VectorizableTextQuery.Serialization.cs index af85c828e77a7..7bce595957c2a 100644 --- a/sdk/search/Azure.Search.Documents/src/Generated/Models/VectorizableTextQuery.Serialization.cs +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/VectorizableTextQuery.Serialization.cs @@ -17,6 +17,11 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WriteStartObject(); writer.WritePropertyName("text"u8); writer.WriteStringValue(Text); + if (Optional.IsDefined(QueryRewrites)) + { + writer.WritePropertyName("queryRewrites"u8); + writer.WriteStringValue(QueryRewrites.Value.ToString()); + } writer.WritePropertyName("kind"u8); writer.WriteStringValue(Kind.ToString()); if (Optional.IsDefined(KNearestNeighborsCount)) @@ -64,6 +69,7 @@ internal static VectorizableTextQuery DeserializeVectorizableTextQuery(JsonEleme return null; } string text = default; + QueryRewritesType? queryRewrites = default; VectorQueryKind kind = default; int? k = default; string fields = default; @@ -79,6 +85,15 @@ internal static VectorizableTextQuery DeserializeVectorizableTextQuery(JsonEleme text = property.Value.GetString(); continue; } + if (property.NameEquals("queryRewrites"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + queryRewrites = new QueryRewritesType(property.Value.GetString()); + continue; + } if (property.NameEquals("kind"u8)) { kind = new VectorQueryKind(property.Value.GetString()); @@ -149,7 +164,8 @@ internal static VectorizableTextQuery DeserializeVectorizableTextQuery(JsonEleme weight, threshold, filterOverride, - text); + text, + queryRewrites); } /// Deserializes the model from a raw response. diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/VectorizableTextQuery.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/VectorizableTextQuery.cs index ebd0d209a0cfa..c72e86c1ceb35 100644 --- a/sdk/search/Azure.Search.Documents/src/Generated/Models/VectorizableTextQuery.cs +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/VectorizableTextQuery.cs @@ -37,10 +37,14 @@ public VectorizableTextQuery(string text) /// /// The OData filter expression to apply to this specific vector query. If no filter expression is defined at the vector level, the expression defined in the top level filter parameter is used instead. /// The text to be vectorized to perform a vector search query. - internal VectorizableTextQuery(VectorQueryKind kind, int? kNearestNeighborsCount, string fieldsRaw, bool? exhaustive, double? oversampling, float? weight, VectorThreshold threshold, string filterOverride, string text) : base(kind, kNearestNeighborsCount, fieldsRaw, exhaustive, oversampling, weight, threshold, filterOverride) + /// Can be configured to let a generative model rewrite the query before sending it to be vectorized. + internal VectorizableTextQuery(VectorQueryKind kind, int? kNearestNeighborsCount, string fieldsRaw, bool? exhaustive, double? oversampling, float? weight, VectorThreshold threshold, string filterOverride, string text, QueryRewritesType? queryRewrites) : base(kind, kNearestNeighborsCount, fieldsRaw, exhaustive, oversampling, weight, threshold, filterOverride) { Text = text; + QueryRewrites = queryRewrites; Kind = kind; } + /// Can be configured to let a generative model rewrite the query before sending it to be vectorized. + public QueryRewritesType? QueryRewrites { get; set; } } } diff --git a/sdk/search/Azure.Search.Documents/src/Generated/SearchModelFactory.cs b/sdk/search/Azure.Search.Documents/src/Generated/SearchModelFactory.cs index 89d13de575875..6b392475902e5 100644 --- a/sdk/search/Azure.Search.Documents/src/Generated/SearchModelFactory.cs +++ b/sdk/search/Azure.Search.Documents/src/Generated/SearchModelFactory.cs @@ -15,6 +15,19 @@ namespace Azure.Search.Documents.Models /// Model factory for models. public static partial class SearchModelFactory { + /// Initializes a new instance of . + /// The approximate count of documents falling within the bucket described by this facet. + /// The nested facet query results for the search operation, organized as a collection of buckets for each faceted field; null if the query did not contain any nested facets. + /// Additional Properties. + /// A new instance for mocking. + public static FacetResult FacetResult(long? count = null, IReadOnlyDictionary> facets = null, IReadOnlyDictionary additionalProperties = null) + { + facets ??= new Dictionary>(); + additionalProperties ??= new Dictionary(); + + return new FacetResult(count, facets, additionalProperties); + } + /// Initializes a new instance of . /// The score value represents how relevant the answer is to the query relative to other answers returned for the query. /// The key of the document the answer was extracted from. @@ -120,6 +133,36 @@ public static SingleVectorFieldResult SingleVectorFieldResult(double? searchScor return new SingleVectorFieldResult(searchScore, vectorSimilarity); } + /// Initializes a new instance of . + /// Contains debugging information specific to query rewrites. + /// A new instance for mocking. + public static DebugInfo DebugInfo(QueryRewritesDebugInfo queryRewrites = null) + { + return new DebugInfo(queryRewrites); + } + + /// Initializes a new instance of . + /// List of query rewrites generated for the text query. + /// List of query rewrites generated for the vectorizable text queries. + /// A new instance for mocking. + public static QueryRewritesDebugInfo QueryRewritesDebugInfo(QueryRewritesValuesDebugInfo text = null, IEnumerable vectors = null) + { + vectors ??= new List(); + + return new QueryRewritesDebugInfo(text, vectors?.ToList()); + } + + /// Initializes a new instance of . + /// The input text to the generative query rewriting model. There may be cases where the user query and the input to the generative model are not identical. + /// List of query rewrites. + /// A new instance for mocking. + public static QueryRewritesValuesDebugInfo QueryRewritesValuesDebugInfo(string inputQuery = null, IEnumerable rewrites = null) + { + rewrites ??= new List(); + + return new QueryRewritesValuesDebugInfo(inputQuery, rewrites?.ToList()); + } + /// Initializes a new instance of . /// A value indicating the percentage of the index that was considered by the autocomplete request, or null if minimumCoverage was not specified in the request. /// The list of returned Autocompleted items. diff --git a/sdk/search/Azure.Search.Documents/src/Generated/SearchServiceRestClient.cs b/sdk/search/Azure.Search.Documents/src/Generated/SearchServiceRestClient.cs index d7739d04f62b1..73a203e6242d9 100644 --- a/sdk/search/Azure.Search.Documents/src/Generated/SearchServiceRestClient.cs +++ b/sdk/search/Azure.Search.Documents/src/Generated/SearchServiceRestClient.cs @@ -32,7 +32,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 = "2024-09-01-preview") + public SearchServiceRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string endpoint, Guid? xMsClientRequestId = null, string apiVersion = "2024-11-01-preview") { ClientDiagnostics = clientDiagnostics ?? throw new ArgumentNullException(nameof(clientDiagnostics)); _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); diff --git a/sdk/search/Azure.Search.Documents/src/Generated/SkillsetsRestClient.cs b/sdk/search/Azure.Search.Documents/src/Generated/SkillsetsRestClient.cs index f7992be07d4f7..13912b3264293 100644 --- a/sdk/search/Azure.Search.Documents/src/Generated/SkillsetsRestClient.cs +++ b/sdk/search/Azure.Search.Documents/src/Generated/SkillsetsRestClient.cs @@ -33,7 +33,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 = "2024-09-01-preview") + public SkillsetsRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string endpoint, Guid? xMsClientRequestId = null, string apiVersion = "2024-11-01-preview") { ClientDiagnostics = clientDiagnostics ?? throw new ArgumentNullException(nameof(clientDiagnostics)); _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); diff --git a/sdk/search/Azure.Search.Documents/src/Generated/SynonymMapsRestClient.cs b/sdk/search/Azure.Search.Documents/src/Generated/SynonymMapsRestClient.cs index 9247e8a18f766..33b657759e497 100644 --- a/sdk/search/Azure.Search.Documents/src/Generated/SynonymMapsRestClient.cs +++ b/sdk/search/Azure.Search.Documents/src/Generated/SynonymMapsRestClient.cs @@ -32,7 +32,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 = "2024-09-01-preview") + public SynonymMapsRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string endpoint, Guid? xMsClientRequestId = null, string apiVersion = "2024-11-01-preview") { ClientDiagnostics = clientDiagnostics ?? throw new ArgumentNullException(nameof(clientDiagnostics)); _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); diff --git a/sdk/search/Azure.Search.Documents/src/Models/QueryAnswer.cs b/sdk/search/Azure.Search.Documents/src/Models/QueryAnswer.cs index ab38b970b0e27..ab58a3255c149 100644 --- a/sdk/search/Azure.Search.Documents/src/Models/QueryAnswer.cs +++ b/sdk/search/Azure.Search.Documents/src/Models/QueryAnswer.cs @@ -2,8 +2,6 @@ // Licensed under the MIT License. using System; -using System.Collections.Generic; -using System.Numerics; using System.Text; using Azure.Core; @@ -16,6 +14,7 @@ public partial class QueryAnswer { private const string QueryAnswerCountRaw = "count-"; private const string QueryAnswerThresholdRaw = "threshold-"; + private const string QueryAnswerMaxCharLengthRaw = "maxcharlength-"; /// /// Initializes a new instance of the class. @@ -39,37 +38,54 @@ internal QueryAnswer() { } /// A value that specifies the number of that should be returned as part of the search response and will default to 1. public int? Count { get; set; } - /// A value that specifies the threshold of that should be returned as part of the search response. The threshold is optional and will default to 0.7. - /// + /// A value that specifies the threshold of that should be returned as part of the search response. The threshold is optional and will default to 0.7. public double? Threshold { get; set; } - /// Constructed from , and . For example: "extractive|count-1,threshold-0.7" + /// A value that specifies the maximum character length for answers returned as part of the search response. Optional and will default to null. + public int? MaxCharLength { get; set; } + + /// + /// Constructed from , , , and . + /// Examples of the values: + /// - "extractive" + /// - "extractive|count-1" + /// - "extractive|threshold-0.7" + /// - "extractive|count-5,threshold-0.9" + /// - "extractive|threshold-0.8,count-4" + /// - "extractive|maxcharlength-500" + /// - "extractive|count-2,maxcharlength-300" + /// - "extractive|threshold-0.6,maxcharlength-400,count-3" + /// internal string QueryAnswerRaw { get { - StringBuilder queryAnswerStringValue = new(AnswerType.ToString()); + StringBuilder queryAnswerStringValue = new(AnswerType.ToString()); - if (Count.HasValue && Threshold.HasValue) - { - return queryAnswerStringValue.Append($"|{QueryAnswerCountRaw}{Count.Value},{QueryAnswerThresholdRaw}{Threshold.Value}").ToString(); - } - else if (Count.HasValue) + if (Count.HasValue || Threshold.HasValue || MaxCharLength.HasValue) + { + queryAnswerStringValue.Append('|'); + if (Count.HasValue) { - return queryAnswerStringValue.Append($"|{QueryAnswerCountRaw}{Count.Value}").ToString(); + queryAnswerStringValue.Append($"{QueryAnswerCountRaw}{Count.Value},"); } - else if (Threshold.HasValue) + if (Threshold.HasValue) { - return queryAnswerStringValue.Append($"|{QueryAnswerThresholdRaw}{Threshold.Value}").ToString(); + queryAnswerStringValue.Append($"{QueryAnswerThresholdRaw}{Threshold.Value},"); } - else + if (MaxCharLength.HasValue) { - return queryAnswerStringValue.ToString(); + queryAnswerStringValue.Append($"{QueryAnswerMaxCharLengthRaw}{MaxCharLength.Value},"); } + // Remove the trailing comma + queryAnswerStringValue.Length--; } + + return queryAnswerStringValue.ToString(); + } set { - if (!string.IsNullOrEmpty(value)) // If the value is - "extractive" or "extractive|count-1" or "extractive|threshold-0.7" or "extractive|count-5,threshold-0.9" or "extractive|threshold-0.8,count-4" + if (!string.IsNullOrEmpty(value)) { string[] queryAnswerValues = value.Split('|'); if (!string.IsNullOrEmpty(queryAnswerValues[0])) @@ -80,25 +96,30 @@ internal string QueryAnswerRaw if (queryAnswerValues.Length == 2) { var queryAnswerParams = queryAnswerValues[1].Split(','); - if (queryAnswerParams.Length <= 2) + foreach (var param in queryAnswerParams) { - foreach (var param in queryAnswerParams) + if (param.Contains(QueryAnswerCountRaw)) { - if (param.Contains(QueryAnswerCountRaw)) + var countPart = param.Substring(param.IndexOf(QueryAnswerCountRaw, StringComparison.OrdinalIgnoreCase) + QueryAnswerCountRaw.Length); + if (int.TryParse(countPart, out int countValue)) { - var countPart = param.Substring(param.IndexOf(QueryAnswerCountRaw, StringComparison.OrdinalIgnoreCase) + QueryAnswerCountRaw.Length); - if (int.TryParse(countPart, out int countValue)) - { - Count = countValue; - } + Count = countValue; } - else if (param.Contains(QueryAnswerThresholdRaw)) + } + else if (param.Contains(QueryAnswerThresholdRaw)) + { + var thresholdPart = param.Substring(param.IndexOf(QueryAnswerThresholdRaw, StringComparison.OrdinalIgnoreCase) + QueryAnswerThresholdRaw.Length); + if (double.TryParse(thresholdPart, out double thresholdValue)) + { + Threshold = thresholdValue; + } + } + else if (param.Contains(QueryAnswerMaxCharLengthRaw)) + { + var maxCharLengthPart = param.Substring(param.IndexOf(QueryAnswerMaxCharLengthRaw, StringComparison.OrdinalIgnoreCase) + QueryAnswerMaxCharLengthRaw.Length); + if (int.TryParse(maxCharLengthPart, out int maxCharLengthValue)) { - var thresholdPart = param.Substring(param.IndexOf(QueryAnswerThresholdRaw, StringComparison.OrdinalIgnoreCase) + QueryAnswerThresholdRaw.Length); - if (double.TryParse(thresholdPart, out double thresholdValue)) - { - Threshold = thresholdValue; - } + MaxCharLength = maxCharLengthValue; } } } diff --git a/sdk/search/Azure.Search.Documents/src/Models/QueryCaption.cs b/sdk/search/Azure.Search.Documents/src/Models/QueryCaption.cs index 13343f5713ee5..ddae37fe0b334 100644 --- a/sdk/search/Azure.Search.Documents/src/Models/QueryCaption.cs +++ b/sdk/search/Azure.Search.Documents/src/Models/QueryCaption.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. using System; -using System.Collections.Generic; +using System.Text; using Azure.Core; namespace Azure.Search.Documents.Models @@ -12,7 +12,8 @@ namespace Azure.Search.Documents.Models /// public partial class QueryCaption { - private const string QueryCaptionRawSplitter = "|highlight-"; + private const string QueryCaptionHighlightRaw = "highlight-"; + private const string QueryCaptionMaxCharLengthRaw = "maxcharlength-"; /// /// Initializes a new instance of the class. @@ -43,42 +44,71 @@ internal QueryCaption() { } /// public bool HighlightEnabled { get; set; } = true; - /// Constructed from and . - [CodeGenMember("Captions")] + /// + /// A value that specifies the maximum character length for captions returned as part of the search response. + /// Optional and defaults to null. + /// + public int? MaxCharLength { get; set; } + + /// + /// Constructed from , , and . + /// internal string QueryCaptionRaw { get { - if (CaptionType == QueryCaptionType.Extractive) - { - return $"{CaptionType}{QueryCaptionRawSplitter}{HighlightEnabled}"; - } - else + StringBuilder queryCaptionStringValue = new(CaptionType.ToString()); + + if (CaptionType == QueryCaptionType.Extractive) + { + queryCaptionStringValue.Append('|'); + queryCaptionStringValue.Append($"{QueryCaptionHighlightRaw}{HighlightEnabled}"); + + // Add maxcharlength if specified. + if (MaxCharLength.HasValue) { - return CaptionType.ToString(); + queryCaptionStringValue.Append($",{QueryCaptionMaxCharLengthRaw}{MaxCharLength.Value}"); } - } + } + return queryCaptionStringValue.ToString(); + } set { if (string.IsNullOrEmpty(value)) { CaptionType = null; + HighlightEnabled = true; + MaxCharLength = null; } else { - int splitIndex = value.IndexOf(QueryCaptionRawSplitter, StringComparison.OrdinalIgnoreCase); - if (splitIndex >= 0) - { - var queryCaptionPart = value.Substring(0, splitIndex); - var highlightPart = value.Substring(splitIndex + QueryCaptionRawSplitter.Length); + string[] parts = value.Split('|'); + CaptionType = new QueryCaptionType(parts[0]); - CaptionType = string.IsNullOrEmpty(queryCaptionPart) ? null : new QueryCaptionType(queryCaptionPart); - HighlightEnabled = bool.TryParse(highlightPart, out bool highlightValue) ? highlightValue : true; - } - else + HighlightEnabled = true; + MaxCharLength = null; + + if (CaptionType == QueryCaptionType.Extractive && parts.Length > 1) { - CaptionType = new QueryCaptionType(value); + string[] parameters = parts[1].Split(','); + + foreach (var param in parameters) + { + if (param.StartsWith(QueryCaptionHighlightRaw, StringComparison.OrdinalIgnoreCase)) + { + var highlightPart = param.Substring(QueryCaptionHighlightRaw.Length); + HighlightEnabled = bool.TryParse(highlightPart, out bool highlightValue) ? highlightValue : true; + } + else if (param.StartsWith(QueryCaptionMaxCharLengthRaw, StringComparison.OrdinalIgnoreCase)) + { + var maxCharLengthPart = param.Substring(QueryCaptionMaxCharLengthRaw.Length); + if (int.TryParse(maxCharLengthPart, out int maxCharLengthValue)) + { + MaxCharLength = maxCharLengthValue; + } + } + } } } } diff --git a/sdk/search/Azure.Search.Documents/src/Models/QueryRewrites.cs b/sdk/search/Azure.Search.Documents/src/Models/QueryRewrites.cs new file mode 100644 index 0000000000000..0ea03928d34b8 --- /dev/null +++ b/sdk/search/Azure.Search.Documents/src/Models/QueryRewrites.cs @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Text; +using Azure.Core; + +namespace Azure.Search.Documents.Models +{ + /// + /// Configuration for how semantic search returns query rewrite to the search. + /// + public partial class QueryRewrites + { + private const string QueryRewriteCountRaw = "count-"; + + /// + /// Initializes a new instance of the class. + /// + /// A value that specifies whether should be returned as part of the search response. + public QueryRewrites(QueryRewritesType rewritesType) + { + Argument.AssertNotNull(rewritesType, nameof(rewritesType)); + + RewritesType = rewritesType; + } + + /// + /// Initializes a new instance of the class. + /// + internal QueryRewrites() { } + + /// A value that specifies whether should be returned as part of the search response. + public QueryRewritesType RewritesType { get; internal set; } + + /// A value that specifies the number of that should be returned as part of the search response and will default to 10. + public int? Count { get; set; } + + /// + /// Constructed from and . + /// Examples of the values: + /// - "none" + /// - `generative|count-3` + /// + internal string QueryRewritesRaw + { + get + { + StringBuilder queryRewriteStringValue = new(RewritesType.ToString()); + + if (Count.HasValue) + { + queryRewriteStringValue.Append('|'); + queryRewriteStringValue.Append($"{QueryRewriteCountRaw}{Count.Value}"); + } + + return queryRewriteStringValue.ToString(); + } + set + { + if (!string.IsNullOrEmpty(value)) + { + string[] queryRewriteValues = value.Split('|'); + if (!string.IsNullOrEmpty(queryRewriteValues[0])) + { + RewritesType = new QueryRewritesType(queryRewriteValues[0]); + } + + if (queryRewriteValues.Length == 2 && queryRewriteValues[1].Contains(QueryRewriteCountRaw)) + { + var countPart = queryRewriteValues[1].Substring( + queryRewriteValues[1].IndexOf(QueryRewriteCountRaw, StringComparison.OrdinalIgnoreCase) + QueryRewriteCountRaw.Length); + + if (int.TryParse(countPart, out int countValue)) + { + Count = countValue; + } + } + } + } + } + } +} diff --git a/sdk/search/Azure.Search.Documents/src/Models/SearchModelFactory.cs b/sdk/search/Azure.Search.Documents/src/Models/SearchModelFactory.cs index 5facdd630f772..379908909cd30 100644 --- a/sdk/search/Azure.Search.Documents/src/Models/SearchModelFactory.cs +++ b/sdk/search/Azure.Search.Documents/src/Models/SearchModelFactory.cs @@ -371,11 +371,12 @@ public static AutocompleteItem AutocompleteItem( /// ]]> /// /// For more details please refer + [EditorBrowsable(EditorBrowsableState.Never)] public static FacetResult FacetResult(long? count = null, IReadOnlyDictionary additionalProperties = null) { additionalProperties ??= new Dictionary(); - return new FacetResult(count, additionalProperties); + return new FacetResult(count, null, additionalProperties); } /// Initializes a new instance of IndexDocumentsResult. diff --git a/sdk/search/Azure.Search.Documents/src/Models/SearchResult.cs b/sdk/search/Azure.Search.Documents/src/Models/SearchResult.cs index 22a85a0fb242c..6fe5c0d26032f 100644 --- a/sdk/search/Azure.Search.Documents/src/Models/SearchResult.cs +++ b/sdk/search/Azure.Search.Documents/src/Models/SearchResult.cs @@ -49,7 +49,7 @@ public class SearchResult /// /// Contains debugging information that can be used to further explore your search results. /// - public IList DocumentDebugInfo { get; internal set; } + public DocumentDebugInfo DocumentDebugInfo { get; internal set; } /// /// The document found by the search query. @@ -127,12 +127,7 @@ internal static async Task> DeserializeAsync( else if (prop.NameEquals(Constants.SearchDocumentDebugInfoKeyJson.EncodedUtf8Bytes) && prop.Value.ValueKind != JsonValueKind.Null) { - result.DocumentDebugInfo = new List(); - - foreach (JsonElement documentDebugInfoValue in prop.Value.EnumerateArray()) - { - result.DocumentDebugInfo.Add(Models.DocumentDebugInfo.DeserializeDocumentDebugInfo(documentDebugInfoValue)); - } + result.DocumentDebugInfo = DocumentDebugInfo.DeserializeDocumentDebugInfo(prop.Value); } } @@ -230,6 +225,7 @@ public static SearchResult SearchResult( /// /// The semantic search result. /// A new SearchResult instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] public static SearchResult SearchResult( T document, double? score, @@ -243,6 +239,40 @@ public static SearchResult SearchResult( SemanticSearch = semanticSearch }; + /// Initializes a new instance of SearchResult. + /// + /// The .NET type that maps to the index schema. Instances of this type can + /// be retrieved as documents from the index. + /// + /// The document found by the search query. + /// + /// The relevance score of the document compared to other documents + /// returned by the query. + /// + /// + /// 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. + /// + /// The semantic search result. + /// Contains debugging information that + /// can be used to further explore your search results. + /// A new SearchResult instance for mocking. + public static SearchResult SearchResult( + T document, + double? score, + IDictionary> highlights, + SemanticSearchResult semanticSearch, + DocumentDebugInfo documentDebugInfo) => + new SearchResult() + { + Score = score, + Highlights = highlights, + Document = document, + SemanticSearch = semanticSearch, + DocumentDebugInfo = documentDebugInfo + }; + /// Initializes a new instance of . /// The relevance score computed by the semantic ranker for the top search results. /// Captions are the most representative passages from the document relatively to the search query. diff --git a/sdk/search/Azure.Search.Documents/src/Models/SearchResults.cs b/sdk/search/Azure.Search.Documents/src/Models/SearchResults.cs index db8b050253709..33e3ecd8593a4 100644 --- a/sdk/search/Azure.Search.Documents/src/Models/SearchResults.cs +++ b/sdk/search/Azure.Search.Documents/src/Models/SearchResults.cs @@ -10,11 +10,9 @@ using System.Text.Json; using System.Threading; using System.Threading.Tasks; -using System.Xml.Linq; using Azure.Core; using Azure.Core.Pipeline; using Azure.Core.Serialization; -using Azure.Search.Documents.Indexes.Models; #pragma warning disable SA1402 // File may only contain a single type @@ -61,6 +59,9 @@ public class SearchResults /// public SemanticSearchResults SemanticSearch { get; internal set; } + /// Debug information that applies to the search results as a whole. + public DebugInfo DebugInfo { get; internal set; } + /// /// Gets the first (server side) page of search result values. /// @@ -209,6 +210,7 @@ await JsonDocument.ParseAsync(json, cancellationToken: cancellationToken).Config foreach (JsonElement facetValue in facetObject.Value.EnumerateArray()) { Dictionary facetValues = new Dictionary(); + IReadOnlyDictionary> searchFacets = default; long? facetCount = null; foreach (JsonProperty facetProperty in facetValue.EnumerateObject()) { @@ -219,13 +221,39 @@ await JsonDocument.ParseAsync(json, cancellationToken: cancellationToken).Config facetCount = facetProperty.Value.GetInt64(); } } + else if (facetProperty.NameEquals(Constants.FacetsKeyJson.EncodedUtf8Bytes)) + { + if (facetProperty.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary> dictionary = new Dictionary>(); + foreach (var property0 in facetProperty.Value.EnumerateObject()) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(property0.Name, null); + } + else + { + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(FacetResult.DeserializeFacetResult(item)); + } + dictionary.Add(property0.Name, array); + } + } + searchFacets = dictionary; + continue; + } else { object value = facetProperty.Value.GetSearchObject(); facetValues[facetProperty.Name] = value; } } - facets.Add(new FacetResult(facetCount, facetValues)); + facets.Add(new FacetResult(facetCount, searchFacets, facetValues)); } // Add the facet to the results results.Facets[facetObject.Name] = facets; @@ -259,6 +287,16 @@ await JsonDocument.ParseAsync(json, cancellationToken: cancellationToken).Config } results.SemanticSearch.Answers = answerResults; } + if (prop.NameEquals(Constants.SearchSemanticQueryRewritesResultTypeKeyJson.EncodedUtf8Bytes) && + prop.Value.ValueKind != JsonValueKind.Null) + { + results.SemanticSearch.SemanticQueryRewritesResultType = new SemanticQueryRewritesResultType(prop.Value.GetString()); + } + if (prop.NameEquals(Constants.SearchDebugKeyJson.EncodedUtf8Bytes) && + prop.Value.ValueKind != JsonValueKind.Null) + { + results.DebugInfo = DebugInfo.DeserializeDebugInfo(prop.Value); + } else if (prop.NameEquals(Constants.ValueKeyJson.EncodedUtf8Bytes)) { foreach (JsonElement element in prop.Value.EnumerateArray()) @@ -292,6 +330,9 @@ public class SemanticSearchResults /// Type of partial response that was returned for a semantic search request. public SemanticSearchResultsType? ResultsType { get; internal set; } + + /// Type of query rewrite that was used to retrieve documents. + public SemanticQueryRewritesResultType? SemanticQueryRewritesResultType { get; internal set; } } /// @@ -346,6 +387,11 @@ internal SearchResultsPage(SearchResults results) /// public SemanticSearchResults SemanticSearch => _results.SemanticSearch; + /// + /// Debug information that applies to the search results as a whole. + /// + public DebugInfo DebugInfo => _results.DebugInfo; + /// public override IReadOnlyList> Values => _values ??= new ReadOnlyCollection>(_results.Values); @@ -474,6 +520,7 @@ public static SearchResults SearchResults( /// The raw Response that obtained these results from the service. /// The semantic search result. /// A new SearchResults instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] public static SearchResults SearchResults( IEnumerable> values, long? totalCount, @@ -494,11 +541,47 @@ public static SearchResults SearchResults( return results; } - /// Initializes a new instance of . + /// Initializes a new instance of SearchResults. + /// + /// The .NET type that maps to the index schema. Instances of this type can + /// be retrieved as documents from the index. + /// + /// The search result values. + /// The total count of results found by the search operation. + /// The facet query results for the search operation. + /// A value indicating the percentage of the index that was included in the query + /// The raw Response that obtained these results from the service. + /// The semantic search result. + /// Debug information that applies to the search results as a whole. + /// A new SearchResults instance for mocking. + public static SearchResults SearchResults( + IEnumerable> values, + long? totalCount, + IDictionary> facets, + double? coverage, + Response rawResponse, + SemanticSearchResults semanticSearch, + DebugInfo debugInfo) + { + var results = new SearchResults() + { + TotalCount = totalCount, + Coverage = coverage, + Facets = facets, + RawResponse = rawResponse, + SemanticSearch = semanticSearch, + DebugInfo = debugInfo + }; + results.Values.AddRange(values); + return results; + } + + /// Initializes a new instance of . /// The answers query results for the search operation. /// Reason that a partial response was returned for a semantic search request. /// Type of partial response that was returned for a semantic search request. /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] public static SemanticSearchResults SemanticSearchResults( IReadOnlyList answers, SemanticErrorReason? errorReason, @@ -510,6 +593,25 @@ public static SemanticSearchResults SemanticSearchResults( ResultsType = resultsType }; + /// Initializes a new instance of . + /// The answers query results for the search operation. + /// Reason that a partial response was returned for a semantic search request. + /// Type of partial response that was returned for a semantic search request. + /// Type of query rewrite that was used to retrieve documents. + /// A new instance for mocking. + public static SemanticSearchResults SemanticSearchResults( + IReadOnlyList answers, + SemanticErrorReason? errorReason, + SemanticSearchResultsType? resultsType, + SemanticQueryRewritesResultType? semanticQueryRewritesResultType) => + new SemanticSearchResults() + { + Answers = answers, + ErrorReason = errorReason, + ResultsType = resultsType, + SemanticQueryRewritesResultType = semanticQueryRewritesResultType + }; + /// Initializes a new instance of SearchResultsPage. /// /// The .NET type that maps to the index schema. Instances of this type can diff --git a/sdk/search/Azure.Search.Documents/src/Options/SearchOptions.cs b/sdk/search/Azure.Search.Documents/src/Options/SearchOptions.cs index d46244da5496f..77d823d143d21 100644 --- a/sdk/search/Azure.Search.Documents/src/Options/SearchOptions.cs +++ b/sdk/search/Azure.Search.Documents/src/Options/SearchOptions.cs @@ -48,6 +48,7 @@ public partial class SearchOptions /// 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. /// A value that specifies whether captions should be returned as part of the search response. + /// A value that specifies whether query rewrites should be generated to augment the search query. /// The comma-separated list of field names used for semantic ranking. /// /// The query parameters for vector and hybrid search queries. @@ -56,8 +57,18 @@ public partial class SearchOptions /// /// Determines whether or not filters are applied before or after the vector search is performed. Default is 'preFilter'. /// The query parameters to configure hybrid search behaviors. - 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 semanticQuery, string semanticConfigurationName, SemanticErrorMode? semanticErrorMode, int? semanticMaxWaitInMilliseconds, QueryDebugMode? debug, string searchText, string searchFieldsRaw, SearchMode? searchMode, QueryLanguage? queryLanguage, QuerySpellerType? querySpeller, string queryAnswerRaw, string selectRaw, int? skip, int? size, string queryCaptionRaw, string semanticFieldsRaw, IList vectorQueries, VectorFilterMode? filterMode, HybridSearch hybridSearch) + 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, QueryDebugMode? debug, string searchText, string searchFieldsRaw, SearchMode? searchMode, QueryLanguage? queryLanguage, QuerySpellerType? querySpeller, string selectRaw, int? skip, int? size, string semanticConfigurationName, SemanticErrorMode? semanticErrorMode, int? semanticMaxWaitInMilliseconds, string semanticQuery, string queryAnswerRaw, string queryCaptionRaw, string queryRewritesRaw, string semanticFieldsRaw, IList vectorQueries, VectorFilterMode? filterMode, HybridSearch hybridSearch) { + SemanticSearch = (semanticConfigurationName != null || semanticErrorMode != null || semanticMaxWaitInMilliseconds != null || queryAnswerRaw != null || queryCaptionRaw != null || semanticQuery != null || semanticFieldsRaw != null || debug != null) ? new SemanticSearchOptions() : null; + if (SemanticSearch != null) + { + SemanticSearch.QueryAnswer = queryAnswerRaw != null ? new QueryAnswer() : null; + SemanticSearch.QueryCaption = queryCaptionRaw != null ? new QueryCaption() : null; + SemanticSearch.QueryRewrites = queryRewritesRaw != null ? new QueryRewrites() : null; + } + + VectorSearch = (vectorQueries != null || filterMode != null) ? new VectorSearchOptions() : null; + IncludeTotalCount = includeTotalCount; Facets = facets; Filter = filter; @@ -71,31 +82,23 @@ internal SearchOptions(bool? includeTotalCount, IList facets, string fil SessionId = sessionId; ScoringParameters = scoringParameters; ScoringProfile = scoringProfile; + Debug = debug; SearchText = searchText; SearchFieldsRaw = searchFieldsRaw; SearchMode = searchMode; + QueryLanguage = queryLanguage; + QuerySpeller = querySpeller; SelectRaw = selectRaw; Skip = skip; Size = size; - QueryLanguage = queryLanguage; - QuerySpeller = querySpeller; - - SemanticSearch = (semanticConfigurationName != null || semanticErrorMode != null || semanticMaxWaitInMilliseconds != null || queryAnswerRaw != null || queryCaptionRaw != null || semanticQuery != null || semanticFieldsRaw != null || debug != null) ? new SemanticSearchOptions() : null; - if (SemanticSearch != null) - { - SemanticSearch.QueryAnswer = queryAnswerRaw != null ? new QueryAnswer() : null; - SemanticSearch.QueryCaption = queryCaptionRaw != null ? new QueryCaption() : null; - } SemanticConfigurationName = semanticConfigurationName; SemanticErrorMode = semanticErrorMode; SemanticMaxWaitInMilliseconds = semanticMaxWaitInMilliseconds; + SemanticQuery = semanticQuery; QueryAnswerRaw = queryAnswerRaw; QueryCaptionRaw = queryCaptionRaw; - SemanticQuery = semanticQuery; + QueryRewritesRaw = queryRewritesRaw; SemanticFieldsRaw = semanticFieldsRaw; - Debug = debug; - - VectorSearch = (vectorQueries != null || filterMode != null) ? new VectorSearchOptions() : null; VectorQueries = vectorQueries; FilterMode = filterMode; HybridSearch = hybridSearch; @@ -296,6 +299,20 @@ private string QueryCaptionRaw } } + /// Constructed from and . For example: "generative|count-3" + [CodeGenMember("QueryRewrites")] + private string QueryRewritesRaw + { + get { return SemanticSearch?.QueryRewrites?.QueryRewritesRaw; } + set + { + if (SemanticSearch?.QueryRewrites != null) + { + SemanticSearch.QueryRewrites.QueryRewritesRaw = value; + } + } + } + /// The comma-separated list of field names used for semantic ranking. [CodeGenMember("SemanticFields")] private string SemanticFieldsRaw diff --git a/sdk/search/Azure.Search.Documents/src/Options/SemanticSearchOptions.cs b/sdk/search/Azure.Search.Documents/src/Options/SemanticSearchOptions.cs index 58950ebd7bf95..bdd61cf53638a 100644 --- a/sdk/search/Azure.Search.Documents/src/Options/SemanticSearchOptions.cs +++ b/sdk/search/Azure.Search.Documents/src/Options/SemanticSearchOptions.cs @@ -31,6 +31,12 @@ public partial class SemanticSearchOptions /// public QueryCaption QueryCaption { get; set; } + /// + /// This parameter is only valid if the query type is `semantic`. When QueryRewrites is set to `generative`, the query terms are sent to a + /// generate model which will produce 10 (default) rewrites to help increase the recall of the request. The requested count can be configured + /// by appending the pipe character `|` followed by the `count-<number of rewrites>` option, such as `generative|count-3`. Defaults to `None`. + public QueryRewrites QueryRewrites { get; set; } + /// The list of field names used for semantic search. public IList SemanticFields { get; internal set; } = new List(); diff --git a/sdk/search/Azure.Search.Documents/src/SearchClientOptions.cs b/sdk/search/Azure.Search.Documents/src/SearchClientOptions.cs index c3ee550eb7f37..b2b6d17b3970e 100644 --- a/sdk/search/Azure.Search.Documents/src/SearchClientOptions.cs +++ b/sdk/search/Azure.Search.Documents/src/SearchClientOptions.cs @@ -42,16 +42,16 @@ public enum ServiceVersion V2024_07_01 = 3, /// - /// The 2024-09-01-preview version of the Azure Cognitive Search service. + /// The 2024-11-01-preview version of the Azure Cognitive Search service. /// - V2024_09_01_Preview = 4, + V2024_11_01_Preview = 4, #pragma warning restore CA1707 } /// /// The Latest service version supported by this client library. /// - internal const ServiceVersion LatestVersion = ServiceVersion.V2024_09_01_Preview; + internal const ServiceVersion LatestVersion = ServiceVersion.V2024_11_01_Preview; /// /// The service version to use when creating continuation tokens that @@ -206,7 +206,7 @@ public static SearchClientOptions.ServiceVersion Validate(this SearchClientOptio SearchClientOptions.ServiceVersion.V2020_06_30 => version, SearchClientOptions.ServiceVersion.V2023_11_01 => version, SearchClientOptions.ServiceVersion.V2024_07_01 => version, - SearchClientOptions.ServiceVersion.V2024_09_01_Preview => version, + SearchClientOptions.ServiceVersion.V2024_11_01_Preview => version, _ => throw CreateInvalidVersionException(version) }; @@ -231,7 +231,7 @@ public static string ToVersionString(this SearchClientOptions.ServiceVersion ver SearchClientOptions.ServiceVersion.V2020_06_30 => "2020-06-30", SearchClientOptions.ServiceVersion.V2023_11_01 => "2023-11-01", SearchClientOptions.ServiceVersion.V2024_07_01 => "2024-07-01", - SearchClientOptions.ServiceVersion.V2024_09_01_Preview => "2024-09-01-preview", + SearchClientOptions.ServiceVersion.V2024_11_01_Preview => "2024-11-01-preview", _ => throw CreateInvalidVersionException(version) }; diff --git a/sdk/search/Azure.Search.Documents/src/Utilities/Constants.cs b/sdk/search/Azure.Search.Documents/src/Utilities/Constants.cs index 2248966f2278b..49663f2698191 100644 --- a/sdk/search/Azure.Search.Documents/src/Utilities/Constants.cs +++ b/sdk/search/Azure.Search.Documents/src/Utilities/Constants.cs @@ -81,6 +81,16 @@ internal static class Constants /// public static readonly JsonEncodedText SearchAnswersKeyJson = JsonEncodedText.Encode("@search.answers"); + /// + /// The @search.debugInfo key. + /// + public static readonly JsonEncodedText SearchDebugKeyJson = JsonEncodedText.Encode("@search.debug"); + + /// + /// The @search.semanticQueryRewritesResultType key. + /// + public static readonly JsonEncodedText SearchSemanticQueryRewritesResultTypeKeyJson = JsonEncodedText.Encode("@search.semanticQueryRewritesResultType"); + /// /// The @search.highlights key. /// @@ -141,6 +151,11 @@ internal static class Constants /// public static readonly JsonEncodedText CountKeyJson = JsonEncodedText.Encode(CountKey); + /// + /// The facets key. + /// + public static readonly JsonEncodedText FacetsKeyJson = JsonEncodedText.Encode("@search.facets"); + /// /// The to key. /// diff --git a/sdk/search/Azure.Search.Documents/src/autorest.md b/sdk/search/Azure.Search.Documents/src/autorest.md index 46360ffa182b7..a0b16fa585684 100644 --- a/sdk/search/Azure.Search.Documents/src/autorest.md +++ b/sdk/search/Azure.Search.Documents/src/autorest.md @@ -11,8 +11,8 @@ See the [Contributing guidelines](https://github.com/Azure/azure-sdk-for-net/blo ```yaml title: SearchServiceClient input-file: - - https://github.com/Azure/azure-rest-api-specs/blob/4b7fbd8b842b509a0330f20260821dd844328dff/specification/search/data-plane/Azure.Search/preview/2024-09-01-preview/searchindex.json - - https://github.com/Azure/azure-rest-api-specs/blob/4b7fbd8b842b509a0330f20260821dd844328dff/specification/search/data-plane/Azure.Search/preview/2024-09-01-preview/searchservice.json + - https://github.com/Azure/azure-rest-api-specs/blob/14531a7cf6101c1dd57e7c1c83103a047bb8f5bb/specification/search/data-plane/Azure.Search/preview/2024-11-01-preview/searchindex.json + - https://github.com/Azure/azure-rest-api-specs/blob/14531a7cf6101c1dd57e7c1c83103a047bb8f5bb/specification/search/data-plane/Azure.Search/preview/2024-11-01-preview/searchservice.json generation1-convenience-client: true deserialize-null-collection-as-null-value: true ``` @@ -81,6 +81,27 @@ directive: $.additionalProperties = true; ``` +### Fix `SearchDocumentsResult["@search.debugInfo"]` -> `SearchDocumentsResult["@search.debug"]` +``` yaml +directive: + - from: searchindex.json + where: $.definitions.SearchDocumentsResult.properties + transform: > + $["@search.debug"] = $["@search.debugInfo"]; + delete $["@search.debugInfo"]; +``` + +### Fix `SearchResult["@search.documentDebugInfo"]` +``` yaml +directive: + - from: searchindex.json + where: $.definitions.SearchResult.properties + transform: > + $["@search.documentDebugInfo"]["$ref"] = $["@search.documentDebugInfo"].items["$ref"]; + delete $["@search.documentDebugInfo"].type; + delete $["@search.documentDebugInfo"].items; +``` + ### Archboard feedback for 11.6.0 ```yaml diff --git a/sdk/search/Azure.Search.Documents/tests/DocumentOperations/SearchTests.cs b/sdk/search/Azure.Search.Documents/tests/DocumentOperations/SearchTests.cs index 790a35da6b9a6..b9f3eceaa3fa6 100644 --- a/sdk/search/Azure.Search.Documents/tests/DocumentOperations/SearchTests.cs +++ b/sdk/search/Azure.Search.Documents/tests/DocumentOperations/SearchTests.cs @@ -53,14 +53,14 @@ private ICollection GetFacetsForField( } public FacetResult MakeRangeFacet(int count, object from, object to) => - new FacetResult(count, new Dictionary() + new FacetResult(count, null, new Dictionary() { ["from"] = from, ["to"] = to }); public FacetResult MakeValueFacet(int count, object value) => - new FacetResult(count, new Dictionary() + new FacetResult(count, null, new Dictionary() { ["value"] = value }); @@ -1018,8 +1018,9 @@ public void SearchOptionsCanBeCopied() source.SemanticSearch = new SemanticSearchOptions() { SemanticConfigurationName = "my-config", - QueryAnswer = new QueryAnswer(QueryAnswerType.Extractive) { Count = 5, Threshold = 0.9 }, - QueryCaption = new QueryCaption(QueryCaptionType.Extractive) { HighlightEnabled = true }, + QueryAnswer = new QueryAnswer(QueryAnswerType.Extractive) { Count = 5, Threshold = 0.9, MaxCharLength = 300 }, + QueryCaption = new QueryCaption(QueryCaptionType.Extractive) { HighlightEnabled = true, MaxCharLength = 300 }, + QueryRewrites = new QueryRewrites(QueryRewritesType.Generative) { Count = 3}, ErrorMode = SemanticErrorMode.Partial, MaxWait = TimeSpan.FromMilliseconds(1000), }; @@ -1047,8 +1048,12 @@ public void SearchOptionsCanBeCopied() Assert.AreEqual(source.SemanticSearch.QueryAnswer.AnswerType, clonedSearchOptions.SemanticSearch.QueryAnswer.AnswerType); Assert.AreEqual(source.SemanticSearch.QueryAnswer.Count, clonedSearchOptions.SemanticSearch.QueryAnswer.Count); Assert.AreEqual(source.SemanticSearch.QueryAnswer.Threshold, clonedSearchOptions.SemanticSearch.QueryAnswer.Threshold); + Assert.AreEqual(source.SemanticSearch.QueryAnswer.MaxCharLength, clonedSearchOptions.SemanticSearch.QueryAnswer.MaxCharLength); Assert.AreEqual(source.SemanticSearch.QueryCaption.CaptionType, clonedSearchOptions.SemanticSearch.QueryCaption.CaptionType); Assert.AreEqual(source.SemanticSearch.QueryCaption.HighlightEnabled, clonedSearchOptions.SemanticSearch.QueryCaption.HighlightEnabled); + Assert.AreEqual(source.SemanticSearch.QueryCaption.MaxCharLength, clonedSearchOptions.SemanticSearch.QueryCaption.MaxCharLength); + Assert.AreEqual(source.SemanticSearch.QueryRewrites.RewritesType, clonedSearchOptions.SemanticSearch.QueryRewrites.RewritesType); + Assert.AreEqual(source.SemanticSearch.QueryRewrites.Count, clonedSearchOptions.SemanticSearch.QueryRewrites.Count); Assert.AreEqual(source.SemanticSearch.ErrorMode, clonedSearchOptions.SemanticSearch.ErrorMode); Assert.AreEqual(source.SemanticSearch.MaxWait, clonedSearchOptions.SemanticSearch.MaxWait); Assert.AreEqual(source.VectorSearch.Queries, clonedSearchOptions.VectorSearch.Queries); diff --git a/sdk/search/Azure.Search.Documents/tests/DocumentOperations/VectorSearchTests.cs b/sdk/search/Azure.Search.Documents/tests/DocumentOperations/VectorSearchTests.cs index 003ea10912f8b..dd8a64125437a 100644 --- a/sdk/search/Azure.Search.Documents/tests/DocumentOperations/VectorSearchTests.cs +++ b/sdk/search/Azure.Search.Documents/tests/DocumentOperations/VectorSearchTests.cs @@ -13,7 +13,7 @@ namespace Azure.Search.Documents.Tests { - [ClientTestFixture(SearchClientOptions.ServiceVersion.V2024_07_01, SearchClientOptions.ServiceVersion.V2024_09_01_Preview)] + [ClientTestFixture(SearchClientOptions.ServiceVersion.V2024_07_01, SearchClientOptions.ServiceVersion.V2024_11_01_Preview)] public partial class VectorSearchTests : SearchTestBase { public VectorSearchTests(bool async, SearchClientOptions.ServiceVersion serviceVersion) diff --git a/sdk/search/Azure.Search.Documents/tests/Models/SearchOptionsTests.cs b/sdk/search/Azure.Search.Documents/tests/Models/SearchOptionsTests.cs index 8e759e2e3e555..5177c2c0d5564 100644 --- a/sdk/search/Azure.Search.Documents/tests/Models/SearchOptionsTests.cs +++ b/sdk/search/Azure.Search.Documents/tests/Models/SearchOptionsTests.cs @@ -29,7 +29,7 @@ public void QueryTypeOption() } [Test] - public void QueryAnswerOptionWithNoCountAndThreshold() + public void QueryAnswerOptionWithNoCountThresholdAndMaxCharLength() { SearchOptions searchOptions = new(); searchOptions.SemanticSearch = new SemanticSearchOptions(); @@ -40,16 +40,19 @@ public void QueryAnswerOptionWithNoCountAndThreshold() Assert.AreEqual($"{QueryAnswerType.None}", searchOptions.SemanticSearch.QueryAnswer.QueryAnswerRaw); Assert.IsNull(searchOptions.SemanticSearch.QueryAnswer.Count); Assert.IsNull(searchOptions.SemanticSearch.QueryAnswer.Threshold); + Assert.IsNull(searchOptions.SemanticSearch.QueryAnswer.MaxCharLength); searchOptions.SemanticSearch.QueryAnswer = new QueryAnswer(QueryAnswerType.Extractive); Assert.AreEqual($"{QueryAnswerType.Extractive}", searchOptions.SemanticSearch.QueryAnswer.QueryAnswerRaw); Assert.IsNull(searchOptions.SemanticSearch.QueryAnswer.Count); Assert.IsNull(searchOptions.SemanticSearch.QueryAnswer.Threshold); + Assert.IsNull(searchOptions.SemanticSearch.QueryAnswer.MaxCharLength); searchOptions.SemanticSearch.QueryAnswer = new QueryAnswer("none"); Assert.AreEqual(QueryAnswerType.None, searchOptions.SemanticSearch.QueryAnswer.AnswerType); Assert.IsNull(searchOptions.SemanticSearch.QueryAnswer.Count); Assert.IsNull(searchOptions.SemanticSearch.QueryAnswer.Threshold); + Assert.IsNull(searchOptions.SemanticSearch.QueryAnswer.MaxCharLength); } [Test] @@ -106,6 +109,36 @@ public void QueryAnswerOptionWithOnlyThreshold() Assert.IsNull(searchOptions.SemanticSearch.QueryAnswer.Count); } + [Test] + public void QueryAnswerOptionWithOnlyMaxCharLength() + { + SearchOptions searchOptions = new(); + searchOptions.SemanticSearch = new SemanticSearchOptions(); + + Assert.IsNull(searchOptions.SemanticSearch.QueryAnswer); + + searchOptions.SemanticSearch.QueryAnswer = new QueryAnswer(QueryAnswerType.Extractive); + searchOptions.SemanticSearch.QueryAnswer.MaxCharLength = 1; + Assert.AreEqual(1, searchOptions.SemanticSearch.QueryAnswer.MaxCharLength); + Assert.AreEqual("extractive|maxcharlength-1", searchOptions.SemanticSearch.QueryAnswer.QueryAnswerRaw); + Assert.AreEqual(QueryAnswerType.Extractive, searchOptions.SemanticSearch.QueryAnswer.AnswerType); + Assert.IsNull(searchOptions.SemanticSearch.QueryAnswer.Threshold); + Assert.IsNull(searchOptions.SemanticSearch.QueryAnswer.Count); + + searchOptions.SemanticSearch.QueryAnswer.MaxCharLength = 300; + Assert.AreEqual(300, searchOptions.SemanticSearch.QueryAnswer.MaxCharLength); + Assert.AreEqual("extractive|maxcharlength-300", searchOptions.SemanticSearch.QueryAnswer.QueryAnswerRaw); + Assert.AreEqual(QueryAnswerType.Extractive, searchOptions.SemanticSearch.QueryAnswer.AnswerType); + Assert.IsNull(searchOptions.SemanticSearch.QueryAnswer.Threshold); + Assert.IsNull(searchOptions.SemanticSearch.QueryAnswer.Count); + + searchOptions.SemanticSearch.QueryAnswer.QueryAnswerRaw = "unknown|maxcharlength-300"; + Assert.AreEqual(300, searchOptions.SemanticSearch.QueryAnswer.MaxCharLength); + Assert.AreEqual("unknown", $"{searchOptions.SemanticSearch.QueryAnswer.AnswerType}"); + Assert.IsNull(searchOptions.SemanticSearch.QueryAnswer.Threshold); + Assert.IsNull(searchOptions.SemanticSearch.QueryAnswer.Count); + } + [Test] public void QueryAnswerOptionWithCountAndThreshold() { @@ -134,6 +167,38 @@ public void QueryAnswerOptionWithCountAndThreshold() Assert.AreEqual("unknown", $"{searchOptions.SemanticSearch.QueryAnswer.AnswerType}"); } + [Test] + public void QueryAnswerOptionWithCountAndMaxCharLength() + { + SearchOptions searchOptions = new(); + searchOptions.SemanticSearch = new SemanticSearchOptions(); + + Assert.IsNull(searchOptions.SemanticSearch.QueryAnswer); + + searchOptions.SemanticSearch.QueryAnswer = new QueryAnswer(QueryAnswerType.Extractive); + searchOptions.SemanticSearch.QueryAnswer.Count = 0; + searchOptions.SemanticSearch.QueryAnswer.MaxCharLength = 0; + Assert.AreEqual(0, searchOptions.SemanticSearch.QueryAnswer.Count); + Assert.AreEqual(0, searchOptions.SemanticSearch.QueryAnswer.MaxCharLength); + Assert.AreEqual("extractive|count-0,maxcharlength-0", searchOptions.SemanticSearch.QueryAnswer.QueryAnswerRaw); + Assert.AreEqual(QueryAnswerType.Extractive, searchOptions.SemanticSearch.QueryAnswer.AnswerType); + Assert.IsNull(searchOptions.SemanticSearch.QueryAnswer.Threshold); + + searchOptions.SemanticSearch.QueryAnswer.Count = 100; + searchOptions.SemanticSearch.QueryAnswer.MaxCharLength = 300; + Assert.AreEqual(100, searchOptions.SemanticSearch.QueryAnswer.Count); + Assert.AreEqual(300, searchOptions.SemanticSearch.QueryAnswer.MaxCharLength); + Assert.AreEqual("extractive|count-100,maxcharlength-300", searchOptions.SemanticSearch.QueryAnswer.QueryAnswerRaw); + Assert.AreEqual(QueryAnswerType.Extractive, searchOptions.SemanticSearch.QueryAnswer.AnswerType); + Assert.IsNull(searchOptions.SemanticSearch.QueryAnswer.Threshold); + + searchOptions.SemanticSearch.QueryAnswer.QueryAnswerRaw = "unknown|maxcharlength-500,count-3"; + Assert.AreEqual(3, searchOptions.SemanticSearch.QueryAnswer.Count); + Assert.AreEqual(500, searchOptions.SemanticSearch.QueryAnswer.MaxCharLength); + Assert.AreEqual("unknown", $"{searchOptions.SemanticSearch.QueryAnswer.AnswerType}"); + Assert.IsNull(searchOptions.SemanticSearch.QueryAnswer.Threshold); + } + [Test] public void QueryAnswerOption() { @@ -141,29 +206,30 @@ public void QueryAnswerOption() searchOptions.SemanticSearch = new SemanticSearchOptions(); // We can set `QueryAnswer` to one of the known values, using either a string or a pre-defined value. - searchOptions.SemanticSearch.QueryAnswer = new QueryAnswer("none") { Count = 3, Threshold = 0.9 }; - Assert.AreEqual($"{QueryAnswerType.None}|count-{searchOptions.SemanticSearch.QueryAnswer.Count},threshold-{searchOptions.SemanticSearch.QueryAnswer.Threshold}", searchOptions.SemanticSearch.QueryAnswer.QueryAnswerRaw); + searchOptions.SemanticSearch.QueryAnswer = new QueryAnswer("none") { Count = 3, Threshold = 0.9, MaxCharLength = 300 }; + Assert.AreEqual($"{QueryAnswerType.None}|count-{searchOptions.SemanticSearch.QueryAnswer.Count},threshold-{searchOptions.SemanticSearch.QueryAnswer.Threshold},maxcharlength-{searchOptions.SemanticSearch.QueryAnswer.MaxCharLength}", searchOptions.SemanticSearch.QueryAnswer.QueryAnswerRaw); - searchOptions.SemanticSearch.QueryAnswer = new QueryAnswer(QueryAnswerType.None) { Count = 3, Threshold = 0.9 }; - Assert.AreEqual($"{QueryAnswerType.None}|count-{searchOptions.SemanticSearch.QueryAnswer.Count},threshold-{searchOptions.SemanticSearch.QueryAnswer.Threshold}", searchOptions.SemanticSearch.QueryAnswer.QueryAnswerRaw); + searchOptions.SemanticSearch.QueryAnswer = new QueryAnswer(QueryAnswerType.None) { Count = 3, Threshold = 0.9, MaxCharLength = 300 }; + Assert.AreEqual($"{QueryAnswerType.None}|count-{searchOptions.SemanticSearch.QueryAnswer.Count},threshold-{searchOptions.SemanticSearch.QueryAnswer.Threshold},maxcharlength-{searchOptions.SemanticSearch.QueryAnswer.MaxCharLength}", searchOptions.SemanticSearch.QueryAnswer.QueryAnswerRaw); - searchOptions.SemanticSearch.QueryAnswer = new QueryAnswer("extractive") { Count = 3, Threshold = 0.9 }; - Assert.AreEqual($"{QueryAnswerType.Extractive}|count-{searchOptions.SemanticSearch.QueryAnswer.Count},threshold-{searchOptions.SemanticSearch.QueryAnswer.Threshold}", searchOptions.SemanticSearch.QueryAnswer.QueryAnswerRaw); + searchOptions.SemanticSearch.QueryAnswer = new QueryAnswer("extractive") { Count = 3, Threshold = 0.9, MaxCharLength = 300 }; + Assert.AreEqual($"{QueryAnswerType.Extractive}|count-{searchOptions.SemanticSearch.QueryAnswer.Count},threshold-{searchOptions.SemanticSearch.QueryAnswer.Threshold},maxcharlength-{searchOptions.SemanticSearch.QueryAnswer.MaxCharLength}", searchOptions.SemanticSearch.QueryAnswer.QueryAnswerRaw); - searchOptions.SemanticSearch.QueryAnswer = new QueryAnswer(QueryAnswerType.Extractive) { Count = 3, Threshold = 0.9 }; - Assert.AreEqual($"{QueryAnswerType.Extractive}|count-{searchOptions.SemanticSearch.QueryAnswer.Count},threshold-{searchOptions.SemanticSearch.QueryAnswer.Threshold}", searchOptions.SemanticSearch.QueryAnswer.QueryAnswerRaw); + searchOptions.SemanticSearch.QueryAnswer = new QueryAnswer(QueryAnswerType.Extractive) { Count = 3, Threshold = 0.9, MaxCharLength = 300 }; + Assert.AreEqual($"{QueryAnswerType.Extractive}|count-{searchOptions.SemanticSearch.QueryAnswer.Count},threshold-{searchOptions.SemanticSearch.QueryAnswer.Threshold},maxcharlength-{searchOptions.SemanticSearch.QueryAnswer.MaxCharLength}", searchOptions.SemanticSearch.QueryAnswer.QueryAnswerRaw); // We can also set `QueryAnswer` to a value unknown to the SDK. - searchOptions.SemanticSearch.QueryAnswer = new QueryAnswer("unknown") { Count = 3, Threshold = 0.9 }; - Assert.AreEqual($"unknown|count-{searchOptions.SemanticSearch.QueryAnswer.Count},threshold-{searchOptions.SemanticSearch.QueryAnswer.Threshold}", searchOptions.SemanticSearch.QueryAnswer.QueryAnswerRaw); + searchOptions.SemanticSearch.QueryAnswer = new QueryAnswer("unknown") { Count = 3, Threshold = 0.9, MaxCharLength = 300 }; + Assert.AreEqual($"unknown|count-{searchOptions.SemanticSearch.QueryAnswer.Count},threshold-{searchOptions.SemanticSearch.QueryAnswer.Threshold},maxcharlength-{searchOptions.SemanticSearch.QueryAnswer.MaxCharLength}", searchOptions.SemanticSearch.QueryAnswer.QueryAnswerRaw); - searchOptions.SemanticSearch.QueryAnswer = new QueryAnswer(new QueryAnswerType("unknown")) { Count = 3, Threshold = 0.9 }; - Assert.AreEqual($"unknown|count-{searchOptions.SemanticSearch.QueryAnswer.Count},threshold-{searchOptions.SemanticSearch.QueryAnswer.Threshold}", searchOptions.SemanticSearch.QueryAnswer.QueryAnswerRaw); + searchOptions.SemanticSearch.QueryAnswer = new QueryAnswer(new QueryAnswerType("unknown")) { Count = 3, Threshold = 0.9, MaxCharLength = 300 }; + Assert.AreEqual($"unknown|count-{searchOptions.SemanticSearch.QueryAnswer.Count},threshold-{searchOptions.SemanticSearch.QueryAnswer.Threshold},maxcharlength-{searchOptions.SemanticSearch.QueryAnswer.MaxCharLength}", searchOptions.SemanticSearch.QueryAnswer.QueryAnswerRaw); - searchOptions.SemanticSearch.QueryAnswer.QueryAnswerRaw = "unknown|count-10,threshold-0.8"; + searchOptions.SemanticSearch.QueryAnswer.QueryAnswerRaw = "unknown|count-10,threshold-0.8,maxcharlength-400"; Assert.AreEqual("unknown", $"{searchOptions.SemanticSearch.QueryAnswer.AnswerType}"); Assert.AreEqual(10, searchOptions.SemanticSearch.QueryAnswer.Count); Assert.AreEqual(0.8, searchOptions.SemanticSearch.QueryAnswer.Threshold); + Assert.AreEqual(400, searchOptions.SemanticSearch.QueryAnswer.MaxCharLength); } [Test] @@ -200,6 +266,20 @@ public void QueryCaptionOptionWithHighlight() Assert.False(searchOptions.SemanticSearch.QueryCaption.HighlightEnabled); } + [Test] + public void QueryCaptionOptionWithMaxLengthChar() + { + SearchOptions searchOptions = new(); + searchOptions.SemanticSearch = new SemanticSearchOptions(); + + Assert.IsNull(searchOptions.SemanticSearch.QueryCaption); + + searchOptions.SemanticSearch.QueryCaption = new QueryCaption(QueryCaptionType.Extractive) { MaxCharLength = 300 }; + Assert.AreEqual($"{QueryCaptionType.Extractive}|highlight-True,maxcharlength-300", searchOptions.SemanticSearch.QueryCaption.QueryCaptionRaw); + Assert.True(searchOptions.SemanticSearch.QueryCaption.HighlightEnabled); + Assert.AreEqual(300, searchOptions.SemanticSearch.QueryCaption.MaxCharLength); + } + [Test] public void QueryCaptionOption() { @@ -221,7 +301,12 @@ public void QueryCaptionOption() searchOptions.SemanticSearch.QueryCaption.CaptionType = QueryCaptionType.Extractive; Assert.AreEqual($"{QueryCaptionType.Extractive}|highlight-False", searchOptions.SemanticSearch.QueryCaption.QueryCaptionRaw); + searchOptions.SemanticSearch.QueryCaption.MaxCharLength = 300; + Assert.AreEqual($"{QueryCaptionType.Extractive}|highlight-False,maxcharlength-300", searchOptions.SemanticSearch.QueryCaption.QueryCaptionRaw); + searchOptions.SemanticSearch.QueryCaption.HighlightEnabled = true; + searchOptions.SemanticSearch.QueryCaption.MaxCharLength = 300; + Assert.AreEqual($"{QueryCaptionType.Extractive}|highlight-True,maxcharlength-300", searchOptions.SemanticSearch.QueryCaption.QueryCaptionRaw); // We can also set `QueryCaption` to a value unknown to the SDK. searchOptions.SemanticSearch.QueryCaption.CaptionType = "unknown"; @@ -235,6 +320,88 @@ public void QueryCaptionOption() Assert.True(searchOptions.SemanticSearch.QueryCaption.HighlightEnabled); } + [Test] + public void QueryRewritesOptionWithNoCount() + { + SearchOptions searchOptions = new(); + searchOptions.SemanticSearch = new SemanticSearchOptions(); + + Assert.IsNull(searchOptions.SemanticSearch.QueryRewrites); + + searchOptions.SemanticSearch.QueryRewrites = new QueryRewrites(QueryRewritesType.None); + Assert.AreEqual($"{QueryRewritesType.None}", searchOptions.SemanticSearch.QueryRewrites.QueryRewritesRaw); + Assert.IsNull(searchOptions.SemanticSearch.QueryRewrites.Count); + + searchOptions.SemanticSearch.QueryRewrites = new QueryRewrites(QueryRewritesType.Generative); + Assert.AreEqual($"{QueryRewritesType.Generative}", searchOptions.SemanticSearch.QueryRewrites.QueryRewritesRaw); + Assert.IsNull(searchOptions.SemanticSearch.QueryRewrites.Count); + + searchOptions.SemanticSearch.QueryRewrites = new QueryRewrites("none"); + Assert.AreEqual(QueryRewritesType.None, searchOptions.SemanticSearch.QueryRewrites.RewritesType); + Assert.IsNull(searchOptions.SemanticSearch.QueryRewrites.Count); + } + + [Test] + public void QueryRewritesOptionWithCount() + { + SearchOptions searchOptions = new(); + searchOptions.SemanticSearch = new SemanticSearchOptions(); + + Assert.IsNull(searchOptions.SemanticSearch.QueryRewrites); + + searchOptions.SemanticSearch.QueryRewrites = new QueryRewrites(QueryRewritesType.Generative); + searchOptions.SemanticSearch.QueryRewrites.Count = 0; + Assert.AreEqual(0, searchOptions.SemanticSearch.QueryRewrites.Count); + Assert.AreEqual("generative|count-0", searchOptions.SemanticSearch.QueryRewrites.QueryRewritesRaw); + Assert.AreEqual(QueryRewritesType.Generative, searchOptions.SemanticSearch.QueryRewrites.RewritesType); + + searchOptions.SemanticSearch.QueryRewrites.Count = 100; + Assert.AreEqual(100, searchOptions.SemanticSearch.QueryRewrites.Count); + Assert.AreEqual("generative|count-100", searchOptions.SemanticSearch.QueryRewrites.QueryRewritesRaw); + Assert.AreEqual(QueryRewritesType.Generative, searchOptions.SemanticSearch.QueryRewrites.RewritesType); + + searchOptions.SemanticSearch.QueryRewrites.QueryRewritesRaw = "unknown|count-3"; + Assert.AreEqual(3, searchOptions.SemanticSearch.QueryRewrites.Count); + Assert.AreEqual("unknown", $"{searchOptions.SemanticSearch.QueryRewrites.RewritesType}"); + } + + [Test] + public void QueryRewritesOption() + { + SearchOptions searchOptions = new(); + searchOptions.SemanticSearch = new SemanticSearchOptions(); + + // We can set `QueryRewrites` to one of the known values, using either a string or a pre-defined value. + searchOptions.SemanticSearch.QueryRewrites = new QueryRewrites("none") { Count = 3 }; + Assert.AreEqual($"{QueryRewritesType.None}|count-{searchOptions.SemanticSearch.QueryRewrites.Count}", + searchOptions.SemanticSearch.QueryRewrites.QueryRewritesRaw); + + searchOptions.SemanticSearch.QueryRewrites = new QueryRewrites(QueryRewritesType.None) { Count = 4 }; + Assert.AreEqual($"{QueryRewritesType.None}|count-{searchOptions.SemanticSearch.QueryRewrites.Count}", + searchOptions.SemanticSearch.QueryRewrites.QueryRewritesRaw); + + searchOptions.SemanticSearch.QueryRewrites = new QueryRewrites("generative") { Count = 5}; + Assert.AreEqual($"{QueryRewritesType.Generative}|count-{searchOptions.SemanticSearch.QueryRewrites.Count}", + searchOptions.SemanticSearch.QueryRewrites.QueryRewritesRaw); + + searchOptions.SemanticSearch.QueryRewrites = new QueryRewrites(QueryRewritesType.Generative) { Count = 6 }; + Assert.AreEqual($"{QueryRewritesType.Generative}|count-{searchOptions.SemanticSearch.QueryRewrites.Count}", + searchOptions.SemanticSearch.QueryRewrites.QueryRewritesRaw); + + // We can also set `QueryRewrites` to a value unknown to the SDK. + searchOptions.SemanticSearch.QueryRewrites = new QueryRewrites("unknown") { Count = 7 }; + Assert.AreEqual($"unknown|count-{searchOptions.SemanticSearch.QueryRewrites.Count}", + searchOptions.SemanticSearch.QueryRewrites.QueryRewritesRaw); + + searchOptions.SemanticSearch.QueryRewrites = new QueryRewrites(new QueryRewritesType("unknown")) { Count = 8 }; + Assert.AreEqual($"unknown|count-{searchOptions.SemanticSearch.QueryRewrites.Count}", + searchOptions.SemanticSearch.QueryRewrites.QueryRewritesRaw); + + searchOptions.SemanticSearch.QueryRewrites.QueryRewritesRaw = "unknown|count-9"; + Assert.AreEqual("unknown", $"{searchOptions.SemanticSearch.QueryRewrites.RewritesType}"); + Assert.AreEqual(9, searchOptions.SemanticSearch.QueryRewrites.Count); + } + [Test] public void SearchOptionsForSemanticSearch() { @@ -244,13 +411,15 @@ public void SearchOptionsForSemanticSearch() SemanticSearch = new() { SemanticConfigurationName = "my-semantic-config", - QueryCaption = new(QueryCaptionType.Extractive), - QueryAnswer = new(QueryAnswerType.Extractive){ Count = 5, Threshold = 0.8 } + QueryCaption = new(QueryCaptionType.Extractive) { MaxCharLength = 300}, + QueryAnswer = new(QueryAnswerType.Extractive){ Count = 5, Threshold = 0.8, MaxCharLength = 300 }, + QueryRewrites = new(QueryRewritesType.Generative) { Count = 3 } }, }; - Assert.AreEqual("extractive|count-5,threshold-0.8", searchOptions.SemanticSearch.QueryAnswer.QueryAnswerRaw); - Assert.AreEqual("extractive|highlight-True", searchOptions.SemanticSearch.QueryCaption.QueryCaptionRaw); + Assert.AreEqual("extractive|count-5,threshold-0.8,maxcharlength-300", searchOptions.SemanticSearch.QueryAnswer.QueryAnswerRaw); + Assert.AreEqual("extractive|highlight-True,maxcharlength-300", searchOptions.SemanticSearch.QueryCaption.QueryCaptionRaw); + Assert.AreEqual("generative|count-3", searchOptions.SemanticSearch.QueryRewrites.QueryRewritesRaw); } [Test] diff --git a/sdk/search/Azure.Search.Documents/tests/Samples/Sample01_HelloWorld.cs b/sdk/search/Azure.Search.Documents/tests/Samples/Sample01_HelloWorld.cs index 32620619003db..b3eb1337a6a13 100644 --- a/sdk/search/Azure.Search.Documents/tests/Samples/Sample01_HelloWorld.cs +++ b/sdk/search/Azure.Search.Documents/tests/Samples/Sample01_HelloWorld.cs @@ -18,7 +18,7 @@ namespace Azure.Search.Documents.Tests.Samples { - [ClientTestFixture(SearchClientOptions.ServiceVersion.V2024_09_01_Preview), ServiceVersion(Min = SearchClientOptions.ServiceVersion.V2024_09_01_Preview)] + [ClientTestFixture(SearchClientOptions.ServiceVersion.V2024_11_01_Preview), ServiceVersion(Min = SearchClientOptions.ServiceVersion.V2024_11_01_Preview)] public partial class HelloWorld : SearchTestBase { public HelloWorld(bool async, SearchClientOptions.ServiceVersion serviceVersion) diff --git a/sdk/search/Azure.Search.Documents/tests/Samples/Sample07_VectorSearch_SemanticHybridSearch.cs b/sdk/search/Azure.Search.Documents/tests/Samples/Sample07_VectorSearch_SemanticHybridSearch.cs index 58bf0b0429202..2800681ed86e8 100644 --- a/sdk/search/Azure.Search.Documents/tests/Samples/Sample07_VectorSearch_SemanticHybridSearch.cs +++ b/sdk/search/Azure.Search.Documents/tests/Samples/Sample07_VectorSearch_SemanticHybridSearch.cs @@ -13,7 +13,7 @@ namespace Azure.Search.Documents.Tests.Samples.VectorSearch { - [ClientTestFixture(SearchClientOptions.ServiceVersion.V2024_09_01_Preview), ServiceVersion(Min = SearchClientOptions.ServiceVersion.V2024_09_01_Preview)] + [ClientTestFixture(SearchClientOptions.ServiceVersion.V2024_11_01_Preview), ServiceVersion(Min = SearchClientOptions.ServiceVersion.V2024_11_01_Preview)] public partial class VectorSemanticHybridSearch : SearchTestBase { public VectorSemanticHybridSearch(bool async, SearchClientOptions.ServiceVersion serviceVersion) diff --git a/sdk/search/Azure.Search.Documents/tests/Samples/Sample08_SemanticSearch.cs b/sdk/search/Azure.Search.Documents/tests/Samples/Sample08_SemanticSearch.cs index 43fc81281ec58..10d705d862d0b 100644 --- a/sdk/search/Azure.Search.Documents/tests/Samples/Sample08_SemanticSearch.cs +++ b/sdk/search/Azure.Search.Documents/tests/Samples/Sample08_SemanticSearch.cs @@ -12,7 +12,7 @@ namespace Azure.Search.Documents.Tests.Samples { - [ClientTestFixture(SearchClientOptions.ServiceVersion.V2024_09_01_Preview), ServiceVersion(Min = SearchClientOptions.ServiceVersion.V2024_09_01_Preview)] + [ClientTestFixture(SearchClientOptions.ServiceVersion.V2024_11_01_Preview), ServiceVersion(Min = SearchClientOptions.ServiceVersion.V2024_11_01_Preview)] public partial class SemanticSearch : SearchTestBase { public SemanticSearch(bool async, SearchClientOptions.ServiceVersion serviceVersion) diff --git a/sdk/search/Azure.Search.Documents/tests/SearchIndexClientTests.cs b/sdk/search/Azure.Search.Documents/tests/SearchIndexClientTests.cs index a04164f2551e2..d354ba5cd01c7 100644 --- a/sdk/search/Azure.Search.Documents/tests/SearchIndexClientTests.cs +++ b/sdk/search/Azure.Search.Documents/tests/SearchIndexClientTests.cs @@ -15,7 +15,7 @@ namespace Azure.Search.Documents.Tests { - [ClientTestFixture(SearchClientOptions.ServiceVersion.V2024_07_01, SearchClientOptions.ServiceVersion.V2024_09_01_Preview)] + [ClientTestFixture(SearchClientOptions.ServiceVersion.V2024_07_01, SearchClientOptions.ServiceVersion.V2024_11_01_Preview)] public class SearchIndexClientTests : SearchTestBase { public SearchIndexClientTests(bool async, SearchClientOptions.ServiceVersion serviceVersion) @@ -109,7 +109,7 @@ static string GetDuplicates(IEnumerable values) } [Test] - [ServiceVersion(Min = SearchClientOptions.ServiceVersion.V2024_09_01_Preview)] + [ServiceVersion(Min = SearchClientOptions.ServiceVersion.V2024_11_01_Preview)] public async Task GetServiceStatistics() { await using SearchResources resources = await SearchResources.GetSharedHotelsIndexAsync(this); @@ -146,7 +146,7 @@ public void CreateIndexParameterValidation() } [Test] - [ServiceVersion(Min = SearchClientOptions.ServiceVersion.V2024_09_01_Preview)] + [ServiceVersion(Min = SearchClientOptions.ServiceVersion.V2024_11_01_Preview)] public async Task CreateIndex() { await using SearchResources resources = SearchResources.CreateWithNoIndexes(this); @@ -181,7 +181,7 @@ public void UpdateIndexParameterValidation() } [Test] - [ServiceVersion(Min = SearchClientOptions.ServiceVersion.V2024_09_01_Preview)] + [ServiceVersion(Min = SearchClientOptions.ServiceVersion.V2024_11_01_Preview)] public async Task UpdateIndex() { await using SearchResources resources = SearchResources.CreateWithNoIndexes(this); @@ -453,7 +453,7 @@ public async Task AnalyzeText() } [Test] - [ServiceVersion(Min = SearchClientOptions.ServiceVersion.V2024_09_01_Preview)] + [ServiceVersion(Min = SearchClientOptions.ServiceVersion.V2024_11_01_Preview)] public async Task AnalyzeTextWithNormalizer() { await using SearchResources resources = await SearchResources.GetSharedHotelsIndexAsync(this); diff --git a/sdk/search/Azure.Search.Documents/tests/SearchIndexerClientTests.cs b/sdk/search/Azure.Search.Documents/tests/SearchIndexerClientTests.cs index c3646818e9380..31e51fda9bc51 100644 --- a/sdk/search/Azure.Search.Documents/tests/SearchIndexerClientTests.cs +++ b/sdk/search/Azure.Search.Documents/tests/SearchIndexerClientTests.cs @@ -13,7 +13,7 @@ namespace Azure.Search.Documents.Tests { - [ClientTestFixture(SearchClientOptions.ServiceVersion.V2024_07_01, SearchClientOptions.ServiceVersion.V2024_09_01_Preview)] + [ClientTestFixture(SearchClientOptions.ServiceVersion.V2024_07_01, SearchClientOptions.ServiceVersion.V2024_11_01_Preview)] public class SearchIndexerClientTests : SearchTestBase { public SearchIndexerClientTests(bool async, SearchClientOptions.ServiceVersion serviceVersion) @@ -629,7 +629,7 @@ private async Task TestSkillsetAsync(SearchIndexerClient client, SearchIndexerSk } [Test] - [ServiceVersion(Min = SearchClientOptions.ServiceVersion.V2024_09_01_Preview)] + [ServiceVersion(Min = SearchClientOptions.ServiceVersion.V2024_11_01_Preview)] public async Task RoundtripAllSkills() { await using SearchResources resources = SearchResources.CreateWithNoIndexes(this); @@ -718,6 +718,7 @@ SentimentSkill CreateSentimentSkill(SentimentSkill.SkillVersion skillVersion) Type _ when t == typeof(WebApiSkill) => CreateSkill(t, new[] { "input" }, new[] { "output" }), Type _ when t == typeof(AzureMachineLearningSkill) => CreateSkill(t, new[] { "input" }, new[] { "output" }), Type _ when t == typeof(AzureOpenAIEmbeddingSkill) => CreateSkill(t, new[] { "text" }, new[] { "embedding" }), + Type _ when t == typeof(DocumentIntelligenceLayoutSkill) => CreateSkill(t, new[] { "file_data" }, new[] { "content", "normalized_images" }), Type _ when t == typeof(VisionVectorizeSkill) => TestEnvironment.AzureEnvironment != "AzureUSGovernment" ? CreateSkill(t, new[] { "image" }, new[] { "vector" }) : null, _ => throw new NotSupportedException($"{t.FullName}"),