[Python] Unknown Command FT.CREATE when creating an index for Redis

Discussão em 'Python' iniciado por Stack, Março 23, 2025.

  1. Stack

    Stack Membro Participativo

    I am currently following: https://redis.io/docs/clients/python/ and in the "Indexing and querying JSON documents" section, I am trying to test out the example code on my computer but I run into this error:

    redis.exceptions.ResponseError: unknown command `FT.CREATE`, with args beginning with: `idx:users`, `ON`, `JSON`, `PREFIX`, `1`, `user:`, `SCORE`, `1.0`, `SCHEMA`, `$.name`, `AS`, `name`, `TEXT`, `WEIGHT`, `1.0`, `$.`,

    which seems to be stemming from these lines of code from the guide:

    rs.create_index(
    schema,
    definition=IndexDefinition(
    prefix=["user:"], index_type=IndexType.JSON
    )
    )


    I am not too sure what's wrong and if I delete the create index lines, I get this error:

    AttributeError: type object 'Path' has no attribute 'root_path'


    Any help would be appreciated. Thanks!

    Continue reading...

Compartilhe esta Página