{"record":{"id":"685a8baea54c18af","repo":"microsoft/semantic-kernel","slug":"vector-field-options-vector-property-name-not-685a8b","errorCode":null,"errorMessage":"Vector field '{options.vector_property_name}' not found in the data model definition.","messagePattern":"Vector field '(.+?)' not found in the data model definition\\.","errorType":"exception","errorClass":"VectorStoreModelException","httpStatus":null,"severity":"error","filePath":"python/semantic_kernel/connectors/faiss.py","lineNumber":220,"sourceCode":"    @override\n    async def collection_exists(self, **kwargs: Any) -> bool:\n        return bool(self.indexes)\n\n    @override\n    async def _inner_search(\n        self,\n        search_type: SearchType,\n        options: VectorSearchOptions,\n        values: Any | None = None,\n        vector: Sequence[float | int] | None = None,\n        **kwargs: Any,\n    ) -> KernelSearchResults[VectorSearchResult[TModel]]:\n        \"\"\"Inner search method.\"\"\"\n        if not vector:\n            vector = await self._generate_vector_from_values(values, options)\n        field = self.definition.try_get_vector_field(options.vector_property_name)\n        if not field:\n            raise VectorStoreModelException(\n                f\"Vector field '{options.vector_property_name}' not found in the data model definition.\"\n            )\n        return_list = []\n        # first we create the vector to search with\n        np_vector = np.array(vector, dtype=np.float32).reshape(1, -1)\n        # then do the actual vector search\n        distances, indexes = self.indexes[field.name].search(\n            np_vector, min(options.top, self.indexes[field.name].ntotal)\n        )  # type: ignore[call-arg]\n        # since Faiss indexes do not contain the full records,\n        # we get the filtered records, this is a dict of the records that match the search filters\n        # and use that to get the actual records\n        filtered_records = self._get_filtered_records(options)\n        # we then iterate through the results, the order is the order of relevance\n        # (less or most distance, dependant on distance metric used)\n        for i, index in enumerate(indexes[0]):\n            key = list(self.indexes_key_map[field.name].keys())[index]\n            # if the key is not in the filtered records, we ignore it","sourceCodeStart":202,"sourceCodeEnd":238,"githubUrl":"https://github.com/microsoft/semantic-kernel/blob/c028a0c7dc4f0814cdcbaba9d998f187a41197bf/python/semantic_kernel/connectors/faiss.py#L202-L238","documentation":"During _inner_search the connector resolves the vector field to search against via definition.try_get_vector_field(options.vector_property_name). If no VectorStoreField in the data model definition matches that name, it returns None and the connector raises VectorStoreModelException. The message names the offending vector_property_name so you can see exactly which string failed to resolve.","triggerScenarios":"Calling collection.search / _inner_search with VectorSearchOptions(vector_property_name='foo') where 'foo' is not the .name of any VectorStoreField in the collection definition. Also fires when the default vector_property_name does not match the only/multiple vector fields, or when you used the field's storage_name instead of its name.","commonSituations":"Typo in the field name; the field was renamed in the data model but not in search calls; multiple vector fields and the wrong one selected; confusing storage_name with name; switching record types on a shared collection.","solutions":["Set options.vector_property_name to the exact .name of a VectorStoreField declared in the definition.","If the collection has exactly one vector field, omit vector_property_name so the default resolution picks it.","Inspect [f.name for f in collection.definition.vector_fields] to list the valid vector field names before searching."],"exampleFix":"# before\nres = await collection.search(vector=[...], options=VectorSearchOptions(vector_property_name='embedding', top=5))\n# 'embedding' is not a declared vector field -> [1301]\n\n# after\nvalid = [f.name for f in collection.definition.vector_fields]\nres = await collection.search(vector=[...], options=VectorSearchOptions(vector_property_name='text_vector', top=5))","handlingStrategy":"validation","validationCode":"def resolve_vector_field(collection, name):\n    names = {f.name for f in collection.definition.vector_fields}\n    if name is None and len(names) == 1:\n        return next(iter(names))\n    if name not in names:\n        raise ValueError(f\"vector_property_name must be one of {sorted(names)}, got {name!r}\")\n    return name","typeGuard":"def is_known_vector_field(collection, name: str | None) -> bool:\n    names = {f.name for f in collection.definition.vector_fields}\n    return name is None or name in names","tryCatchPattern":"from semantic_kernel.exceptions.vector_store_exceptions import VectorStoreModelException\ntry:\n    await collection.search(vector=[...], options=opts)\nexcept VectorStoreModelException as ex:\n    if 'not found in the data model' in str(ex):\n        opts.vector_property_name = next(iter({f.name for f in collection.definition.vector_fields}))\n        await collection.search(vector=[...], options=opts)\n    else:\n        raise","preventionTips":["Derive vector_property_name from the definition rather than hard-coding strings.","Keep field names in a single constant/module so renames propagate.","For single-vector collections, omit vector_property_name to use the default."],"tags":["vector-store","data-model","search","faiss"],"backgroundTag":null,"analyzedSha":"c028a0c7dc4f0814cdcbaba9d998f187a41197bf","analyzedAt":"2026-08-13T13:48:05.040Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}