mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-30 00:32:30 +08:00
Fix: order by when pick msg to rm (#12247)
### What problem does this PR solve? Fix orde by when pick msg to remove. ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) --------- Co-authored-by: Liu An <asiro@qq.com>
This commit is contained in:
@ -248,7 +248,15 @@ class ESConnection(ESConnectionBase):
|
||||
# build search
|
||||
s = Search()
|
||||
s = s.query(bool_query)
|
||||
s = s.sort(order_by)
|
||||
orders = list()
|
||||
for field, order in order_by.fields:
|
||||
order = "asc" if order == 0 else "desc"
|
||||
if field.endswith("_int") or field.endswith("_flt"):
|
||||
order_info = {"order": order, "unmapped_type": "float"}
|
||||
else:
|
||||
order_info = {"order": order, "unmapped_type": "text"}
|
||||
orders.append({field: order_info})
|
||||
s = s.sort(*orders)
|
||||
s = s[:limit]
|
||||
q = s.to_dict()
|
||||
# search
|
||||
|
||||
Reference in New Issue
Block a user