Skip to content

Can't create an index with a single field #147

@clmnin

Description

@clmnin
definition = redisearch.IndexDefinition(
    prefix=['user:'], index_type=redisearch.client.IndexType.JSON)

SCHEMA = (
    redisearch.TextField("$.phone", as_name="phone")
)
rc = redisearch.Client("idx:user")

try:
    rc.info()
except redis.ResponseError:
    # Index does not exist. We need to create it!
    rc.create_index(SCHEMA, definition=definition)

Give this error

TypeError: 'TextField' object is not iterable

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions