【发布时间】:2015-09-28 14:46:31
【问题描述】:
在 REDIS CLI 中执行时,以下命令返回预期结果(位置名称前缀为“new alban”)。
127.0.0.1:6379> zrangebylex my_places_data_set "[new alban" "[new alban\xff"
- “新奥尔巴尼...”
- “新奥尔巴尼...”
- “新奥尔巴尼河...”
但是,当使用 jedis api 调用此命令时,它不会返回上述前缀的任何结果,但如果我完成单词则返回。
没有结果 - 管道。zrangeByLex(my_places_data_set, "[new alban", "[new alban\xff", 0, 5); em>
返回结果 - 管道。zrangeByLex(my_places_data_set, "[new albany", "[new albany\xff", 0, 5); em>
如果我使用 xff 而不是 \xff 会发生以下情况
没有结果 - 管道。zrangeByLex(my_places_data_set, "[new alban", "[new albanxff", 0, 5);
返回结果 - 管道。zrangeByLex(my_places_data_set, "[new albany", "[new albanyxff", 0, 5);
返回结果 - 管道。zrangeByLex(my_places_data_set, "[new albany", "[new albaxff", 0, 5);
附: Jedis api 签名:zrangeByLex(String key, String min, String max, int offset, int count)
【问题讨论】: