microsoft/semantic-kernel · error · VectorStoreOperationException
{field.index_kind} not supported in Azure AI Search.
Error message
{field.index_kind} not supported in Azure AI Search. What it means
Raised in _definition_to_azure_ai_search_index when a VECTOR field's index_kind is not a key in INDEX_ALGORITHM_MAP. Azure AI Search only supports HNSW, FLAT (exhaustive KNN), and DEFAULT (alias for HNSW). Other index kinds defined by the IndexKind enum (IVF_FLAT, DISK_ANN, QUANTIZED_FLAT, DYNAMIC) are valid for other stores but not for Azure AI Search, so index creation fails with a VectorStoreOperationException.
Source
Thrown at python/semantic_kernel/connectors/azure_ai_search.py:261
sortable=not type_.startswith("Collection") or type_ == "Edm.ComplexType",
hidden=False,
)
)
elif field.field_type == FieldTypes.KEY:
fields.append(
SimpleField(
name=field.storage_name or field.name,
type="Edm.String", # hardcoded, only allowed type for key
key=True,
filterable=True,
searchable=True,
)
)
elif field.field_type == FieldTypes.VECTOR:
if not field.type_:
logger.debug(f"Field {field.name} has not specified type, defaulting to Collection(Edm.Single).")
if field.index_kind not in INDEX_ALGORITHM_MAP:
raise VectorStoreOperationException(f"{field.index_kind} not supported in Azure AI Search.")
if field.distance_function not in DISTANCE_FUNCTION_MAP:
raise VectorStoreOperationException(f"{field.distance_function} not supported in Azure AI Search.")
profile_name = f"{field.storage_name or field.name}_profile"
algo_name = f"{field.storage_name or field.name}_algorithm"
fields.append(
SearchField(
name=field.storage_name or field.name,
type=TYPE_MAP_VECTOR[field.type_ or "default"],
searchable=True,
vector_search_dimensions=field.dimensions,
vector_search_profile_name=profile_name,
hidden=False,
)
)
search_profiles.append(
VectorSearchProfile(
name=profile_name,View on GitHub (pinned to c028a0c7dc)
Solutions
- Set the vector field's index_kind to IndexKind.HNSW (recommended for most workloads), IndexKind.FLAT, or IndexKind.DEFAULT.
- If you need disk-based or quantized indexes, use Azure Cosmos DB NoSQL or MongoDB Atlas instead of Azure AI Search.
- Validate all vector fields in the definition against INDEX_ALGORITHM_MAP before calling ensure_collection_exists().
Example fix
// before field(type_='float', name='embedding', index_kind=IndexKind.DISK_ANN) // after field(type_='float', name='embedding', index_kind=IndexKind.HNSW)
Defensive patterns
Strategy: validation
Validate before calling
from semantic_kernel.connectors.azure_ai_search import INDEX_ALGORITHM_MAP
def validate_vector_index_kinds(definition) -> list[str]:
bad = []
for f in definition.fields:
if f.field_type.value == "vector" and f.index_kind not in INDEX_ALGORITHM_MAP:
bad.append(f"{f.name}: {f.index_kind}")
return bad
assert not validate_vector_index_kinds(definition) Try / catch
from semantic_kernel.exceptions import VectorStoreOperationException
try:
await collection.ensure_collection_exists()
except VectorStoreOperationException as e:
if "not supported in Azure AI Search" in str(e) and "index" in str(e).lower():
# change index_kind to HNSW/FLAT/DEFAULT
...
raise Prevention
- Default vector fields to IndexKind.HNSW unless you need exact (FLAT) search.
- When porting a definition between stores, re-map index_kind per store — each has its own MAP.
- Validate the definition against INDEX_ALGORITHM_MAP in a test.
When it happens
Trigger: Calling ensure_collection_exists() on a collection whose definition sets a vector field's index_kind to IndexKind.IVF_FLAT, IndexKind.DISK_ANN, IndexKind.QUANTIZED_FLAT, or IndexKind.DYNAMIC. Occurs at index-build time during collection creation.
Common situations: Porting a model definition from Azure Cosmos DB NoSQL or MongoDB Atlas (which accept disk_ann / quantized_flat / ivf_flat) to Azure AI Search without changing index_kind; copy-pasting a definition from a cross-store tutorial.
Related errors
- {field.distance_function} not supported in Azure AI Search.
- {field.type_} not supported in Azure AI Search.
- No searchable fields found for hybrid search.
- Index kind '{field.index_kind}' is not supported by Azure Co
- Field '{top_level}' not in data model (storage property name
AI-assisted analysis of microsoft/semantic-kernel@c028a0c7dc (2026-08-13).
Data as JSON: /api/errors/1256d975388ef10a.
Report an issue: GitHub.