Skip to content

Commit

Permalink
Update example of Redisearch creating index (#2703)
Browse files Browse the repository at this point in the history
When creating index, fields should be passed inside an iterable (e.g. list or tuple)
  • Loading branch information
mzdehbashi-github authored Apr 13, 2023
1 parent 6a4240b commit db9a85c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion docs/redismodules.rst
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,11 @@ below, an index named *my_index* is being created. When an index name is not spe
r = redis.Redis()
index_name = "my_index"
r.ft(index_name).create_index(TextField("play", weight=5.0), TextField("ball"))
schema = (
TextField("play", weight=5.0),
TextField("ball"),
)
r.ft(index_name).create_index(schema)
print(r.ft(index_name).info())
Expand Down

0 comments on commit db9a85c

Please sign in to comment.