Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
<dependency>
<groupId>redis.clients</groupId>
<artifactId>jedis</artifactId>
<version>3.3.0</version>
<version>3.4.1</version>
</dependency>
</dependencies>

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/io/redisearch/client/Client.java
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ private static void handleListMapping(List<Object> items, KVHandler handler, boo
for (int i = 0; i < items.size(); i += 2) {
String key = SafeEncoder.encode((byte[]) items.get(i));
Object val = items.get(i + 1);
if (decode && val instanceof byte[]) {
val = SafeEncoder.encode((byte[]) val);
if (decode /*&& val instanceof byte[]*/) {
val = SafeEncoder.encodeObject(val);
}
handler.apply(key, val);
}
Expand Down
25 changes: 22 additions & 3 deletions src/test/java/io/redisearch/client/ClientTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -522,8 +522,8 @@ public void testAlterAdd() throws Exception {

Map<String, Object> info = cl.getInfo();
assertEquals(TEST_INDEX, info.get("index_name"));
assertEquals("tags", SafeEncoder.encode(((List<List<byte[]>>)info.get("fields")).get(1).get(0)));
assertEquals("TAG", SafeEncoder.encode(((List<List<byte[]>>)info.get("fields")).get(1).get(2)));
assertEquals("tags",((List)((List)info.get("fields")).get(1)).get(0));
assertEquals("TAG", ((List)((List)info.get("fields")).get(1)).get(2));
}

@Test
Expand Down Expand Up @@ -581,12 +581,31 @@ public void testPhoneticMatch() throws Exception {
public void testInfo() throws Exception {
Client cl = getClient();

Schema sc = new Schema().addTextField("title", 1.0);
String MOVIE_ID = "movie_id";
String TITLE = "title";
String GENRE = "genre";
String VOTES = "votes";
String RATING = "rating";
String RELEASE_YEAR = "release_year";
String PLOT = "plot";
String POSTER = "poster";

Schema sc = new Schema()
.addTextField(TITLE, 5.0)
.addSortableTextField(PLOT, 1.0)
.addSortableTagField(GENRE, ",")
.addSortableNumericField(RELEASE_YEAR)
.addSortableNumericField(RATING)
.addSortableNumericField(VOTES);

assertTrue(cl.createIndex(sc, Client.IndexOptions.defaultOptions()));

Map<String, Object> info = cl.getInfo();
assertEquals(TEST_INDEX, info.get("index_name"));

assertEquals(6, ((List)info.get("fields")).size());
assertEquals("global_idle", ((List)info.get("cursor_stats")).get(0));
assertEquals(0L, ((List)info.get("cursor_stats")).get(1));
}

@Test
Expand Down