diff options
author | mzdehbashi-github <85902780+mzdehbashi-github@users.noreply.github.com> | 2023-04-13 14:48:28 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-13 15:48:28 +0300 |
commit | db9a85cd3e60a7746854108c42026c582b6ba527 (patch) | |
tree | f880a287510a18ea4fa537cc669189eebe8712bc | |
parent | 6a4240b205d7d63e1aa4803f8430248bebac071b (diff) | |
download | redis-py-db9a85cd3e60a7746854108c42026c582b6ba527.tar.gz |
Update example of Redisearch creating index (#2703)
When creating index, fields should be passed inside an iterable (e.g. list or tuple)
-rw-r--r-- | docs/redismodules.rst | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/docs/redismodules.rst b/docs/redismodules.rst index 2b0b3c6..a133f03 100644 --- a/docs/redismodules.rst +++ b/docs/redismodules.rst @@ -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()) |