microsoft/semantic-kernel · warning · VectorStoreOperationException

No vector or keywords provided for vector search.

Error message

No vector or keywords provided for vector search.

What it means

Raised by _inner_search for SearchType.VECTOR when both the 'vector' argument and the 'values' argument are None. A pure vector search requires either a precomputed vector (Sequence[float|int]) or text 'values' that can be embedded/vectorized. With neither, there is no query to run, so a VectorStoreOperationException is thrown before contacting the service.

Source

Thrown at python/semantic_kernel/connectors/azure_ai_search.py:593

                elif values is not None:
                    generated_vector = await self._generate_vector_from_values(values or "*", options)
                    vector_field = self.definition.try_get_vector_field(options.vector_property_name)
                    if generated_vector is not None:
                        search_args["vector_queries"] = [
                            VectorizedQuery(
                                vector=generated_vector,  # type: ignore
                                fields=vector_field.storage_name or vector_field.name if vector_field else None,
                            )
                        ]
                    else:
                        search_args["vector_queries"] = [
                            VectorizableTextQuery(
                                text=values,
                                fields=vector_field.storage_name or vector_field.name if vector_field else None,
                            )
                        ]
                else:
                    raise VectorStoreOperationException("No vector or keywords provided for vector search.")
            case SearchType.KEYWORD_HYBRID:
                if values is None:
                    raise VectorStoreOperationException("No vector and/or keywords provided for search.")
                vector_field = self.definition.try_get_vector_field(options.vector_property_name)
                search_args["search_fields"] = (
                    [options.additional_property_name]
                    if options.additional_property_name is not None
                    else [
                        field.name
                        for field in self.definition.fields
                        if field.field_type == FieldTypes.DATA and field.is_full_text_indexed
                    ]
                )
                if not search_args["search_fields"]:
                    raise VectorStoreOperationException("No searchable fields found for hybrid search.")
                search_args["search_text"] = values

                vector = await self._generate_vector_from_values(values, options) if vector is None else vector

View on GitHub (pinned to c028a0c7dc)

Solutions

  1. Always provide either a precomputed vector or a non-None values (text) for vector search.
  2. If using text values, ensure an embedding_generator is configured on the collection so values can be vectorized.
  3. Guard the call: skip or error early upstream if both vector and values resolve to None.

Example fix

// before
results = await collection.search(vector=None, values=query_text)  # query_text is None

// after
if query_text:
    results = await collection.search(values=query_text)
else:
    raise ValueError("query text required for vector search")
Defensive patterns

Strategy: validation

Validate before calling

def require_vector_search_input(vector=None, values=None):
    if vector is None and values is None:
        raise ValueError("VECTOR search requires a vector or values")

require_vector_search_input(vector=vec, values=q)

Try / catch

from semantic_kernel.exceptions import VectorStoreOperationException
try:
    res = await collection.search(vector=vec, values=q)
except VectorStoreOperationException as e:
    if "No vector or keywords provided" in str(e):
        q = q or default_query
        res = await collection.search(values=q)
    raise

Prevention

When it happens

Trigger: Calling search with search_type=SearchType.VECTOR (the collection's default for vector-only) while passing neither vector nor values — e.g. search(vector=None, values=None). Also when a caller's embedding pipeline returned None and that None was forwarded as values.

Common situations: Conditionally building a query that ends up with no input; an upstream embedding service returning None on failure and that propagating into the search call; defaulting values to None when the user submitted an empty string.

Related errors


AI-assisted analysis of microsoft/semantic-kernel@c028a0c7dc (2026-08-13). Data as JSON: /api/errors/479f05ea33f8b249. Report an issue: GitHub.