RediSearch / RediSearch

A query and indexing engine for Redis, providing secondary indexing, full-text search, vector similarity search and aggregations.
https://redis.io/docs/stack/search/
Other
5.43k stars 517 forks source link

Coordinater: sortby asc: First result doesn't contain the sortby field #3457

Closed meiravgri closed 1 year ago

meiravgri commented 1 year ago
    conn = getConnectionByEnv(env)

    conn.execute_command('FT.CREATE', 'idx', 'SCHEMA', 'numval', 'NUMERIC' , 'sortable',
                                              'text', 'TEXT', 'sortable')

    conn.execute_command('HSET', 'key1', 'numval', '110')
    conn.execute_command('HSET', 'key2', 'numval', '109')
    conn.execute_command('HSET', 'key5', 'text', 'Meow')

    res = env.execute_command('FT.SEARCH', 'idx', '*', 'sortby', 'numval', 'ASC')

yields: [3, 'key5', ['text', 'Meow'], 'key2', ['numval', '109'], 'key1', ['numval', '110']]

*** Notes:

  1. If one of the fields is not sortable (no matter which of them) the result is correct: [3, 'key2', ['numval', '109'], 'key1', ['numval', '110'], 'key5', ['text', 'Meow']]
  2. DESC works fine [3, 'key1', ['numval', '110'], 'key2', ['numval', '109'], 'key5', ['text', 'Meow']]
meiravgri commented 1 year ago

After fixing this bug remove skipping on cluster in test_search_params:aliasing added in this PR: https://github.com/RediSearch/RediSearch/pull/3451

oshadmi commented 1 year ago

Related #2979