Skip to content

Cosmos: Disable full-text and vector indexes on complex collection wildcard paths in tests#38578

Open
AndriySvyryd with Copilot wants to merge 4 commits into
mainfrom
copilot/fix-cosmos-db-tests
Open

Cosmos: Disable full-text and vector indexes on complex collection wildcard paths in tests#38578
AndriySvyryd with Copilot wants to merge 4 commits into
mainfrom
copilot/fix-cosmos-db-tests

Conversation

Copilot AI commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Azure Cosmos DB does not support full-text or vector indexing policies with [] wildcard path segments (e.g., /ComplexNestedCollection/[]/NestedSingles), causing BadRequest (400) on container creation when running against a real Cosmos DB instance.

Changes

  • VectorSearchTranslationsCosmosTest: Comment out IsVectorProperty + IsVectorIndex configuration on ComplexNestedCollection; replace the emulator-conditional block with an unconditional b.Ignore(x => x.ComplexNestedCollection). Comment out Vector_index_through_complex_collection_roundtrips test which depended on that index.
  • FullTextSearchTranslationsCosmosTest: Comment out EnableFullTextSearch + IsFullTextIndex configuration on ComplexNestedCollection; add b.Ignore(x => x.ComplexNestedCollection).

Both sites reference issue #35898 (proper support for wildcard-path indexes) for future re-enablement.

// issue #35898: vector indexes on collection wildcard paths are not supported
//b.ComplexCollection(x => x.ComplexNestedCollection, cb => cb.Property(c => c.NestedSingles).IsVectorProperty(DistanceFunction.Cosine, 10));
//b.HasIndex(x => x.ComplexNestedCollection.Select(c => c.NestedSingles)).IsVectorIndex(VectorIndexType.Flat);
b.Ignore(x => x.ComplexNestedCollection);

…d paths from tests

Full-text and vector indexes on complex collection type properties translate to
paths with [] wildcard expressions (e.g., /ComplexNestedCollection/[]/NestedSingles)
which are not supported by Azure Cosmos DB.

- Comment out vector index config on ComplexNestedCollection in VectorSearchFixture
- Comment out the Vector_index_through_complex_collection_roundtrips test
- Comment out full-text index config on ComplexNestedCollection in FullTextSearchFixture
- Add b.Ignore() for ComplexNestedCollection in both fixtures

Both sets of commented-out code reference issue #35898 for future tracking.

Closes #38557

Co-authored-by: AndriySvyryd <6539701+AndriySvyryd@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix failing test on real cosmos db for collection wildcard paths Cosmos: Disable full-text and vector indexes on complex collection wildcard paths in tests Jul 8, 2026
Copilot AI requested a review from AndriySvyryd July 8, 2026 17:14
…comments

- Uncomment Vector_index_through_complex_collection_roundtrips method body; keep only [ConditionalFact] attribute commented
- Include emulator check in the commented-out fixture code for VectorSearchFixture
- Comment out [Fact] attribute and Full_text_index_through_complex_collection_roundtrips method in FullTextSearchTranslationsCosmosTest

Co-authored-by: AndriySvyryd <6539701+AndriySvyryd@users.noreply.github.com>
…d body

Co-authored-by: AndriySvyryd <6539701+AndriySvyryd@users.noreply.github.com>
Copilot AI requested a review from AndriySvyryd July 8, 2026 20:37

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates Cosmos functional tests to avoid creating full-text and vector indexing policies on complex collection wildcard paths (e.g. /ComplexNestedCollection/[]/...), which Azure Cosmos DB currently rejects with BadRequest (400) when running against a real instance (tracked by issue #35898).

Changes:

  • Disables the vector index configuration on ComplexNestedCollection in VectorSearchTranslationsCosmosTest and ignores that property in the model.
  • Disables the full-text index configuration on ComplexNestedCollection in FullTextSearchTranslationsCosmosTest and ignores that property in the model.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
test/EFCore.Cosmos.FunctionalTests/Query/Translations/VectorSearchTranslationsCosmosTest.cs Stops configuring vector indexing on a complex collection wildcard path; ignores ComplexNestedCollection to avoid container creation failure.
test/EFCore.Cosmos.FunctionalTests/Query/Translations/FullTextSearchTranslationsCosmosTest.cs Stops configuring full-text indexing on a complex collection wildcard path; ignores ComplexNestedCollection to avoid container creation failure.

@AndriySvyryd AndriySvyryd marked this pull request as ready for review July 8, 2026 21:00
@AndriySvyryd AndriySvyryd requested a review from a team as a code owner July 8, 2026 21:00
@AndriySvyryd AndriySvyryd enabled auto-merge (squash) July 8, 2026 21:01

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

Comment on lines +235 to 237
// issue #35898: vector indexes on collection wildcard paths are not supported
//[ConditionalFact(typeof(CosmosTestEnvironment), nameof(CosmosTestEnvironment.IsNotEmulator))]
public virtual async Task Vector_index_through_complex_collection_roundtrips()
Comment on lines +488 to 490
// issue #35898: full-text indexes on collection wildcard paths are not supported
//[Fact]
public virtual async Task Full_text_index_through_complex_collection_roundtrips()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cosmos: Failing test on real cosmos db: full-text and vector indexes on collection wildcard paths are not allowed

3 participants