Validate unsupported options on full-text and vector indexes#38447
Open
Copilot wants to merge 3 commits into
Open
Validate unsupported options on full-text and vector indexes#38447Copilot wants to merge 3 commits into
Copilot wants to merge 3 commits into
Conversation
Co-authored-by: AndriySvyryd <6539701+AndriySvyryd@users.noreply.github.com>
Co-authored-by: AndriySvyryd <6539701+AndriySvyryd@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Review changes for 11.0 API release
Validate unsupported options on full-text and vector indexes
Jun 17, 2026
There was a problem hiding this comment.
Pull request overview
This PR adds SQL Server model validation to ensure that index options which are not supported for full-text and vector indexes cannot be configured via the Metadata API (where they were previously silently ignored). When such an option is detected, validation now fails fast with a clear provider-specific error message.
Changes:
- Added a shared
ValidateUnsupportedIndexOptionshelper inSqlServerModelValidator, invoked for both full-text and vector index validation. - Introduced new SQL Server resource strings (
FullTextIndexUnsupportedOption,VectorIndexUnsupportedOption) and corresponding designer accessors. - Added tests asserting failures for representative unsupported options on full-text (
IsUnique) and vector (DataCompression) indexes.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| test/EFCore.SqlServer.Tests/Infrastructure/SqlServerModelValidatorTest.cs | Adds validation tests for unsupported options on full-text and vector indexes. |
| src/EFCore.SqlServer/Properties/SqlServerStrings.resx | Adds new localized error message templates for unsupported options. |
| src/EFCore.SqlServer/Properties/SqlServerStrings.Designer.cs | Adds strongly-typed accessors for the new resource strings. |
| src/EFCore.SqlServer/Infrastructure/Internal/SqlServerModelValidator.cs | Implements and wires up unsupported-option validation for full-text and vector indexes. |
Files not reviewed (1)
- src/EFCore.SqlServer/Properties/SqlServerStrings.Designer.cs: Generated file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #37993
Index options that have no equivalent on the full-text/vector Fluent API (e.g.
IsUnique,Filter,IsClustered,DataCompression) could still be set through the Metadata API, where they were silently ignored. This adds model validation so such configuration fails fast.Changes
SqlServerModelValidator: addedValidateUnsupportedIndexOptions, invoked from bothValidateFullTextIndexandValidateVectorIndex. It throws on the first configured option not supported by the corresponding builder API:IsUnique,IsDescendingFilterIsClustered,IncludeProperties,FillFactor,IsCreatedOnline,SortInTempDb,DataCompressionFullTextIndexUnsupportedOption/VectorIndexUnsupportedOptionadded toSqlServerStrings.IsUnique) and vector (DataCompression) cases.Example