Skip to content

Commit da098fe

Browse files
authored
Merge branch 'master' into search-dialect-default-2
2 parents 73e37cd + a46700a commit da098fe

23 files changed

+893
-220
lines changed

.github/workflows/docs.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ jobs:
1414
concurrency: ci-${{ github.ref }}
1515
runs-on: ubuntu-latest
1616
steps:
17-
- uses: actions/checkout@v3
18-
- uses: actions/setup-python@v4
17+
- uses: actions/checkout@v4
18+
- uses: actions/setup-python@v5
1919
with:
20-
python-version: 3.9
20+
python-version: 3.13
2121
- name: Install dependencies
2222
run: |
2323
python -m pip install --upgrade pip
@@ -33,4 +33,4 @@ jobs:
3333
path: 'docsbuild'
3434
- name: Deploy to GitHub Pages
3535
id: deployment
36-
uses: actions/deploy-pages@v2
36+
uses: actions/deploy-pages@v2

.github/workflows/test-on-docker.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,14 @@ jobs:
3636
fail-fast: false
3737
matrix:
3838
redis_version:
39-
- "8.0-M02"
39+
- "8.0-M04-pre"
4040
- "7.4.1"
4141
- "7.2.6"
4242
# - "6.2.16"
4343
steps:
44-
- uses: actions/checkout@v2
44+
- uses: actions/checkout@v4
4545
- name: Set up publishing to maven central
46-
uses: actions/setup-java@v2
46+
uses: actions/setup-java@v4
4747
with:
4848
java-version: '8'
4949
distribution: 'temurin'
@@ -53,7 +53,7 @@ jobs:
5353
sudo apt install -y make
5454
make compile-module
5555
- name: Cache dependencies
56-
uses: actions/cache@v2
56+
uses: actions/cache@v4
5757
with:
5858
path: |
5959
~/.m2/repository
@@ -124,7 +124,7 @@ jobs:
124124
continue-on-error: true
125125
# Upload code coverage
126126
- name: Upload coverage to Codecov
127-
uses: codecov/codecov-action@v4
127+
uses: codecov/codecov-action@v5
128128
with:
129129
fail_ci_if_error: false
130130
token: ${{ secrets.CODECOV_TOKEN }}

Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
PATH := ./redis-git/src:${PATH}
22

33
# Supported test env versions
4-
SUPPORTED_TEST_ENV_VERSIONS := 8.0-M02 7.4.1 7.2.6 6.2.16
5-
DEFAULT_TEST_ENV_VERSION := 8.0-M02
4+
SUPPORTED_TEST_ENV_VERSIONS := 8.0-M04-pre, 8.0-M02 7.4.1 7.2.6 6.2.16
5+
DEFAULT_TEST_ENV_VERSION := 8.0-M04-pre
66
REDIS_ENV_WORK_DIR := $(or ${REDIS_ENV_WORK_DIR},/tmp/redis-env-work)
77

88
define REDIS1_CONF

src/main/java/redis/clients/jedis/CommandObjects.java

+4
Original file line numberDiff line numberDiff line change
@@ -3531,19 +3531,23 @@ public final CommandObject<Set<String>> ftTagVals(String indexName, String field
35313531
.add(fieldName), BuilderFactory.STRING_SET);
35323532
}
35333533

3534+
@Deprecated
35343535
public final CommandObject<Map<String, Object>> ftConfigGet(String option) {
35353536
return new CommandObject<>(commandArguments(SearchCommand.CONFIG).add(SearchKeyword.GET).add(option),
35363537
protocol == RedisProtocol.RESP3 ? BuilderFactory.AGGRESSIVE_ENCODED_OBJECT_MAP : BuilderFactory.ENCODED_OBJECT_MAP_FROM_PAIRS);
35373538
}
35383539

3540+
@Deprecated
35393541
public final CommandObject<Map<String, Object>> ftConfigGet(String indexName, String option) {
35403542
return directSearchCommand(ftConfigGet(option), indexName);
35413543
}
35423544

3545+
@Deprecated
35433546
public final CommandObject<String> ftConfigSet(String option, String value) {
35443547
return new CommandObject<>(commandArguments(SearchCommand.CONFIG).add(SearchKeyword.SET).add(option).add(value), BuilderFactory.STRING);
35453548
}
35463549

3550+
@Deprecated
35473551
public final CommandObject<String> ftConfigSet(String indexName, String option, String value) {
35483552
return directSearchCommand(ftConfigSet(option, value), indexName);
35493553
}

src/main/java/redis/clients/jedis/PipeliningBase.java

+4
Original file line numberDiff line numberDiff line change
@@ -3565,21 +3565,25 @@ public Response<Set<String>> ftTagVals(String indexName, String fieldName) {
35653565
}
35663566

35673567
@Override
3568+
@Deprecated
35683569
public Response<Map<String, Object>> ftConfigGet(String option) {
35693570
return appendCommand(commandObjects.ftConfigGet(option));
35703571
}
35713572

35723573
@Override
3574+
@Deprecated
35733575
public Response<Map<String, Object>> ftConfigGet(String indexName, String option) {
35743576
return appendCommand(commandObjects.ftConfigGet(indexName, option));
35753577
}
35763578

35773579
@Override
3580+
@Deprecated
35783581
public Response<String> ftConfigSet(String option, String value) {
35793582
return appendCommand(commandObjects.ftConfigSet(option, value));
35803583
}
35813584

35823585
@Override
3586+
@Deprecated
35833587
public Response<String> ftConfigSet(String indexName, String option, String value) {
35843588
return appendCommand(commandObjects.ftConfigSet(indexName, option, value));
35853589
}

src/main/java/redis/clients/jedis/UnifiedJedis.java

+4
Original file line numberDiff line numberDiff line change
@@ -4067,21 +4067,25 @@ public Set<String> ftTagVals(String indexName, String fieldName) {
40674067
}
40684068

40694069
@Override
4070+
@Deprecated
40704071
public Map<String, Object> ftConfigGet(String option) {
40714072
return executeCommand(commandObjects.ftConfigGet(option));
40724073
}
40734074

40744075
@Override
4076+
@Deprecated
40754077
public Map<String, Object> ftConfigGet(String indexName, String option) {
40764078
return executeCommand(commandObjects.ftConfigGet(indexName, option));
40774079
}
40784080

40794081
@Override
4082+
@Deprecated
40804083
public String ftConfigSet(String option, String value) {
40814084
return executeCommand(commandObjects.ftConfigSet(option, value));
40824085
}
40834086

40844087
@Override
4088+
@Deprecated
40854089
public String ftConfigSet(String indexName, String option, String value) {
40864090
return executeCommand(commandObjects.ftConfigSet(indexName, option, value));
40874091
}

src/main/java/redis/clients/jedis/search/RediSearchCommands.java

+11
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import java.util.Map;
66
import java.util.Set;
77

8+
import redis.clients.jedis.commands.ConfigCommands;
89
import redis.clients.jedis.resps.Tuple;
910
import redis.clients.jedis.search.aggr.AggregationBuilder;
1011
import redis.clients.jedis.search.aggr.AggregationResult;
@@ -107,12 +108,22 @@ Map<String, Map<String, Double>> ftSpellCheck(String index, String query,
107108

108109
Set<String> ftTagVals(String indexName, String fieldName);
109110

111+
/**
112+
* @deprecated {@link ConfigCommands#configGet(java.lang.String)} is used since Redis 8.
113+
*/
114+
@Deprecated
110115
Map<String, Object> ftConfigGet(String option);
111116

117+
@Deprecated
112118
Map<String, Object> ftConfigGet(String indexName, String option);
113119

120+
/**
121+
* @deprecated {@link ConfigCommands#configSet(java.lang.String, java.lang.String)} is used since Redis 8.
122+
*/
123+
@Deprecated
114124
String ftConfigSet(String option, String value);
115125

126+
@Deprecated
116127
String ftConfigSet(String indexName, String option, String value);
117128

118129
long ftSugAdd(String key, String string, double score);

src/main/java/redis/clients/jedis/search/RediSearchPipelineCommands.java

+4
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,16 @@ Response<Map<String, Map<String, Double>>> ftSpellCheck(String index, String que
9595

9696
Response<Set<String>> ftTagVals(String indexName, String fieldName);
9797

98+
@Deprecated
9899
Response<Map<String, Object>> ftConfigGet(String option);
99100

101+
@Deprecated
100102
Response<Map<String, Object>> ftConfigGet(String indexName, String option);
101103

104+
@Deprecated
102105
Response<String> ftConfigSet(String option, String value);
103106

107+
@Deprecated
104108
Response<String> ftConfigSet(String indexName, String option, String value);
105109

106110
Response<Long> ftSugAdd(String key, String string, double score);

src/main/java/redis/clients/jedis/search/SearchProtocol.java

+4-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public enum SearchCommand implements ProtocolCommand {
1616
EXPLAINCLI("FT.EXPLAINCLI"),
1717
AGGREGATE("FT.AGGREGATE"),
1818
CURSOR("FT.CURSOR"),
19-
CONFIG("FT.CONFIG"),
19+
@Deprecated CONFIG("FT.CONFIG"),
2020
ALIASADD("FT.ALIASADD"),
2121
ALIASUPDATE("FT.ALIASUPDATE"),
2222
ALIASDEL("FT.ALIASDEL"),
@@ -52,11 +52,12 @@ public enum SearchKeyword implements Rawable {
5252
SCHEMA, TEXT, TAG, NUMERIC, GEO, GEOSHAPE, VECTOR, VERBATIM, NOCONTENT, NOSTOPWORDS, WITHSCORES,
5353
LANGUAGE, INFIELDS, SORTBY, ASC, DESC, LIMIT, HIGHLIGHT, FIELDS, TAGS, SUMMARIZE, FRAGS, LEN,
5454
SEPARATOR, INKEYS, RETURN, FILTER, GEOFILTER, ADD, INCR, MAX, FUZZY, READ, DEL, DD, TEMPORARY,
55-
STOPWORDS, NOFREQS, NOFIELDS, NOOFFSETS, NOHL, SET, GET, ON, SORTABLE, UNF, PREFIX,
55+
STOPWORDS, NOFREQS, NOFIELDS, NOOFFSETS, NOHL, ON, SORTABLE, UNF, PREFIX,
5656
LANGUAGE_FIELD, SCORE, SCORE_FIELD, SCORER, PARAMS, AS, DIALECT, SLOP, TIMEOUT, INORDER,
5757
EXPANDER, MAXTEXTFIELDS, SKIPINITIALSCAN, WITHSUFFIXTRIE, NOSTEM, NOINDEX, PHONETIC, WEIGHT,
5858
CASESENSITIVE, LOAD, APPLY, GROUPBY, MAXIDLE, WITHCURSOR, DISTANCE, TERMS, INCLUDE, EXCLUDE,
59-
SEARCH, AGGREGATE, QUERY, LIMITED, COUNT, REDUCE, INDEXMISSING, INDEXEMPTY, ADDSCORES;
59+
SEARCH, AGGREGATE, QUERY, LIMITED, COUNT, REDUCE, INDEXMISSING, INDEXEMPTY, ADDSCORES,
60+
@Deprecated SET, @Deprecated GET;
6061

6162
private final byte[] raw;
6263

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
// EXAMPLE: cmds_cnxmgmt
2+
// REMOVE_START
3+
package io.redis.examples;
4+
5+
import org.junit.Assert;
6+
import org.junit.Test;
7+
// REMOVE_END
8+
9+
import redis.clients.jedis.Jedis;
10+
11+
// HIDE_START
12+
public class CmdsCnxmgmtExample {
13+
@Test
14+
public void run() {
15+
// HIDE_END
16+
Jedis jedis = new Jedis("redis://localhost:6379");
17+
18+
// STEP_START auth1
19+
// REMOVE_START
20+
jedis.configSet("requirepass", "temp_pass");
21+
// REMOVE_END
22+
// Note: you must use the `Jedis` class rather than `UnifiedJedis`
23+
// to access the `auth` commands.
24+
String authResult1 = jedis.auth("default", "temp_pass");
25+
System.out.println(authResult1); // >>> OK
26+
// REMOVE_START
27+
Assert.assertEquals("OK", authResult1);
28+
jedis.configSet("requirepass", "");
29+
// REMOVE_END
30+
// STEP_END
31+
32+
// STEP_START auth2
33+
// REMOVE_START
34+
jedis.aclSetUser("test-user", "on", ">strong_password", "+acl");
35+
// REMOVE_END
36+
// Note: you must use the `Jedis` class rather than `UnifiedJedis`
37+
// to access the `auth` commands.
38+
String authResult2 = jedis.auth("test-user", "strong_password");
39+
System.out.println(authResult2); // >>> OK
40+
// REMOVE_START
41+
Assert.assertEquals("OK", authResult2);
42+
jedis.aclDelUser("test-user");
43+
// REMOVE_END
44+
// STEP_END
45+
46+
// HIDE_START
47+
}
48+
}
49+
// HIDE_END
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
// EXAMPLE: cmds_servermgmt
2+
// REMOVE_START
3+
package io.redis.examples;
4+
5+
import org.junit.Assert;
6+
import org.junit.Test;
7+
// REMOVE_END
8+
import java.util.Set;
9+
10+
import redis.clients.jedis.Jedis;
11+
// HIDE_START
12+
import redis.clients.jedis.UnifiedJedis;
13+
14+
public class CmdsServerMgmtExample {
15+
@Test
16+
public void run() {
17+
UnifiedJedis jedis = new UnifiedJedis("redis://localhost:6379");
18+
// HIDE_END
19+
20+
// STEP_START flushall
21+
// REMOVE_START
22+
jedis.set("testkey1", "1");
23+
jedis.set("testkey2", "2");
24+
jedis.set("testkey3", "3");
25+
// REMOVE_END
26+
String flushAllResult1 = jedis.flushAll();
27+
System.out.println(flushAllResult1); // >>> OK
28+
29+
Set<String> flushAllResult2 = jedis.keys("*");
30+
System.out.println(flushAllResult2); // >>> []
31+
// STEP_END
32+
// REMOVE_START
33+
Assert.assertEquals("OK", flushAllResult1);
34+
Assert.assertEquals("[]", flushAllResult2.toString());
35+
// REMOVE_END
36+
37+
// STEP_START info
38+
// Note: you must use the `Jedis` class to access the `info`
39+
// command rather than `UnifiedJedis`.
40+
Jedis jedis2 = new Jedis("redis://localhost:6379");
41+
42+
String infoResult = jedis2.info();
43+
44+
// Check the first 8 characters of the result (the full `info` string
45+
// is much longer than this).
46+
System.out.println(infoResult.substring(0, 8)); // >>> # Server
47+
48+
jedis2.close();
49+
// STEP_END
50+
// REMOVE_START
51+
Assert.assertEquals("# Server", infoResult.substring(0, 8));
52+
// REMOVE_END
53+
54+
// HIDE_START
55+
jedis.close();
56+
}
57+
}
58+
// HIDE_END

0 commit comments

Comments
 (0)