{"record":{"id":"aced4925499acc78","repo":"redis/redis-py","slug":"realtime-vector-indexing-supporting-3-indexing-met","errorCode":null,"errorMessage":"Realtime vector indexing supporting 3 Indexing Methods:'FLAT', 'HNSW', and 'SVS-VAMARA'.","messagePattern":"Realtime vector indexing supporting 3 Indexing Methods:'FLAT', 'HNSW', and 'SVS-VAMARA'\\.","errorType":"validation","errorClass":"DataError","httpStatus":null,"severity":"error","filePath":"redis/commands/search/field.py","lineNumber":198,"sourceCode":"        although it's also a Field.\n\n        ``name`` is the name of the field.\n\n        ``algorithm`` can be \"FLAT\", \"HNSW\", or \"SVS-VAMANA\".\n\n        ``attributes`` each algorithm can have specific attributes. Some of them\n        are mandatory and some of them are optional. See\n        https://oss.redis.com/redisearch/master/Vectors/#specific_creation_attributes_per_algorithm\n        for more information.\n        \"\"\"\n        sort = kwargs.get(\"sortable\", False)\n        noindex = kwargs.get(\"no_index\", False)\n\n        if sort or noindex:\n            raise DataError(\"Cannot set 'sortable' or 'no_index' in Vector fields.\")\n\n        if algorithm.upper() not in [\"FLAT\", \"HNSW\", \"SVS-VAMANA\"]:\n            raise DataError(\n                \"Realtime vector indexing supporting 3 Indexing Methods:\"\n                \"'FLAT', 'HNSW', and 'SVS-VAMANA'.\"\n            )\n\n        attr_li = []\n\n        for key, value in attributes.items():\n            attr_li.extend([key, value])\n\n        Field.__init__(\n            self, name, args=[Field.VECTOR, algorithm, len(attr_li), *attr_li], **kwargs\n        )\n","sourceCodeStart":180,"sourceCodeEnd":211,"githubUrl":"https://github.com/redis/redis-py/blob/6a6b581b48225afa0b76912d1028c6035baee932/redis/commands/search/field.py#L180-L211","documentation":"Raised by VectorField.__init__() (redis/commands/search/field.py:198) as a DataError when algorithm.upper() is not one of FLAT, HNSW, or SVS-VAMANA. Note the error message contains a typo: it prints 'SVS-VAMARA' (sic) but the actual accepted value is 'SVS-VAMANA' (correct spelling). Copying the typo from the message into your code will still fail.","triggerScenarios":"Constructing VectorField('vec', 'FLANN', ...), VectorField('vec', 'ivf', ...), or passing the misspelled 'SVS-VAMARA' shown in the error text. Matching is case-insensitive (.upper()).","commonSituations":"Typos in the algorithm name, using an unsupported algorithm, or - most insidiously - copying 'SVS-VAMARA' verbatim from the (buggy) error message and re-running.","solutions":["Use exactly 'FLAT', 'HNSW', or 'SVS-VAMANA' (note the correct spelling VAMANA, not VAMARA).","Do NOT trust the literal text of the error message for the SVS value - it has a typo.","Define the algorithm as a constant to avoid typos."],"exampleFix":"# before\nVectorField('vec', 'SVS-VAMARA', attrs)  # copied from error text - still wrong\n# after\nVectorField('vec', 'SVS-VAMANA', attrs)","handlingStrategy":"validation","validationCode":"VECTOR_ALGORITHMS = {'FLAT', 'HNSW', 'SVS-VAMANA'}  # note: VAMANA, not VAMARA\n\ndef safe_vector_algo(algo):\n    a = algo.upper()\n    if a not in VECTOR_ALGORITHMS:\n        raise ValueError(f'algorithm must be one of {sorted(VECTOR_ALGORITHMS)}')\n    return a","typeGuard":"def is_valid_vector_algo(a) -> bool:\n    return isinstance(a, str) and a.upper() in {'FLAT', 'HNSW', 'SVS-VAMANA'}","tryCatchPattern":"from redis.exceptions import DataError\ntry:\n    VectorField(name, algo, attrs)\nexcept DataError as e:\n    if 'Indexing Methods' in str(e):\n        VectorField(name, 'FLAT', attrs)  # safe fallback\n    else:\n        raise","preventionTips":["Use exactly 'FLAT', 'HNSW', or 'SVS-VAMANA' - case-insensitive.","Do NOT copy 'SVS-VAMARA' from the error text; it is a typo and still fails.","Define the algorithm as a module constant to avoid typos."],"tags":["search","vectorfield","dataerror","redisearch","vss","typo-in-message"],"backgroundTag":null,"analyzedSha":"6a6b581b48225afa0b76912d1028c6035baee932","analyzedAt":"2026-08-10T12:52:44.840Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-21T04:17:39.646Z"}