Skip to content

Commit 390a4c4

Browse files
authored
Add Debug to list of parameters copied for SearchOptions. (#52629)
1 parent ca6e724 commit 390a4c4

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

sdk/search/Azure.Search.Documents/src/Options/SearchOptions.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,7 @@ private static void Copy(SearchOptions source, SearchOptions destination)
428428
destination.Skip = source.Skip;
429429
destination.QueryLanguage = source.QueryLanguage;
430430
destination.QuerySpeller = source.QuerySpeller;
431+
destination.Debug = source.Debug;
431432
destination.SemanticSearch = source.SemanticSearch;
432433
destination.VectorSearch = source.VectorSearch;
433434
destination.HybridSearch = source.HybridSearch;

sdk/search/Azure.Search.Documents/tests/DocumentOperations/SearchTests.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1015,6 +1015,7 @@ public void SearchOptionsCanBeCopied()
10151015
source.SessionId = "SessionId";
10161016
source.Size = 100;
10171017
source.Skip = null;
1018+
source.Debug = QueryDebugMode.All;
10181019
source.SemanticSearch = new SemanticSearchOptions()
10191020
{
10201021
SemanticConfigurationName = "my-config",
@@ -1044,6 +1045,7 @@ public void SearchOptionsCanBeCopied()
10441045
Assert.AreEqual(source.SessionId, clonedSearchOptions.SessionId); // A string value
10451046
Assert.AreEqual(source.Size, clonedSearchOptions.Size); // An int? value
10461047
Assert.IsNull(clonedSearchOptions.Skip); // An int? value set as `null`
1048+
Assert.AreEqual(source.Debug, clonedSearchOptions.Debug);
10471049
Assert.AreEqual(source.SemanticSearch.SemanticConfigurationName, clonedSearchOptions.SemanticSearch.SemanticConfigurationName);
10481050
Assert.AreEqual(source.SemanticSearch.QueryAnswer.AnswerType, clonedSearchOptions.SemanticSearch.QueryAnswer.AnswerType);
10491051
Assert.AreEqual(source.SemanticSearch.QueryAnswer.Count, clonedSearchOptions.SemanticSearch.QueryAnswer.Count);

0 commit comments

Comments
 (0)