Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix missing HybridSearch in copy method of SearchOptions #46425

Merged
merged 2 commits into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,7 @@ private static void Copy(SearchOptions source, SearchOptions destination)
destination.QuerySpeller = source.QuerySpeller;
destination.SemanticSearch = source.SemanticSearch;
destination.VectorSearch = source.VectorSearch;
destination.HybridSearch = source.HybridSearch;
ShivangiReja marked this conversation as resolved.
Show resolved Hide resolved
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1028,6 +1028,11 @@ public void SearchOptionsCanBeCopied()
Queries = { new VectorizedQuery(VectorSearchEmbeddings.SearchVectorizeDescription) { KNearestNeighborsCount = 3, Fields = { "DescriptionVector", "CategoryVector" } } },
FilterMode = VectorFilterMode.PostFilter
};
source.HybridSearch = new HybridSearch()
{
MaxTextRecallSize = 50,
CountAndFacetMode = HybridCountAndFacetMode.CountRetrievableResults
};
SearchOptions clonedSearchOptions = source.Clone();

CollectionAssert.AreEquivalent(source.Facets, clonedSearchOptions.Facets); // A non-null collection with multiple items
Expand All @@ -1048,6 +1053,8 @@ public void SearchOptionsCanBeCopied()
Assert.AreEqual(source.SemanticSearch.MaxWait, clonedSearchOptions.SemanticSearch.MaxWait);
Assert.AreEqual(source.VectorSearch.Queries, clonedSearchOptions.VectorSearch.Queries);
Assert.AreEqual(source.VectorSearch.FilterMode, clonedSearchOptions.VectorSearch.FilterMode);
Assert.AreEqual(source.HybridSearch.MaxTextRecallSize, clonedSearchOptions.HybridSearch.MaxTextRecallSize);
Assert.AreEqual(source.HybridSearch.CountAndFacetMode, clonedSearchOptions.HybridSearch.CountAndFacetMode);
}

/* TODO: Enable these Track 1 tests when we have support for index creation
Expand Down