Skip to content

Guard hybrid search against IncludeVectors with embedding generation - #67

Merged
adamsitnik merged 1 commit into
CommunityToolkit:mainfrom
adamsitnik:fix-hybrid-search-include-vectors-guard
Oct 12, 2026
Merged

adamsitnik merged 1 commit into
CommunityToolkit:mainfrom
adamsitnik:fix-hybrid-search-include-vectors-guard

Conversation

@adamsitnik

Copy link
Copy Markdown
Contributor

Follow-up to #66. SearchAsync/HybridSearchAsync must throw NotSupportedException when IncludeVectors = true and an embedding generator is configured (vectors can't be returned for generated embeddings). Several providers were missing this guard.

Fixes

  • Qdrant: HybridSearchAsync
  • Weaviate: HybridSearchAsync
  • Azure AI Search: SearchAsync and HybridSearchAsync (previously SearchAsync failed with a NullReferenceException)
  • Provider versions bumped to 1.0.1

Tests

  • Unit tests per provider covering the guard (they fail without the fix).

Audit of the other providers: Chroma, PgVector, SqlServer already have the guard; Redis resolves generators before validating.

Qdrant, Weaviate and Azure AI Search hybrid search (and Azure AI Search
vector search) lacked the check that SearchAsync performs in other providers.
Generated vectors can't be mapped back onto the source property, so throw
NotSupportedException instead of failing during deserialization. Bump the
affected provider versions to 1.0.1 and add unit tests.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: a00fadae-dd58-4131-8f39-3e1a3b6bc005

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The guards are consistent with existing providers, adequately tested, and accompanied by required version updates.

0 open findings

What changed in this PR

Adds consistent IncludeVectors guards when embedding generation is configured.

Changes:

  • Guards search and hybrid search across three providers.
  • Adds provider-specific regression tests.
  • Bumps affected packages to 1.0.1.
File Description
MEVD/​src/​AzureAISearch/​AzureAISearchCollection.cs Adds search guards.
MEVD/​src/​AzureAISearch/​AzureAISearch.csproj Bumps version to 1.0.1.
MEVD/​src/​Qdrant/​QdrantCollection.cs Adds hybrid-search guard.
MEVD/​src/​Qdrant/​Qdrant.csproj Bumps version to 1.0.1.
MEVD/​src/​Weaviate/​WeaviateCollection.cs Adds hybrid-search guard.
MEVD/​src/​Weaviate/​Weaviate.csproj Bumps version to 1.0.1.
MEVD/​test/​AzureAISearch.UnitTests/​AzureAISearchHybridSearchEmbeddingGenerationTests.cs Tests both guarded search paths.
MEVD/​test/​AzureAISearch.UnitTests/​AzureAISearch.UnitTests.csproj Links shared embedding generator.
MEVD/​test/​Qdrant.UnitTests/​QdrantHybridSearchEmbeddingGenerationTests.cs Tests both guarded search paths.
MEVD/​test/​Qdrant.UnitTests/​Qdrant.UnitTests.csproj Links shared embedding generator.
MEVD/​test/​Weaviate.UnitTests/​WeaviateHybridSearchEmbeddingGenerationTests.cs Tests both guarded search paths.
MEVD/​test/​Weaviate.UnitTests/​Weaviate.UnitTests.csproj Links shared embedding generator.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@adamsitnik
adamsitnik merged commit f393fbc into CommunityToolkit:main Oct 12, 2026
17 checks passed
@adamsitnik
adamsitnik deleted the fix-hybrid-search-include-vectors-guard branch October 12, 2026 14:44
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.

2 participants