Repository navigation
Python: Use storage_name for hybrid search fields and vector queries (#14684) - #14688
Open
Abhinav Maurya (Fire162) wants to merge 2 commits into
Open
Abhinav Maurya (Fire162) wants to merge 2 commits into
Abhinav Maurya (Fire162) wants to merge 2 commits into
Conversation
Abhinav Maurya (Fire162)
deployed
to
github-app-auth
October 29, 2026 19:48 — with
GitHub Actions
Active
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The combined name/alias lookup allows an earlier storage alias to shadow a declared property, making resolution order-dependent and potentially emitting the wrong storage name.
1 open issue
What changed in this PR
This PR addresses #14684 by aligning Azure AI Search hybrid requests with storage-name aliases used by index creation and vector-only search.
Changes:
- Use storage names for hybrid text-search fields and vector queries.
- Resolve custom
additional_property_namevalues against configured fields. - Add regression coverage for default fields, declared property names, and direct storage-name inputs.
| File | Description |
|---|---|
python/tests/unit/connectors/memory/test_azure_ai_search.py |
Adds hybrid-search tests for aliased text and vector fields. |
python/semantic_kernel/connectors/azure_ai_search.py |
Applies storage-name resolution to hybrid search requests. |
Review effort: Balanced
Comment on lines
+603
to
+604
| if field.name == options.additional_property_name | ||
| or field.storage_name == options.additional_property_name |
Abhinav Maurya (Fire162)
deployed
to
github-app-auth
October 29, 2026 21:13 — with
GitHub Actions
Active
This branch was successfully deployed
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.

Motivation and Context
Fixes #14684.
When fields declare a
storage_namealias,ensure_collection_existscreates index fields with their storage names, andsearch(SearchType.VECTOR)queries them viastorage_name or name. However,hybrid_search()emitted declared property names (field.name), causing Azure AI Search to reject hybrid queries referencing unindexed field names (400 unknown field).Description
AzureAISearchCollectionin theSearchType.KEYWORD_HYBRIDbranch to usefield.storage_name or field.nameforsearch_fieldsandvector_field.storage_name or vector_field.namefor vector queries, aligning with the index schema and the vector search branch.options.additional_property_nameto its storage name alias when it matches a configured field.tests/unit/connectors/memory/test_azure_ai_search.pyverifying storage names are emitted for both default and customsearch_fieldsand vector queries in hybrid search.Contribution Checklist