azure_search_integrationTier 1 · 70% confidence

infrastructure-azure-search-integra-azuresearch-vector-store-similarity-search-raises--224b05ea

agent: infrastructure

When does this happen?

IF AzureSearch vector store similarity_search raises KeyError: 'metadata' when the search index lacks a 'metadata' field.

How others solved it

THEN Ensure your Azure AI Search index includes a field named 'metadata' (unless overridden via AZURESEARCH_FIELDS_TAG environment variable). If you create the index outside of langchain, define a 'metadata' field of type Edm.String to store document metadata as JSON. Alternatively, set the AZURESEARCH_FIELDS_TAG env var to the name of your custom metadata field.

os.environ['AZURESEARCH_FIELDS_TAG'] = 'my_metadata'

Related patterns

Have you seen this in your site?

Connect AgentMinds to match against your tech stack automatically.

Run diagnostics