Skip to content
Merged
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ public ChangeFeedEstimatorFeedResponse(

public override string IndexMetrics => null;

internal override string QueryAdvice => null;
public override string QueryAdvice => null;

internal override RequestMessage RequestMessage => null;

Expand Down Expand Up @@ -435,7 +435,7 @@ public ChangeFeedEstimatorEmptyFeedResponse(ITrace trace)

public override string IndexMetrics => null;

internal override string QueryAdvice => null;
public override string QueryAdvice => null;

internal override RequestMessage RequestMessage => null;

Expand Down
2 changes: 1 addition & 1 deletion Microsoft.Azure.Cosmos/src/Query/v3Query/FeedResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ protected FeedResponse()
/// <value>
/// The query advice.
/// </value>
internal virtual string QueryAdvice => null;
public virtual string QueryAdvice => null;

/// <summary>
/// Request Message for this feed response
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ private QueryResponse(

private Lazy<string> QueryAdviceText { get; }

internal override string QueryAdvice => this.QueryAdviceText?.Value;
public override string QueryAdvice => this.QueryAdviceText?.Value;

public override IEnumerator<T> GetEnumerator()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ internal ReadFeedResponse(

public override string IndexMetrics { get; }

internal override string QueryAdvice { get; }
public override string QueryAdvice { get; }

internal override RequestMessage RequestMessage { get; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,27 @@ public class QueryRequestOptions : RequestOptions
/// The results will be displayed in <c>FeedResponse.QueryAdvice</c>. Please note that this options will incur overhead, so it should be
/// enabled only when debugging queries.
/// </para>
/// <example>
/// <code>
/// <![CDATA[
/// var queryRequestOptions = new QueryRequestOptions { PopulateQueryAdvice = true};
///
/// // View results in FeedResponse.QueryAdvice
/// while (itemQuery.HasMoreResults)
/// {
/// // query advice is the same across pages so we only need to log it once
/// if (queryAdvice != null)
/// {
/// break;
/// }
/// FeedResponse<CosmosElement> page = itemQuery.ReadNextAsync().Result;
/// queryAdvice = page.QueryAdvice;
/// }
/// ]]>
/// </code>
/// </example>
/// </remarks>
internal bool? PopulateQueryAdvice { get; set; }
public bool? PopulateQueryAdvice { get; set; }

/// <summary>
/// Gets or sets the consistency level required for the request in the Azure Cosmos DB service.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4830,10 +4830,20 @@
"Attributes": [],
"MethodInfo": "System.String get_IndexMetrics();IsAbstract:True;IsStatic:False;IsVirtual:True;IsGenericMethod:False;IsConstructor:False;IsFinal:False;"
},
"System.String get_QueryAdvice()": {
"Type": "Method",
"Attributes": [],
"MethodInfo": "System.String get_QueryAdvice();IsAbstract:False;IsStatic:False;IsVirtual:True;IsGenericMethod:False;IsConstructor:False;IsFinal:False;"
},
"System.String IndexMetrics": {
"Type": "Property",
"Attributes": [],
"MethodInfo": "System.String IndexMetrics;CanRead:True;CanWrite:False;System.String get_IndexMetrics();IsAbstract:True;IsStatic:False;IsVirtual:True;IsGenericMethod:False;IsConstructor:False;IsFinal:False;"
},
"System.String QueryAdvice": {
"Type": "Property",
"Attributes": [],
"MethodInfo": "System.String QueryAdvice;CanRead:True;CanWrite:False;System.String get_QueryAdvice();IsAbstract:False;IsStatic:False;IsVirtual:True;IsGenericMethod:False;IsConstructor:False;IsFinal:False;"
}
},
"NestedTypes": {}
Expand Down Expand Up @@ -7577,11 +7587,23 @@
],
"MethodInfo": "System.Nullable`1[System.Boolean] get_PopulateIndexMetrics();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;"
},
"System.Nullable`1[System.Boolean] get_PopulateQueryAdvice()[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": {
"Type": "Method",
"Attributes": [
"CompilerGeneratedAttribute"
],
"MethodInfo": "System.Nullable`1[System.Boolean] get_PopulateQueryAdvice();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;"
},
"System.Nullable`1[System.Boolean] PopulateIndexMetrics": {
"Type": "Property",
"Attributes": [],
"MethodInfo": "System.Nullable`1[System.Boolean] PopulateIndexMetrics;CanRead:True;CanWrite:True;System.Nullable`1[System.Boolean] get_PopulateIndexMetrics();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;Void set_PopulateIndexMetrics(System.Nullable`1[System.Boolean]);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;"
},
"System.Nullable`1[System.Boolean] PopulateQueryAdvice": {
"Type": "Property",
"Attributes": [],
"MethodInfo": "System.Nullable`1[System.Boolean] PopulateQueryAdvice;CanRead:True;CanWrite:True;System.Nullable`1[System.Boolean] get_PopulateQueryAdvice();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;Void set_PopulateQueryAdvice(System.Nullable`1[System.Boolean]);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;"
},
"System.Nullable`1[System.Int32] get_MaxBufferedItemCount()[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": {
"Type": "Method",
"Attributes": [
Expand Down Expand Up @@ -7715,6 +7737,13 @@
],
"MethodInfo": "Void set_PopulateIndexMetrics(System.Nullable`1[System.Boolean]);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;"
},
"Void set_PopulateQueryAdvice(System.Nullable`1[System.Boolean])[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": {
"Type": "Method",
"Attributes": [
"CompilerGeneratedAttribute"
],
"MethodInfo": "Void set_PopulateQueryAdvice(System.Nullable`1[System.Boolean]);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;"
},
"Void set_QueryTextMode(Microsoft.Azure.Cosmos.QueryTextMode)[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": {
"Type": "Method",
"Attributes": [
Expand Down Expand Up @@ -8768,11 +8797,23 @@
],
"MethodInfo": "System.Nullable`1[System.Boolean] get_PopulateIndexMetrics();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;"
},
"System.Nullable`1[System.Boolean] get_PopulateQueryAdvice()[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": {
"Type": "Method",
"Attributes": [
"CompilerGeneratedAttribute"
],
"MethodInfo": "System.Nullable`1[System.Boolean] get_PopulateQueryAdvice();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;"
},
"System.Nullable`1[System.Boolean] PopulateIndexMetrics": {
"Type": "Property",
"Attributes": [],
"MethodInfo": "System.Nullable`1[System.Boolean] PopulateIndexMetrics;CanRead:True;CanWrite:True;System.Nullable`1[System.Boolean] get_PopulateIndexMetrics();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;Void set_PopulateIndexMetrics(System.Nullable`1[System.Boolean]);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;"
},
"System.Nullable`1[System.Boolean] PopulateQueryAdvice": {
"Type": "Property",
"Attributes": [],
"MethodInfo": "System.Nullable`1[System.Boolean] PopulateQueryAdvice;CanRead:True;CanWrite:True;System.Nullable`1[System.Boolean] get_PopulateQueryAdvice();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;Void set_PopulateQueryAdvice(System.Nullable`1[System.Boolean]);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;"
},
"System.Nullable`1[System.Int32] get_MaxBufferedItemCount()[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": {
"Type": "Method",
"Attributes": [
Expand Down Expand Up @@ -8906,6 +8947,13 @@
],
"MethodInfo": "Void set_PopulateIndexMetrics(System.Nullable`1[System.Boolean]);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;"
},
"Void set_PopulateQueryAdvice(System.Nullable`1[System.Boolean])[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": {
"Type": "Method",
"Attributes": [
"CompilerGeneratedAttribute"
],
"MethodInfo": "Void set_PopulateQueryAdvice(System.Nullable`1[System.Boolean]);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;"
},
"Void set_QueryTextMode(Microsoft.Azure.Cosmos.QueryTextMode)[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": {
"Type": "Method",
"Attributes": [
Expand Down
Loading