Selaa lähdekoodia

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)
tags/v0.15.1
Zhichang Yu 10 kuukautta sitten
vanhempi
commit
57c99dd811
No account linked to committer's email address
1 muutettua tiedostoa jossa 6 lisäystä ja 2 poistoa
  1. 6
    2
      rag/utils/infinity_conn.py

+ 6
- 2
rag/utils/infinity_conn.py Näytä tiedosto

@@ -247,9 +247,12 @@ class InfinityConnection(DocStoreConnection):
db_instance = inf_conn.get_database(self.dbName)
df_list = list()
table_list = list()
for essential_field in ["id", "score()", "pagerank_fea"]:
for essential_field in ["id"]:
if essential_field not in selectFields:
selectFields.append(essential_field)
if matchExprs:
for essential_field in ["score()", "pagerank_fea"]:
selectFields.append(essential_field)

# Prepare expressions common to all tables
filter_cond = None
@@ -337,7 +340,8 @@ class InfinityConnection(DocStoreConnection):
df_list.append(kb_res)
self.connPool.release_conn(inf_conn)
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)
logger.debug(f"INFINITY search final result: {str(res)}")
return res, total_hits_count

Loading…
Peruuta
Tallenna