Skip to content

Commit 83842be

Browse files
Merge branch 'main' into DOC-4756-sorted-set-async-examples
2 parents 8ff2f4f + 636a503 commit 83842be

38 files changed

+2149
-41
lines changed

.github/workflows/docs.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ concurrency:
1010
group: "pages"
1111
cancel-in-progress: false
1212
jobs:
13-
build-and-deploy:
13+
publish-docs:
1414
concurrency: ci-${{ github.ref }}
1515
runs-on: ubuntu-latest
1616
steps:
17-
- uses: actions/checkout@v3
17+
- uses: actions/checkout@v4
1818
- uses: actions/setup-python@v4
1919
with:
2020
python-version: 3.9
@@ -26,11 +26,11 @@ jobs:
2626
run: |
2727
mkdocs build -d docsbuild
2828
- name: Setup Pages
29-
uses: actions/configure-pages@v3
29+
uses: actions/configure-pages@v4
3030
- name: Upload artifact
31-
uses: actions/upload-pages-artifact@v1
31+
uses: actions/upload-pages-artifact@v3
3232
with:
3333
path: 'docsbuild'
3434
- name: Deploy to GitHub Pages
3535
id: deployment
36-
uses: actions/deploy-pages@v2
36+
uses: actions/deploy-pages@v4

.github/workflows/integration.yml

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,35 @@ on:
1515
schedule:
1616
- cron: '0 1 * * *' # nightly build
1717
workflow_dispatch:
18-
inputs:
19-
redis_version:
20-
description: "Redis stack version to use for testing"
21-
required: false
22-
default: "8.0-M02"
23-
type: choice
24-
options:
25-
- "8.0-M02"
26-
- "rs-7.4.0-v1"
27-
- "rs-7.2.0-v13"
2818

2919
jobs:
30-
3120
build:
3221
name: Build and Test
3322
runs-on: ubuntu-24.04
23+
strategy:
24+
fail-fast: false
25+
matrix:
26+
redis_version:
27+
- "unstable"
28+
- "8.0"
29+
- "7.4"
30+
- "7.2"
31+
3432
steps:
33+
- name: Test Redis Server Version
34+
id: map-tags
35+
run: |
36+
# Map requested version to github or tag
37+
case "${{ matrix.redis_version }}" in
38+
"unstable") redis_branch="unstable" stack_version="8.0-M04-pre" ;;
39+
"8.0") redis_branch="8.0" stack_version="8.0-M04-pre" ;;
40+
"7.4") redis_branch="7.4" stack_version="rs-7.4.0-v2" ;;
41+
"7.2") redis_branch="7.2" stack_version="rs-7.2.0-v14" ;;
42+
*) echo "Unsupported version: ${{ matrix.redis_version }}" && exit 1 ;;
43+
esac
44+
# Save them as outputs for later use
45+
echo "redis_branch=$redis_branch" >> $GITHUB_OUTPUT
46+
echo "redis_stack_version=$stack_version" >> $GITHUB_OUTPUT
3547
- name: Checkout project
3648
uses: actions/checkout@v4
3749
- name: Set Java up in the runner
@@ -61,7 +73,8 @@ jobs:
6173
run: |
6274
make test-coverage
6375
env:
64-
REDIS_STACK_VERSION: ${{ inputs.redis_version || '8.0-M02' }}
76+
REDIS: ${{ steps.map-tags.outputs.redis_branch }}
77+
REDIS_STACK_VERSION: ${{ steps.map-tags.outputs.redis_stack_version }}
6578
JVM_OPTS: -Xmx3200m
6679
TERM: dumb
6780
- name: Upload coverage reports to Codecov

pom.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
and much more.
1414
</description>
1515

16-
<url>http://github.com/lettuce-io/lettuce-core</url>
16+
<url>https://github.com/redis/lettuce</url>
1717

1818
<organization>
1919
<name>lettuce.io</name>
@@ -30,7 +30,7 @@
3030

3131
<issueManagement>
3232
<system>Github</system>
33-
<url>https://github.com/lettuce-io/lettuce-core/issues</url>
33+
<url>https://github.com/redis/lettuce/issues</url>
3434
</issueManagement>
3535

3636
<developers>
@@ -82,10 +82,10 @@
8282
</properties>
8383

8484
<scm>
85-
<connection>scm:git:https://github.com/lettuce-io/lettuce-core.git</connection>
86-
<developerConnection>scm:git:https://github.com/lettuce-io/lettuce-core.git
85+
<connection>scm:git:https://github.com/redis/lettuce.git</connection>
86+
<developerConnection>scm:git:https://github.com/redis/lettuce.git
8787
</developerConnection>
88-
<url>http://github.com/lettuce-io/lettuce-core</url>
88+
<url>https://github.com/redis/lettuce</url>
8989
<tag>HEAD</tag>
9090
</scm>
9191

src/main/java/io/lettuce/core/AbstractRedisAsyncCommands.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@
4848
import io.lettuce.core.protocol.CommandType;
4949
import io.lettuce.core.protocol.ProtocolKeyword;
5050
import io.lettuce.core.protocol.RedisCommand;
51+
import io.lettuce.core.search.Field;
52+
import io.lettuce.core.search.arguments.CreateArgs;
5153
import reactor.core.publisher.Mono;
5254

5355
import java.time.Duration;
@@ -79,14 +81,17 @@ public abstract class AbstractRedisAsyncCommands<K, V> implements RedisAclAsyncC
7981
RedisKeyAsyncCommands<K, V>, RedisStringAsyncCommands<K, V>, RedisListAsyncCommands<K, V>, RedisSetAsyncCommands<K, V>,
8082
RedisSortedSetAsyncCommands<K, V>, RedisScriptingAsyncCommands<K, V>, RedisServerAsyncCommands<K, V>,
8183
RedisHLLAsyncCommands<K, V>, BaseRedisAsyncCommands<K, V>, RedisTransactionalAsyncCommands<K, V>,
82-
RedisGeoAsyncCommands<K, V>, RedisClusterAsyncCommands<K, V>, RedisJsonAsyncCommands<K, V> {
84+
RedisGeoAsyncCommands<K, V>, RedisClusterAsyncCommands<K, V>, RedisJsonAsyncCommands<K, V>,
85+
RediSearchAsyncCommands<K, V> {
8386

8487
private final StatefulConnection<K, V> connection;
8588

8689
private final RedisCommandBuilder<K, V> commandBuilder;
8790

8891
private final RedisJsonCommandBuilder<K, V> jsonCommandBuilder;
8992

93+
private final RediSearchCommandBuilder<K, V> searchCommandBuilder;
94+
9095
private final Mono<JsonParser> parser;
9196

9297
/**
@@ -101,6 +106,7 @@ public AbstractRedisAsyncCommands(StatefulConnection<K, V> connection, RedisCode
101106
this.connection = connection;
102107
this.commandBuilder = new RedisCommandBuilder<>(codec);
103108
this.jsonCommandBuilder = new RedisJsonCommandBuilder<>(codec, parser);
109+
this.searchCommandBuilder = new RediSearchCommandBuilder<>(codec);
104110
}
105111

106112
/**
@@ -1478,6 +1484,11 @@ public boolean isOpen() {
14781484
return connection.isOpen();
14791485
}
14801486

1487+
@Override
1488+
public RedisFuture<String> ftCreate(K index, CreateArgs<K, V> options, List<Field<K>> fields) {
1489+
return dispatch(searchCommandBuilder.ftCreate(index, options, fields));
1490+
}
1491+
14811492
@Override
14821493
public RedisFuture<List<Long>> jsonArrappend(K key, JsonPath jsonPath, JsonValue... values) {
14831494
return dispatch(jsonCommandBuilder.jsonArrappend(key, jsonPath, values));

src/main/java/io/lettuce/core/AbstractRedisReactiveCommands.java

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@
4949
import io.lettuce.core.protocol.RedisCommand;
5050
import io.lettuce.core.protocol.TracedCommand;
5151
import io.lettuce.core.resource.ClientResources;
52+
import io.lettuce.core.search.Field;
53+
import io.lettuce.core.search.arguments.CreateArgs;
5254
import io.lettuce.core.tracing.TraceContext;
5355
import io.lettuce.core.tracing.TraceContextProvider;
5456
import io.lettuce.core.tracing.Tracing;
@@ -84,19 +86,21 @@
8486
* @author Tihomir Mateev
8587
* @since 4.0
8688
*/
87-
public abstract class AbstractRedisReactiveCommands<K, V>
88-
implements RedisAclReactiveCommands<K, V>, RedisHashReactiveCommands<K, V>, RedisKeyReactiveCommands<K, V>,
89-
RedisStringReactiveCommands<K, V>, RedisListReactiveCommands<K, V>, RedisSetReactiveCommands<K, V>,
90-
RedisSortedSetReactiveCommands<K, V>, RedisScriptingReactiveCommands<K, V>, RedisServerReactiveCommands<K, V>,
91-
RedisHLLReactiveCommands<K, V>, BaseRedisReactiveCommands<K, V>, RedisTransactionalReactiveCommands<K, V>,
92-
RedisGeoReactiveCommands<K, V>, RedisClusterReactiveCommands<K, V>, RedisJsonReactiveCommands<K, V> {
89+
public abstract class AbstractRedisReactiveCommands<K, V> implements RedisAclReactiveCommands<K, V>,
90+
RedisHashReactiveCommands<K, V>, RedisKeyReactiveCommands<K, V>, RedisStringReactiveCommands<K, V>,
91+
RedisListReactiveCommands<K, V>, RedisSetReactiveCommands<K, V>, RedisSortedSetReactiveCommands<K, V>,
92+
RedisScriptingReactiveCommands<K, V>, RedisServerReactiveCommands<K, V>, RedisHLLReactiveCommands<K, V>,
93+
BaseRedisReactiveCommands<K, V>, RedisTransactionalReactiveCommands<K, V>, RedisGeoReactiveCommands<K, V>,
94+
RedisClusterReactiveCommands<K, V>, RedisJsonReactiveCommands<K, V>, RediSearchReactiveCommands<K, V> {
9395

9496
private final StatefulConnection<K, V> connection;
9597

9698
private final RedisCommandBuilder<K, V> commandBuilder;
9799

98100
private final RedisJsonCommandBuilder<K, V> jsonCommandBuilder;
99101

102+
private final RediSearchCommandBuilder<K, V> searchCommandBuilder;
103+
100104
private final Mono<JsonParser> parser;
101105

102106
private final ClientResources clientResources;
@@ -117,6 +121,7 @@ public AbstractRedisReactiveCommands(StatefulConnection<K, V> connection, RedisC
117121
this.parser = parser;
118122
this.commandBuilder = new RedisCommandBuilder<>(codec);
119123
this.jsonCommandBuilder = new RedisJsonCommandBuilder<>(codec, parser);
124+
this.searchCommandBuilder = new RediSearchCommandBuilder<>(codec);
120125
this.clientResources = connection.getResources();
121126
this.tracingEnabled = clientResources.tracing().isEnabled();
122127
}
@@ -1543,6 +1548,11 @@ public boolean isOpen() {
15431548
return connection.isOpen();
15441549
}
15451550

1551+
@Override
1552+
public Mono<String> ftCreate(K index, CreateArgs<K, V> options, List<Field<K>> fields) {
1553+
return createMono(() -> searchCommandBuilder.ftCreate(index, options, fields));
1554+
}
1555+
15461556
@Override
15471557
public Flux<Long> jsonArrappend(K key, JsonPath jsonPath, JsonValue... values) {
15481558
return createDissolvingFlux(() -> jsonCommandBuilder.jsonArrappend(key, jsonPath, values));

src/main/java/io/lettuce/core/AclCategory.java

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,5 +111,45 @@ public enum AclCategory {
111111
/**
112112
* scripting command
113113
*/
114-
SCRIPTING
114+
SCRIPTING,
115+
116+
/**
117+
* bloom command
118+
*/
119+
BLOOM,
120+
121+
/**
122+
* cuckoo command
123+
*/
124+
CUCKOO,
125+
126+
/**
127+
* count-min-sketch command
128+
*/
129+
CMS,
130+
131+
/**
132+
* top-k command
133+
*/
134+
TOPK,
135+
136+
/**
137+
* t-digest command
138+
*/
139+
TDIGEST,
140+
141+
/**
142+
* search command
143+
*/
144+
SEARCH,
145+
146+
/**
147+
* timeseries command
148+
*/
149+
TIMESERIES,
150+
151+
/**
152+
* json command
153+
*/
154+
JSON
115155
}
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
/*
2+
* Copyright 2025, Redis Ltd. and Contributors
3+
* All rights reserved.
4+
*
5+
* Licensed under the MIT License.
6+
*/
7+
package io.lettuce.core;
8+
9+
import io.lettuce.core.codec.RedisCodec;
10+
import io.lettuce.core.output.StatusOutput;
11+
import io.lettuce.core.protocol.BaseRedisCommandBuilder;
12+
import io.lettuce.core.protocol.Command;
13+
import io.lettuce.core.protocol.CommandArgs;
14+
import io.lettuce.core.protocol.CommandKeyword;
15+
import io.lettuce.core.search.arguments.CreateArgs;
16+
import io.lettuce.core.search.Field;
17+
18+
import java.util.List;
19+
20+
import static io.lettuce.core.protocol.CommandType.*;
21+
22+
/**
23+
* Command builder for RediSearch commands.
24+
*
25+
* @param <K> Key type.
26+
* @param <V> Value type.
27+
* @since 6.6
28+
*/
29+
class RediSearchCommandBuilder<K, V> extends BaseRedisCommandBuilder<K, V> {
30+
31+
RediSearchCommandBuilder(RedisCodec<K, V> codec) {
32+
super(codec);
33+
}
34+
35+
/**
36+
* Create a new index with the given name, index options and fields.
37+
*
38+
* @param index the index name
39+
* @param createArgs the index options
40+
* @param fields the fields
41+
* @return the result of the create command
42+
*/
43+
public Command<K, V, String> ftCreate(K index, CreateArgs<K, V> createArgs, List<Field<K>> fields) {
44+
notNullKey(index);
45+
notEmpty(fields.toArray());
46+
47+
CommandArgs<K, V> args = new CommandArgs<>(codec).addKey(index);
48+
49+
if (createArgs != null) {
50+
createArgs.build(args);
51+
}
52+
53+
args.add(CommandKeyword.SCHEMA);
54+
55+
for (Field<K> field : fields) {
56+
field.build(args);
57+
}
58+
59+
return createCommand(FT_CREATE, new StatusOutput<>(codec), args);
60+
61+
}
62+
63+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/*
2+
* Copyright 2025, Redis Ltd. and Contributors
3+
* All rights reserved.
4+
*
5+
* Licensed under the MIT License.
6+
*/
7+
package io.lettuce.core.api.async;
8+
9+
import java.util.List;
10+
import io.lettuce.core.RedisFuture;
11+
import io.lettuce.core.search.Field;
12+
import io.lettuce.core.search.arguments.CreateArgs;
13+
14+
/**
15+
* Asynchronous executed commands for RediSearch functionality
16+
*
17+
* @param <K> Key type.
18+
* @param <V> Value type.
19+
* @author Tihomir Mateev
20+
* @see <a href="https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/search/">RediSearch</a>
21+
* @since 6.6
22+
* @generated by io.lettuce.apigenerator.CreateAsyncApi
23+
*/
24+
public interface RediSearchAsyncCommands<K, V> {
25+
26+
/**
27+
* Create a new index with the given name, index options, and fields.
28+
*
29+
* @param index the index name, as a key
30+
* @param options the index {@link CreateArgs}
31+
* @param fields the {@link Field}s of the index
32+
* @return the result of the create command
33+
* @since 6.6
34+
* @see <a href="https://redis.io/docs/latest/commands/ft.create/">FT.CREATE</a>
35+
*/
36+
RedisFuture<String> ftCreate(K index, CreateArgs<K, V> options, List<Field<K>> fields);
37+
38+
}

src/main/java/io/lettuce/core/api/async/RedisAsyncCommands.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public interface RedisAsyncCommands<K, V> extends BaseRedisAsyncCommands<K, V>,
3737
RedisHashAsyncCommands<K, V>, RedisHLLAsyncCommands<K, V>, RedisKeyAsyncCommands<K, V>, RedisListAsyncCommands<K, V>,
3838
RedisScriptingAsyncCommands<K, V>, RedisServerAsyncCommands<K, V>, RedisSetAsyncCommands<K, V>,
3939
RedisSortedSetAsyncCommands<K, V>, RedisStreamAsyncCommands<K, V>, RedisStringAsyncCommands<K, V>,
40-
RedisTransactionalAsyncCommands<K, V>, RedisJsonAsyncCommands<K, V> {
40+
RedisTransactionalAsyncCommands<K, V>, RedisJsonAsyncCommands<K, V>, RediSearchAsyncCommands<K, V> {
4141

4242
/**
4343
* Authenticate to the server.

0 commit comments

Comments
 (0)