Fix ORDER BY (score, id) error in api/core/rag/datasource/vdb/analyticdb/analyticdb_vector_sql.py line 249 (#18252)
This commit is contained in:
@@ -246,7 +246,7 @@ class AnalyticdbVectorBySql:
|
|||||||
ts_rank(to_tsvector, to_tsquery_from_text(%s, 'zh_cn'), 32) AS score
|
ts_rank(to_tsvector, to_tsquery_from_text(%s, 'zh_cn'), 32) AS score
|
||||||
FROM {self.table_name}
|
FROM {self.table_name}
|
||||||
WHERE to_tsvector@@to_tsquery_from_text(%s, 'zh_cn') {where_clause}
|
WHERE to_tsvector@@to_tsquery_from_text(%s, 'zh_cn') {where_clause}
|
||||||
ORDER BY (score,id) DESC
|
ORDER BY score DESC, id DESC
|
||||||
LIMIT {top_k}""",
|
LIMIT {top_k}""",
|
||||||
(f"'{query}'", f"'{query}'"),
|
(f"'{query}'", f"'{query}'"),
|
||||||
)
|
)
|
||||||
|
Reference in New Issue
Block a user