Skip to content

Commit

Permalink
fix slop when no diff between offsets + test (#1605)
Browse files Browse the repository at this point in the history
unclear why there
  • Loading branch information
ashtul committed Oct 12, 2020
1 parent 91bb743 commit 9de8286
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/index_result.c
Expand Up @@ -258,7 +258,6 @@ int IndexResult_MinOffsetDelta(const RSIndexResult *r) {
}
if (i == num) {
v1.Free(v1.ctx);
dist = dist ? dist : 100;
break;
}
v2 = RSIndexResult_IterateOffsets(agg->children[i]);
Expand Down
9 changes: 9 additions & 0 deletions tests/pytests/test_issues.py
Expand Up @@ -37,3 +37,12 @@ def test_1502(env):

env.expect('ft.search idx1 *').equal([0L])
env.expect('ft.search idx2 *').equal([1L, 'a', ['bar', 'hello']])

def test_1601(env):
conn = getConnectionByEnv(env)
conn.execute_command('FT.CREATE', 'idx:movie', 'SCHEMA', 'title', 'TEXT')
conn.execute_command('HSET', 'movie:1', 'title', 'Star Wars: Episode I - The Phantom Menace')
conn.execute_command('HSET', 'movie:2', 'title', 'Star Wars: Episodes II - Attack of the Clones')
conn.execute_command('HSET', 'movie:3', 'title', 'Star Wars: Episode III - Revenge of the Sith')
res = env.cmd('ft.search idx:movie @title:(episode) withscores nocontent')
env.assertEqual(toSortedFlatList(res), toSortedFlatList([3L, 'movie:3', '2', 'movie:1', '2', 'movie:2', '1']))

0 comments on commit 9de8286

Please sign in to comment.