mirror of
https://github.com/microsoft/semantic-kernel.git
synced 2026-04-21 02:42:30 +00:00
Updates the SQL Server vector store connector to support the latest Azure SQL VECTOR_SEARCH() features, matching what was done in EF Core (dotnet/efcore#38075). ## Changes ### VECTOR_SEARCH syntax update - Replace deprecated `TOP_N` parameter with `SELECT TOP(N) WITH APPROXIMATE` - Enable iterative WHERE predicates are now applied during the vector search process, not after retrievalfiltering - Support `skip` via subquery wrapping (`TOP` and `OFFSET/FETCH` cannot coexist in the same SELECT) ### Hybrid search - Same VECTOR_SEARCH syntax changes in the semantic search CTE - Filter support added in the vector search CTE (iterative filtering) ### Azure SQL runtime detection - DiskAnn vector indexes and VECTOR_SEARCH require Azure SQL Database or SQL database in Microsoft Fabric - Added runtime check via `SERVERPROPERTY('EngineEdition')` at table creation and query time - Throws informative `NotSupportedException` when used against on-prem SQL Server - Result is cached per collection instance ### Test infrastructure - Deleted `SqlServerDiskAnnVectorSearchTests.cs` (read-only table workaround no longer tables with latest vector indexes now support full DML)needed - Created `SqlServerConnectionStringRequiredAttribute` to gate DiskAnn tests on Azure SQL connection string availability - Rewrote DiskAnn conformance test to handle 100-row minimum requirement for vector index creation - Updated all command builder unit tests for new SQL syntax ### Kept - `PREVIEW_FEATURES` command in `CreateTable` (needed for future on-prem SQL Server support) --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
7.9 KiB
7.9 KiB