mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-01-02 10:42:36 +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
|
# build search
|
||||||
s = Search()
|
s = Search()
|
||||||
s = s.query(bool_query)
|
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]
|
s = s[:limit]
|
||||||
q = s.to_dict()
|
q = s.to_dict()
|
||||||
# search
|
# search
|
||||||
|
|||||||
Reference in New Issue
Block a user