Stefan Hesse
03/13/2023, 1:51 PM---------- Search parameters
{'q': '*', 'query_by': 'name', 'sort_by': '_eval(id:1):asc,pop:desc'}
---------- Query output
{'facet_counts': [],
'found': 2,
'hits': [{'document': {'id': '0', 'name': 'a', 'pop': 1},
'highlight': {},
'highlights': []},
{'document': {'id': '1', 'name': 'b', 'pop': 0},
'highlight': {},
'highlights': []}],
'out_of': 2,
'page': 1,
'request_params': {'collection_name': 'test_collection',
'per_page': 10,
'q': '*'},
'search_cutoff': False,
'search_time_ms': 0}
So in the case above I'd expect name: 'b' to be the first document, because it matches the _eval() condition, and 'a' the second, but that doesn't seem to be the case.
Am I misunderstanding the feature? Changing _eval(xxx):asc to desc doesn't change the output.
I made a little reproduction repo so you can see the exact configuration: https://github.com/reinoldus/typesense-reproduction-repoKishore Nallan
03/13/2023, 1:53 PMStefan Hesse
03/13/2023, 1:56 PMStefan Hesse
03/13/2023, 1:58 PM---------- Search parameters
{'q': '*',
'query_by': 'name',
'sort_by': '_eval(other_field:test):desc,pop:desc'}
---------- Query output
{'facet_counts': [],
'found': 2,
'hits': [{'document': {'id': '1',
'name': 'b',
'other_field': 'test',
'pop': 0},
'highlight': {},
'highlights': []},
{'document': {'id': '0',
'name': 'a',
'other_field': 'not_test',
'pop': 1},
'highlight': {},
'highlights': []}],
'out_of': 2,
'page': 1,
'request_params': {'collection_name': 'test_collection',
'per_page': 10,
'q': '*'},
'search_cutoff': False,
'search_time_ms': 0}
Kishore Nallan
03/13/2023, 1:59 PMStefan Hesse
03/13/2023, 2:06 PMKishore Nallan
03/13/2023, 2:19 PMStefan Hesse
03/13/2023, 2:24 PM