mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-07-05 19:08:38 +08:00
Actual behavior
When using OceanBase as storage, the list_chunk sorting is abnormal. The
following is the SQL statement.
SELECT id, content_with_weight, important_kwd, question_kwd, img_id,
available_int, position_int, doc_type_kwd, create_timestamp_flt,
create_time, array_to_string(page_num_int, ',') AS page_num_int_sort,
array_to_string(top_int, ',') AS top_int_sort FROM
rag_store_284250730805059584 WHERE doc_id = '' AND kb_id IN ('') ORDER
BY page_num_int_sort ASC, top_int_sort ASC, create_timestamp_flt DESC
LIMIT 0, 20
<img width="1610" height="740" alt="image"
src="https://github.com/user-attachments/assets/84e14c30-a97f-4e8f-8c8c-6ccac915d97d"
/>
Co-authored-by: Aron.Yao <yaowei@yaoweideMacBook-Pro.local>
This commit is contained in:
@@ -897,7 +897,7 @@ async def insert_chunks(task_id, task_tenant_id, task_dataset_id, chunks, progre
|
||||
flds = list(mom_ck.keys())
|
||||
for fld in flds:
|
||||
if fld not in ["id", "content_with_weight", "doc_id", "docnm_kwd", "kb_id", "available_int",
|
||||
"position_int"]:
|
||||
"position_int", "create_timestamp_flt", "page_num_int", "top_int"]:
|
||||
del mom_ck[fld]
|
||||
mothers.append(mom_ck)
|
||||
|
||||
|
||||
@@ -986,7 +986,7 @@ class OBConnection(OBConnectionBase):
|
||||
for field, order in order_by.fields:
|
||||
if isinstance(column_types[field], ARRAY):
|
||||
f = field + "_sort"
|
||||
fields_expr += f", array_to_string({field}, ',') AS {f}"
|
||||
fields_expr += f", array_avg({field}) AS {f}"
|
||||
field = f
|
||||
order = "ASC" if order == 0 else "DESC"
|
||||
orders.append(f"{field} {order}")
|
||||
|
||||
Reference in New Issue
Block a user