Skip to content

Commit 8b2c16b

Browse files
committed
Add indexes_all field for index_definition
Signed-off-by: hwware <[email protected]>
1 parent 7b759eb commit 8b2c16b

File tree

2 files changed

+19
-11
lines changed

2 files changed

+19
-11
lines changed

src/index_schema.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -718,7 +718,7 @@ void IndexSchema::RespondWithInfo(ValkeyModuleCtx *ctx) const {
718718
ValkeyModule_ReplyWithArray(ctx, 0);
719719

720720
ValkeyModule_ReplyWithSimpleString(ctx, "index_definition");
721-
ValkeyModule_ReplyWithArray(ctx, 6);
721+
ValkeyModule_ReplyWithArray(ctx, 8);
722722
ValkeyModule_ReplyWithSimpleString(ctx, "key_type");
723723
ValkeyModule_ReplyWithSimpleString(ctx,
724724
attribute_data_type_->ToString().c_str());
@@ -731,6 +731,9 @@ void IndexSchema::RespondWithInfo(ValkeyModuleCtx *ctx) const {
731731
// supported.
732732
ValkeyModule_ReplyWithSimpleString(ctx, "default_score");
733733
ValkeyModule_ReplyWithCString(ctx, "1");
734+
ValkeyModule_ReplyWithSimpleString(ctx, "indexes_all");
735+
ValkeyModule_ReplyWithSimpleString(ctx, "false");
736+
734737

735738
ValkeyModule_ReplyWithSimpleString(ctx, "attributes");
736739
ValkeyModule_ReplyWithArray(ctx, VALKEYMODULE_POSTPONED_ARRAY_LEN);

testing/ft_info_test.cc

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,10 @@ INSTANTIATE_TEST_SUITE_P(
135135
.expect_return_failure = false,
136136
.expected_output =
137137
"*34\r\n+index_name\r\n+test_name\r\n+index_"
138-
"options\r\n*0\r\n+index_definition\r\n*6\r\n+key_"
138+
"options\r\n*0\r\n+index_definition\r\n*8\r\n+key_"
139139
"type\r\n+HASH\r\n+prefixes\r\n*1\r\n+prefix_1\r\n+"
140-
"default_score\r\n$1\r\n1\r\n+attributes\r\n*1\r\n*"
140+
"default_score\r\n$1\r\n1\r\n+indexes_all\r\n+false\r\n+"
141+
"attributes\r\n*1\r\n*"
141142
"8\r\n+identifier\r\n+test_identifier_1\r\n+"
142143
"attribute\r\n+test_attribute_1\r\n+type\r\n+"
143144
"VECTOR\r\n+index\r\n*12\r\n+capacity\r\n:100\r\n+"
@@ -199,9 +200,10 @@ INSTANTIATE_TEST_SUITE_P(
199200
.expect_return_failure = false,
200201
.expected_output =
201202
"*34\r\n+index_name\r\n+test_name\r\n+index_"
202-
"options\r\n*0\r\n+index_definition\r\n*6\r\n+key_"
203+
"options\r\n*0\r\n+index_definition\r\n*8\r\n+key_"
203204
"type\r\n+HASH\r\n+prefixes\r\n*1\r\n+prefix_1\r\n+"
204-
"default_score\r\n$1\r\n1\r\n+attributes\r\n*1\r\n*"
205+
"default_score\r\n$1\r\n1\r\n+indexes_all\r\n+false\r\n+"
206+
"attributes\r\n*1\r\n*"
205207
"8\r\n+identifier\r\n+test_identifier_1\r\n+"
206208
"attribute\r\n+test_attribute_1\r\n+type\r\n+"
207209
"VECTOR\r\n+index\r\n*12\r\n+capacity\r\n:100\r\n+"
@@ -255,9 +257,10 @@ INSTANTIATE_TEST_SUITE_P(
255257
.expect_return_failure = false,
256258
.expected_output =
257259
"*34\r\n+index_name\r\n+test_name\r\n+index_"
258-
"options\r\n*0\r\n+index_definition\r\n*6\r\n+key_"
260+
"options\r\n*0\r\n+index_definition\r\n*8\r\n+key_"
259261
"type\r\n+HASH\r\n+prefixes\r\n*1\r\n+prefix_1\r\n+"
260-
"default_score\r\n$1\r\n1\r\n+attributes\r\n*1\r\n*"
262+
"default_score\r\n$1\r\n1\r\n+indexes_all\r\n+false\r\n+"
263+
"attributes\r\n*1\r\n*"
261264
"10\r\n+identifier\r\n+test_identifier_1\r\n+"
262265
"attribute\r\n+test_attribute_1\r\n+type\r\n+"
263266
"TAG\r\n+SEPARATOR\r\n+@\r\n+size\r\n$1\r\n0\r\n+"
@@ -308,9 +311,10 @@ INSTANTIATE_TEST_SUITE_P(
308311
.expect_return_failure = false,
309312
.expected_output =
310313
"*34\r\n+index_name\r\n+test_name\r\n+index_"
311-
"options\r\n*0\r\n+index_definition\r\n*6\r\n+key_"
314+
"options\r\n*0\r\n+index_definition\r\n*8\r\n+key_"
312315
"type\r\n+HASH\r\n+prefixes\r\n*1\r\n+prefix_1\r\n+"
313-
"default_score\r\n$1\r\n1\r\n+attributes\r\n*1\r\n*"
316+
"default_score\r\n$1\r\n1\r\n+indexes_all\r\n+false\r\n+"
317+
"attributes\r\n*1\r\n*"
314318
"11\r\n+identifier\r\n+test_identifier_1\r\n+"
315319
"attribute\r\n+test_attribute_1\r\n+type\r\n+"
316320
"TAG\r\n+SEPARATOR\r\n+@\r\n+CASESENSITIVE\r\n+"
@@ -359,9 +363,10 @@ INSTANTIATE_TEST_SUITE_P(
359363
.expect_return_failure = false,
360364
.expected_output =
361365
"*34\r\n+index_name\r\n+test_name\r\n+index_"
362-
"options\r\n*0\r\n+index_definition\r\n*6\r\n+key_"
366+
"options\r\n*0\r\n+index_definition\r\n*8\r\n+key_"
363367
"type\r\n+HASH\r\n+prefixes\r\n*1\r\n+prefix_1\r\n+"
364-
"default_score\r\n$1\r\n1\r\n+attributes\r\n*1\r\n*"
368+
"default_score\r\n$1\r\n1\r\n+indexes_all\r\n+false\r\n+"
369+
"attributes\r\n*1\r\n*"
365370
"8\r\n+identifier\r\n+test_identifier_1\r\n+"
366371
"attribute\r\n+test_attribute_1\r\n+type\r\n+"
367372
"NUMERIC\r\n+size\r\n$1\r\n0\r\n+num_docs\r\n$"

0 commit comments

Comments
 (0)