redis/redis-py · error · DataError

Realtime vector indexing supporting 3 Indexing…

Error message

Realtime vector indexing supporting 3 Indexing Methods:'FLAT', 'HNSW', and 'SVS-VAMARA'.

What it means

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.

Solutions

  1. Use exactly 'FLAT', 'HNSW', or 'SVS-VAMANA' (note the correct spelling VAMANA, not VAMARA).
  2. Do NOT trust the literal text of the error message for the SVS value - it has a typo.
  3. Define the algorithm as a constant to avoid typos.

Example fix

# before
VectorField('vec', 'SVS-VAMARA', attrs)  # copied from error text - still wrong
# after
VectorField('vec', 'SVS-VAMANA', attrs)
Defensive patterns

Strategy: validation

Validate before calling

VECTOR_ALGORITHMS = {'FLAT', 'HNSW', 'SVS-VAMANA'}  # note: VAMANA, not VAMARA

def safe_vector_algo(algo):
    a = algo.upper()
    if a not in VECTOR_ALGORITHMS:
        raise ValueError(f'algorithm must be one of {sorted(VECTOR_ALGORITHMS)}')
    return a

Type guard

def is_valid_vector_algo(a) -> bool:
    return isinstance(a, str) and a.upper() in {'FLAT', 'HNSW', 'SVS-VAMANA'}

Try / catch

from redis.exceptions import DataError
try:
    VectorField(name, algo, attrs)
except DataError as e:
    if 'Indexing Methods' in str(e):
        VectorField(name, 'FLAT', attrs)  # safe fallback
    else:
        raise

Prevention

When it happens

Trigger: Constructing VectorField('vec', 'FLANN', ...), VectorField('vec', 'ivf', ...), or passing the misspelled 'SVS-VAMARA' shown in the error text. Matching is case-insensitive (.upper()).

Common situations: Typos in the algorithm name, using an unsupported algorithm, or - most insidiously - copying 'SVS-VAMARA' verbatim from the (buggy) error message and re-running.

Related errors


AI-assisted analysis of redis/redis-py@6a6b581b48 (2026-08-10). Data as JSON: /api/errors/aced4925499acc78. Report an issue: GitHub.

Appendix: source

Thrown at redis/commands/search/field.py:198

        although it's also a Field.

        ``name`` is the name of the field.

        ``algorithm`` can be "FLAT", "HNSW", or "SVS-VAMANA".

        ``attributes`` each algorithm can have specific attributes. Some of them
        are mandatory and some of them are optional. See
        https://oss.redis.com/redisearch/master/Vectors/#specific_creation_attributes_per_algorithm
        for more information.
        """
        sort = kwargs.get("sortable", False)
        noindex = kwargs.get("no_index", False)

        if sort or noindex:
            raise DataError("Cannot set 'sortable' or 'no_index' in Vector fields.")

        if algorithm.upper() not in ["FLAT", "HNSW", "SVS-VAMANA"]:
            raise DataError(
                "Realtime vector indexing supporting 3 Indexing Methods:"
                "'FLAT', 'HNSW', and 'SVS-VAMANA'."
            )

        attr_li = []

        for key, value in attributes.items():
            attr_li.extend([key, value])

        Field.__init__(
            self, name, args=[Field.VECTOR, algorithm, len(attr_li), *attr_li], **kwargs
        )

View on GitHub (pinned to 6a6b581b48)