mirror of
https://git.mirrors.martin98.com/https://github.com/infiniflow/ragflow.git
synced 2025-08-12 08:49:05 +08:00
Fixed infinity exception SCORE() / SCORE_FACTORS() requires Fusion or MATCH TEXT or MATCH TENSOR (#4110)
### What problem does this PR solve? Fixed infinity exception SCORE() / SCORE_FACTORS() requires Fusion or MATCH TEXT or MATCH TENSOR. Close #4109 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
parent
561eeabfa4
commit
57c99dd811
@ -247,9 +247,12 @@ class InfinityConnection(DocStoreConnection):
|
|||||||
db_instance = inf_conn.get_database(self.dbName)
|
db_instance = inf_conn.get_database(self.dbName)
|
||||||
df_list = list()
|
df_list = list()
|
||||||
table_list = list()
|
table_list = list()
|
||||||
for essential_field in ["id", "score()", "pagerank_fea"]:
|
for essential_field in ["id"]:
|
||||||
if essential_field not in selectFields:
|
if essential_field not in selectFields:
|
||||||
selectFields.append(essential_field)
|
selectFields.append(essential_field)
|
||||||
|
if matchExprs:
|
||||||
|
for essential_field in ["score()", "pagerank_fea"]:
|
||||||
|
selectFields.append(essential_field)
|
||||||
|
|
||||||
# Prepare expressions common to all tables
|
# Prepare expressions common to all tables
|
||||||
filter_cond = None
|
filter_cond = None
|
||||||
@ -337,7 +340,8 @@ class InfinityConnection(DocStoreConnection):
|
|||||||
df_list.append(kb_res)
|
df_list.append(kb_res)
|
||||||
self.connPool.release_conn(inf_conn)
|
self.connPool.release_conn(inf_conn)
|
||||||
res = concat_dataframes(df_list, selectFields)
|
res = concat_dataframes(df_list, selectFields)
|
||||||
res = res.sort(pl.col("SCORE") + pl.col("pagerank_fea"), descending=True, maintain_order=True)
|
if matchExprs:
|
||||||
|
res = res.sort(pl.col("SCORE") + pl.col("pagerank_fea"), descending=True, maintain_order=True)
|
||||||
res = res.limit(limit)
|
res = res.limit(limit)
|
||||||
logger.debug(f"INFINITY search final result: {str(res)}")
|
logger.debug(f"INFINITY search final result: {str(res)}")
|
||||||
return res, total_hits_count
|
return res, total_hits_count
|
||||||
|
Loading…
x
Reference in New Issue
Block a user