Skip to content

Commit 0d28291

Browse files
authored
Updating the readme and lib version to contain the changes from the latest stable release (#3644)
1 parent e9f22dd commit 0d28291

File tree

3 files changed

+50
-9
lines changed

3 files changed

+50
-9
lines changed

README.md

Lines changed: 46 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,17 @@ The Python interface to the Redis key-value store.
3131

3232
## Installation
3333

34-
Start a redis via docker:
34+
Start a redis via docker (for Redis versions >= 8.0):
3535

3636
``` bash
37-
docker run -p 6379:6379 -it redis/redis-stack:latest
37+
docker run -p 6379:6379 -it redis:latest
3838
```
3939

40+
Start a redis via docker (for Redis versions < 8.0):
41+
42+
``` bash
43+
docker run -p 6379:6379 -it redis/redis-stack:latest
44+
4045
To install redis-py, simply:
4146

4247
``` bash
@@ -54,15 +59,16 @@ Looking for a high-level library to handle object mapping? See [redis-om-python]
5459

5560
## Supported Redis Versions
5661

57-
The most recent version of this library supports redis version [5.0](https://github.com/redis/redis/blob/5.0/00-RELEASENOTES), [6.0](https://github.com/redis/redis/blob/6.0/00-RELEASENOTES), [6.2](https://github.com/redis/redis/blob/6.2/00-RELEASENOTES), [7.0](https://github.com/redis/redis/blob/7.0/00-RELEASENOTES), [7.2](https://github.com/redis/redis/blob/7.2/00-RELEASENOTES) and [7.4](https://github.com/redis/redis/blob/7.4/00-RELEASENOTES).
62+
The most recent version of this library supports Redis version [7.2](https://github.com/redis/redis/blob/7.2/00-RELEASENOTES), [7.4](https://github.com/redis/redis/blob/7.4/00-RELEASENOTES) and [8.0](https://github.com/redis/redis/blob/8.0/00-RELEASENOTES).
5863

5964
The table below highlights version compatibility of the most-recent library versions and redis versions.
6065

6166
| Library version | Supported redis versions |
6267
|-----------------|-------------------|
6368
| 3.5.3 | <= 6.2 Family of releases |
6469
| >= 4.5.0 | Version 5.0 to 7.0 |
65-
| >= 5.0.0 | Version 5.0 to current |
70+
| >= 5.0.0 | Version 5.0 to 7.4 |
71+
| >= 6.0.0 | Version 7.2 to current |
6672

6773

6874
## Usage
@@ -152,8 +158,42 @@ The following example shows how to utilize [Redis Pub/Sub](https://redis.io/docs
152158
{'pattern': None, 'type': 'subscribe', 'channel': b'my-second-channel', 'data': 1}
153159
```
154160

161+
### Redis’ search and query capabilities default dialect
162+
163+
Release 6.0.0 introduces a client-side default dialect for Redis’ search and query capabilities.
164+
By default, the client now overrides the server-side dialect with version 2, automatically appending *DIALECT 2* to commands like *FT.AGGREGATE* and *FT.SEARCH*.
155165

156-
--------------------------
166+
**Important**: Be aware that the query dialect may impact the results returned. If needed, you can revert to a different dialect version by configuring the client accordingly.
167+
168+
``` python
169+
>>> from redis.commands.search.field import TextField
170+
>>> from redis.commands.search.query import Query
171+
>>> from redis.commands.search.index_definition import IndexDefinition
172+
>>> import redis
173+
174+
>>> r = redis.Redis(host='localhost', port=6379, db=0)
175+
>>> r.ft().create_index(
176+
>>> (TextField("name"), TextField("lastname")),
177+
>>> definition=IndexDefinition(prefix=["test:"]),
178+
>>> )
179+
180+
>>> r.hset("test:1", "name", "James")
181+
>>> r.hset("test:1", "lastname", "Brown")
182+
183+
>>> # Query with default DIALECT 2
184+
>>> query = "@name: James Brown"
185+
>>> q = Query(query)
186+
>>> res = r.ft().search(q)
187+
188+
>>> # Query with explicit DIALECT 1
189+
>>> query = "@name: James Brown"
190+
>>> q = Query(query).dialect(1)
191+
>>> res = r.ft().search(q)
192+
```
193+
194+
You can find further details in the [query dialect documentation](https://redis.io/docs/latest/develop/interact/search-and-query/advanced-concepts/dialects/).
195+
196+
---------------------------------------------
157197

158198
### Author
159199

@@ -169,4 +209,4 @@ Special thanks to:
169209
system.
170210
- Paul Hubbard for initial packaging support.
171211

172-
[![Redis](./docs/_static/logo-redis.svg)](https://redis.io)
212+
[![Redis](./docs/_static/logo-redis.svg)](https://redis.io)

docker-compose.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
---
2+
# image tag 8.0-RC2-pre is the one matching the 8.0 GA release
23
x-client-libs-stack-image: &client-libs-stack-image
3-
image: "redislabs/client-libs-test:${CLIENT_LIBS_TEST_STACK_IMAGE_TAG:-rs-7.4.0-v2}"
4+
image: "redislabs/client-libs-test:${CLIENT_LIBS_TEST_STACK_IMAGE_TAG:-8.0-RC2-pre}"
45

56
x-client-libs-image: &client-libs-image
6-
image: "redislabs/client-libs-test:${CLIENT_LIBS_TEST_IMAGE_TAG:-7.4.2}"
7+
image: "redislabs/client-libs-test:${CLIENT_LIBS_TEST_IMAGE_TAG:-8.0-RC2-pre}"
78

89
services:
910

redis/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def int_or_str(value):
4545
return value
4646

4747

48-
__version__ = "5.2.1"
48+
__version__ = "6.1.0"
4949
VERSION = tuple(map(int_or_str, __version__.split(".")))
5050

5151

0 commit comments

Comments
 (0)