Skip to content

Commit ad33c77

Browse files
committed
Merge branch 'main' into latest
1 parent 27ce86d commit ad33c77

File tree

78 files changed

+524
-273
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+524
-273
lines changed
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
name: redis_docs_sync
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
release:
7+
type: string
8+
required: true
9+
description: ''
10+
11+
jobs:
12+
redis_docs_sync:
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: write
16+
actions: write
17+
steps:
18+
- name: Generate a token
19+
id: generate-token
20+
uses: actions/create-github-app-token@v1
21+
with:
22+
app-id: ${{ secrets.DOCS_APP_ID }}
23+
private-key: ${{ secrets.DOCS_APP_PRIVATE_KEY }}
24+
25+
- name: 'Checkout'
26+
uses: actions/checkout@v3
27+
with:
28+
token: ${{ steps.generate-token.outputs.token }}
29+
30+
- name: 'Generate modules-api-ref.md and commands.json files and push if necessary'
31+
env:
32+
GH_TOKEN: ${{ steps.generate-token.outputs.token }}
33+
run: |-
34+
RELEASE="${{ github.event.inputs.release }}"
35+
BRANCH="redis_docs_sync_${RELEASE}"
36+
37+
# Generate modules-api-ref.md
38+
gh repo clone redis/redis
39+
pushd redis
40+
git fetch origin --tags
41+
git checkout "tags/${RELEASE}"
42+
make 1>/dev/null
43+
src/redis-server &
44+
utils/generate-commands-json.py > generated-commands.json
45+
utils/generate-module-api-doc.rb > generated-modules-api-ref.md
46+
popd
47+
48+
# check if remote branch already exists
49+
git fetch --all
50+
set +e
51+
git ls-remote --exit-code --heads origin "refs/heads/${BRANCH}"
52+
if [ "$?" -eq 0 ]; then
53+
set -e
54+
# if it does, create local branch off existing remote branch
55+
git checkout -b "${BRANCH}" "origin/${BRANCH}"
56+
git branch --set-upstream-to="origin/${BRANCH}" "${BRANCH}"
57+
git pull
58+
else
59+
set -e
60+
# otherwise, create local branch from main
61+
git checkout -b "${BRANCH}"
62+
fi
63+
64+
mv redis/generated-modules-api-ref.md content/develop/reference/modules/modules-api-ref.md
65+
mv redis/generated-commands.json data/commands_core.json
66+
67+
# Apply frontmatter patch
68+
git apply content/develop/reference/modules/modules-api-ref-frontmatter.patch
69+
70+
# Check if there are any changes
71+
commands_core_is_different=$(git diff data/commands_core.json)
72+
modules_api_is_different=$(git diff content/develop/reference/modules/modules-api-ref.md)
73+
74+
# If commands_core file has changed, commit it
75+
if [[ ! -z $commands_core_is_different ]]; then
76+
git add data/commands_core.json
77+
git config user.email "177626021+redisdocsapp[bot]@users.noreply.github.com"
78+
git config user.name "redisdocsapp[bot]"
79+
git commit -m "Update commands_core.json for release ${RELEASE}"
80+
fi
81+
82+
# If modules-api-ref file has changed, commit it
83+
if [[ ! -z $modules_api_is_different ]]; then
84+
git add content/develop/reference/modules/modules-api-ref.md
85+
git config user.email "177626021+redisdocsapp[bot]@users.noreply.github.com"
86+
git config user.name "redisdocsapp[bot]"
87+
git commit -m "Update modules-api-ref.md for release ${RELEASE}"
88+
fi
89+
90+
if [[ ! -z $commands_core_is_different || ! -z $modules_api_is_different ]]; then
91+
git push origin "${BRANCH}"
92+
fi
93+
94+
# If a pr is not already open, create one
95+
set +e
96+
gh search prs -R redis/docs --state open --match title "redis docs sync ${RELEASE}" | grep -q "redis docs sync ${RELEASE}"
97+
if [ "$?" -eq 1 ]; then
98+
set -e
99+
gh pr create \
100+
--body "redis docs sync ${RELEASE}" \
101+
--title "redis docs sync ${RELEASE}" \
102+
--head "$BRANCH" \
103+
--base "main"
104+
fi

content/commands/client-trackinginfo/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,5 @@ Here's the list of tracking information sections and their respective values:
4343
* `caching-no`: The next command won't cache keys (exists only together with `optout`).
4444
* `noloop`: The client isn't notified about keys modified by itself.
4545
* `broken_redirect`: The client ID used for redirection isn't valid anymore.
46-
* **redirect**: The client ID used for notifications redirection, or -1 when none.
46+
* **redirect**: The client ID used for notifications redirection, 0 for self-redirection, or -1 when none.
4747
* **prefixes**: A list of key prefixes for which notifications are sent to the client.

content/commands/ft.aggregate/index.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ syntax: "FT.AGGREGATE index query \n [VERBATIM] \n [LOAD count field [field ..
173173
\ ...]] ...]] \n [ SORTBY nargs [ property ASC | DESC [ property ASC | DESC ...]]\
174174
\ [MAX num] [WITHCOUNT] \n [ APPLY expression AS name [ APPLY expression AS name\
175175
\ ...]] \n [ LIMIT offset num] \n [FILTER filter] \n [ WITHCURSOR [COUNT read_size]\
176-
\ [MAXIDLE idle_time]] \n [ PARAMS nargs name value [ name value ...]] \n [DIALECT\
176+
\ [MAXIDLE idle_time]] \n [ PARAMS nargs name value [ name value ...]] \n [ADDSCORES] \n [DIALECT\
177177
\ dialect]\n"
178178
syntax_fmt: "FT.AGGREGATE index query [VERBATIM] [LOAD\_count field [field ...]]\n\
179179
\ [TIMEOUT\_timeout] [LOAD *] [GROUPBY\_nargs property [property ...]\n [REDUCE\_\
@@ -183,15 +183,15 @@ syntax_fmt: "FT.AGGREGATE index query [VERBATIM] [LOAD\_count field [field ...]]
183183
name] ...]] ...]]\n [SORTBY\_nargs [property <ASC | DESC> [property <ASC | DESC>\
184184
\ ...]]\n [MAX\_num]] [APPLY\_expression AS\_name [APPLY\_expression AS\_name\n\
185185
\ ...]] [LIMIT offset num] [FILTER\_filter] [WITHCURSOR\n [COUNT\_read_size] [MAXIDLE\_\
186-
idle_time]] [PARAMS nargs name value\n [name value ...]] [DIALECT\_dialect]"
186+
idle_time]] [PARAMS nargs name value\n [name value ...]]\n [ADDSCORES]\n [DIALECT\_dialect]"
187187
syntax_str: "query [VERBATIM] [LOAD\_count field [field ...]] [TIMEOUT\_timeout] [LOAD\
188188
\ *] [GROUPBY\_nargs property [property ...] [REDUCE\_function nargs arg [arg ...]\
189189
\ [AS\_name] [REDUCE\_function nargs arg [arg ...] [AS\_name] ...]] [GROUPBY\_nargs\
190190
\ property [property ...] [REDUCE\_function nargs arg [arg ...] [AS\_name] [REDUCE\_\
191191
function nargs arg [arg ...] [AS\_name] ...]] ...]] [SORTBY\_nargs [property <ASC\
192192
\ | DESC> [property <ASC | DESC> ...]] [MAX\_num]] [APPLY\_expression AS\_name [APPLY\_\
193193
expression AS\_name ...]] [LIMIT offset num] [FILTER\_filter] [WITHCURSOR [COUNT\_\
194-
read_size] [MAXIDLE\_idle_time]] [PARAMS nargs name value [name value ...]] [DIALECT\_\
194+
read_size] [MAXIDLE\_idle_time]] [PARAMS nargs name value [name value ...]] [ADDSCORES] [DIALECT\_\
195195
dialect]"
196196
title: FT.AGGREGATE
197197
---
@@ -316,6 +316,15 @@ defines one or more value parameters. Each parameter has a name and a value.
316316
You can reference parameters in the `query` by a `$`, followed by the parameter name, for example, `$user`. Each such reference in the search query to a parameter name is substituted by the corresponding parameter value. For example, with parameter definition `PARAMS 4 lon 29.69465 lat 34.95126`, the expression `@loc:[$lon $lat 10 km]` is evaluated to `@loc:[29.69465 34.95126 10 km]`. You cannot reference parameters in the query string where concrete values are not allowed, such as in field names, for example, `@loc`. To use `PARAMS`, set `DIALECT` to `2` or greater than `2`.
317317
</details>
318318

319+
<details open>
320+
<summary><code>ADDSCORES</code></summary>
321+
322+
The `ADDSCORES` option exposes the full-text score values to the aggregation pipeline.
323+
You can use `@__score` in a pipeline as shown in the following example:
324+
325+
`FT.AGGREGATE idx 'hello' ADDSCORES SORTBY 2 @__score DESC`
326+
</details>
327+
319328
<details open>
320329
<summary><code>DIALECT {dialect_version}</code></summary>
321330

content/develop/connect/clients/java/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ You have two choices of Java clients that you can use with Redis:
2020

2121
- [Jedis]({{< relref "/develop/connect/clients/java/jedis" >}}), for synchronous applications.
2222
- [Lettuce]({{< relref "/develop/connect/clients/java/lettuce" >}}),
23-
for asynchronous and reactive applications.
23+
for synchronous, asynchronous, and reactive applications.
2424

2525
You can also access Redis with an object-mapping client interface. See
2626
[RedisOM for Java]({{< relref "/integrate/redisom-for-java" >}})

content/develop/connect/clients/java/jedis.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ title: Jedis guide
1515
weight: 1
1616
---
1717

18-
[Jedis](https://github.com/redis/jedis) is the *synchronous* Java client for Redis.
18+
[Jedis](https://github.com/redis/jedis) is a synchronous Java client for Redis.
1919
Use [Lettuce]({{< relref "/develop/connect/clients/java/lettuce" >}}) if you need
20-
an *asynchronous* Java client.
20+
a more advanced Java client that also supports asynchronous and reactive connections.
2121
The sections below explain how to install `Jedis` and connect your application
2222
to a Redis database.
2323

content/develop/connect/clients/java/lettuce.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@ title: Lettuce guide
1515
weight: 2
1616
---
1717

18-
[Lettuce](https://github.com/redis/lettuce/tree/main/src/main) is the *asynchronous* Java client for Redis.
19-
Use [Jedis]({{< relref "/develop/connect/clients/java/jedis" >}}) if you need
20-
a *synchronous* Java client.
18+
[Lettuce](https://github.com/redis/lettuce/tree/main/src/main) is an advanced Java client for Redis
19+
that supports synchronous, asynchronous, and reactive connections.
20+
If you only need synchronous connections then you may find the other Java client
21+
[Jedis]({{< relref "/develop/connect/clients/java/jedis" >}}) easier to use.
22+
2123
The sections below explain how to install `Lettuce` and connect your application
2224
to a Redis database.
2325

@@ -94,7 +96,7 @@ public class Async {
9496
}
9597
```
9698

97-
Learn more about asynchronous Lettuce API in [the reference guide](https://lettuce.io/core/release/reference/index.html#asynchronous-api).
99+
Learn more about asynchronous Lettuce API in [the reference guide](https://redis.github.io/lettuce/#asynchronous-api).
98100

99101
### Reactive connection
100102

@@ -136,7 +138,7 @@ public class Main {
136138
}
137139
```
138140

139-
Learn more about reactive Lettuce API in [the reference guide](https://lettuce.io/core/release/reference/index.html#reactive-api).
141+
Learn more about reactive Lettuce API in [the reference guide](https://redis.github.io/lettuce/#reactive-api).
140142

141143
### Redis Cluster connection
142144

@@ -178,14 +180,15 @@ RedisClient client = RedisClient.create(redisUri);
178180
Lettuce uses `ClientResources` for efficient management of shared resources like event loop groups and thread pools.
179181
For connection pooling, Lettuce leverages `RedisClient` or `RedisClusterClient`, which can handle multiple concurrent connections efficiently.
180182

181-
### Timouts
183+
### Timeouts
184+
182185
Lettuce provides timeouts for many operations, such as command execution, SSL handshake, and Sentinel discovery. By default, Lettuce uses a global timeout value of 60 seconds for these operations, but you can override the global timeout value with individual timeout values for each operation.
183186

184187
{{% alert title="Tip" color="warning" %}}
185188
Choosing suitable timeout values is crucial for your application's performance and stability and is specific to each environment.
186189
Configuring timeouts is only necessary if you have issues with the default values.
187190
In some cases, the defaults are based on environment-specific settings (e.g., operating system settings), while in other cases, they are built into the Lettuce driver.
188-
For more details on setting specific timeouts, see the [Lettuce reference guide](https://lettuce.io/core/release/reference/index.html).
191+
For more details on setting specific timeouts, see the [Lettuce reference guide](https://redis.github.io/lettuce/).
189192
{{% /alert %}}
190193

191194
Below is an example of setting socket-level timeouts. The `TCP_USER_TIMEOUT` setting is useful for scenarios where the server stops responding without acknowledging the last request, while the `KEEPALIVE` setting is good for detecting dead connections where there is no traffic between the client and the server.
@@ -228,6 +231,7 @@ try (RedisClient client = RedisClient.create(redisURI)) {
228231
```
229232

230233
### Connection pooling
234+
231235
A typical approach with Lettuce is to create a single `RedisClient` instance and reuse it to establish connections to your Redis server(s).
232236
These connections are multiplexed; that is, multiple commands can be run concurrently over a single or a small set of connections, making explicit pooling less practical.
233237

@@ -300,6 +304,6 @@ java.security.Security.setProperty("networkaddress.cache.negative.ttl", "0");
300304

301305
## Learn more
302306

303-
- [Lettuce reference documentation](https://lettuce.io/docs/)
307+
- [Lettuce reference documentation](https://redis.github.io/lettuce/)
304308
- [Redis commands]({{< relref "/commands" >}})
305309
- [Project Reactor](https://projectreactor.io/)

content/develop/data-types/hashes.md

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -144,45 +144,47 @@ Consider a hash data set for storing sensor data that has the following structur
144144
```python
145145
event = {
146146
'air_quality': 256,
147-
'Battery_level':89
147+
'battery_level':89
148148
}
149149

150-
client.hset('sensor:sensor1', mapping=event)
150+
r.hset('sensor:sensor1', mapping=event)
151151
```
152152

153+
In the examples below, you will likely need to refresh the `sensor:sensor1` key after its fields expire.
154+
153155
Set and retrieve the TTL for multiple fields in a hash:
154156

155157
```python
156158
# set the TTL for two hash fields to 60 seconds
157-
client.hexpire('sensor:sensor1', 60, 'air_quality', 'battery_level')
158-
ttl = client.httl('sensor:sensor1', 'air_quality', 'battery_level')
159+
r.hexpire('sensor:sensor1', 60, 'air_quality', 'battery_level')
160+
ttl = r.httl('sensor:sensor1', 'air_quality', 'battery_level')
159161
print(ttl)
160-
# prints [60]
162+
# prints [60, 60]
161163
```
162164

163165
Set and retrieve a hash field's TTL in milliseconds:
164166

165167
```python
166168
# set the TTL of the 'air_quality' field in milliseconds
167-
client.hpexpire('sensor:sensor1', 60000, 'air_quality')
169+
r.hpexpire('sensor:sensor1', 60000, 'air_quality')
168170
# and retrieve it
169-
pttl = client.hpttl('sensor:sensor1', 'air_quality')
171+
pttl = r.hpttl('sensor:sensor1', 'air_quality')
170172
print(pttl)
171-
# prints [60000]
173+
# prints [59994] # your actual value may vary
172174
```
173175

174176
Set and retrieve a hash field’s expiration timestamp:
175177

176178
```python
177179
# set the expiration of 'air_quality' to now + 24 hours
178180
# (similar to setting the TTL to 24 hours)
179-
client.hexpireat('sensor:sensor1',
181+
r.hexpireat('sensor:sensor1',
180182
datetime.now() + timedelta(hours=24),
181183
'air_quality')
182184
# and retrieve it
183-
expire_time = client.hexpiretime('sensor:sensor1', 'air_quality')
185+
expire_time = r.hexpiretime('sensor:sensor1', 'air_quality')
184186
print(expire_time)
185-
# prints [1717668041]
187+
# prints [1717668041] # your actual value may vary
186188
```
187189

188190
## Performance

content/embeds/r7.2-migration-guides.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
### Migration guides for certain clients
22

3-
If you are using [Go-Redis](https://redis.uptrace.dev/) v9 or [Lettuce](https://lettuce.io/) v6+, which by default switch to the RESP3 protocol, and you are running Redis Stack commands, please make sure the protocol version is pinned to RESP2 prior to upgrading to Redis version 7.2.
3+
If you are using [Go-Redis](https://redis.uptrace.dev/) v9 or [Lettuce](https://redis.github.io/lettuce/) v6+, which by default switch to the RESP3 protocol, and you are running Redis Stack commands, please make sure the protocol version is pinned to RESP2 prior to upgrading to Redis version 7.2.
44

55
#### Go-Redis
66

content/embeds/rc-create-db-first-steps.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Before creating a Redis Cloud database, you need to [create an account]({{< relr
22

33
To create a database in your Redis Cloud account:
44

5-
1. Sign in to the [Redis Cloud console](https://app.redislabs.com).
5+
1. Sign in to the [Redis Cloud console](https://cloud.redis.io).
66

77
2. Select the **New database** button.
88

content/get-started/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ Redis is an [in-memory data store]({{< relref "/develop/get-started/data-store"
99

1010
You can install Redis from source, from an executable for your OS, or bundled with Redis Stack and Redis Insight which include popular features and monitoring.
1111

12-
* [Install Redis from Source]({{< relref "/operate/oss_and_stack/install/install-redis/install-redis-from-source" >}})
1312
* [Install Redis on Linux]({{< relref "/operate/oss_and_stack/install/install-redis/install-redis-on-linux" >}})
1413
* [Install Redis on macOS]({{< relref "/operate/oss_and_stack/install/install-redis/install-redis-on-mac-os" >}})
1514
* [Install Redis on Windows]({{< relref "/operate/oss_and_stack/install/install-redis/install-redis-on-windows" >}})
1615
* [Install Redis with Redis Stack and Redis Insight]({{< relref "/operate/oss_and_stack/install/install-stack" >}})
1716
* [Run Redis Stack on Docker]({{< relref "/operate/oss_and_stack/install/install-stack/docker" >}})
17+
* [Install Redis from Source]({{< relref "/operate/oss_and_stack/install/install-redis/install-redis-from-source" >}})
1818

1919
## Use cases
2020

0 commit comments

Comments
 (0)