Skip to content

Commit

Permalink
fix: disable redis search limit feature
Browse files Browse the repository at this point in the history
  • Loading branch information
favoyang committed Oct 23, 2022
1 parent 28b6430 commit 7e2d375
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,11 @@ export default class RedisStorage implements IPluginStorage<RedisConfig> {
// Redis-search treats hyphen as separator, refs https://forum.redis.com/t/query-with-dash-is-treated-as-negation/119
const text = (query.text || "").replace(/-/g, ' ').trim();
if (!text) return [];
const offset = query.from || 0;
const num = query.size || 250;
// const offset = query.from || 0;
// const num = query.size || 250;
try {
const result: any = await this.redisClient.call("FT.SEARCH", "ve-pkg-stat-idx", text, "return", "1", "stat", "LIMIT", String(offset), String(num));
const result: any = await this.redisClient.call("FT.SEARCH", "ve-pkg-stat-idx", text, "return", "1", "stat");
// const result: any = await this.redisClient.call("FT.SEARCH", "ve-pkg-stat-idx", text, "return", "1", "stat", "LIMIT", String(offset), String(num));
const searchResult: any = [];
if (result.length <= 1) return [];
for (let i = 2; i < result.length; i += 2) {
Expand Down

0 comments on commit 7e2d375

Please sign in to comment.