mirror of
https://git.mirrors.martin98.com/https://github.com/infiniflow/ragflow.git
synced 2025-08-15 21:26:00 +08:00
fix es search parameter error (#3169)
### What problem does this PR solve? #3151 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
parent
c06e765a5b
commit
8d9238db14
@ -194,7 +194,6 @@ class Canvas(ABC):
|
|||||||
self.answer.append(c)
|
self.answer.append(c)
|
||||||
else:
|
else:
|
||||||
if DEBUG: print("RUN: ", c)
|
if DEBUG: print("RUN: ", c)
|
||||||
if cpn.component_name == "Generate":
|
|
||||||
cpids = cpn.get_dependent_components()
|
cpids = cpn.get_dependent_components()
|
||||||
if any([c not in self.path[-1] for c in cpids]):
|
if any([c not in self.path[-1] for c in cpids]):
|
||||||
continue
|
continue
|
||||||
|
@ -397,6 +397,10 @@ class ComponentBase(ABC):
|
|||||||
self._param = param
|
self._param = param
|
||||||
self._param.check()
|
self._param.check()
|
||||||
|
|
||||||
|
def get_dependent_components(self):
|
||||||
|
cpnts = [para["component_id"] for para in self._param.query]
|
||||||
|
return cpnts
|
||||||
|
|
||||||
def run(self, history, **kwargs):
|
def run(self, history, **kwargs):
|
||||||
flow_logger.info("{}, history: {}, kwargs: {}".format(self, json.dumps(history, ensure_ascii=False),
|
flow_logger.info("{}, history: {}, kwargs: {}".format(self, json.dumps(history, ensure_ascii=False),
|
||||||
json.dumps(kwargs, ensure_ascii=False)))
|
json.dumps(kwargs, ensure_ascii=False)))
|
||||||
|
@ -68,7 +68,7 @@ class KGSearch(Dealer):
|
|||||||
s["knn"]["filter"] = bqry.to_dict()
|
s["knn"]["filter"] = bqry.to_dict()
|
||||||
q_vec = s["knn"]["query_vector"]
|
q_vec = s["knn"]["query_vector"]
|
||||||
|
|
||||||
ent_res = self.es.search(deepcopy(s), idxnm=idxnm, timeout="600s", src=src)
|
ent_res = self.es.search(deepcopy(s), idxnms=idxnm, timeout="600s", src=src)
|
||||||
entities = [d["name_kwd"] for d in self.es.getSource(ent_res)]
|
entities = [d["name_kwd"] for d in self.es.getSource(ent_res)]
|
||||||
ent_ids = self.es.getDocIds(ent_res)
|
ent_ids = self.es.getDocIds(ent_res)
|
||||||
if merge_into_first(ent_res, "-Entities-"):
|
if merge_into_first(ent_res, "-Entities-"):
|
||||||
@ -81,7 +81,7 @@ class KGSearch(Dealer):
|
|||||||
s = Search()
|
s = Search()
|
||||||
s = s.query(bqry)[0: 32]
|
s = s.query(bqry)[0: 32]
|
||||||
s = s.to_dict()
|
s = s.to_dict()
|
||||||
comm_res = self.es.search(deepcopy(s), idxnm=idxnm, timeout="600s", src=src)
|
comm_res = self.es.search(deepcopy(s), idxnms=idxnm, timeout="600s", src=src)
|
||||||
comm_ids = self.es.getDocIds(comm_res)
|
comm_ids = self.es.getDocIds(comm_res)
|
||||||
if merge_into_first(comm_res, "-Community Report-"):
|
if merge_into_first(comm_res, "-Community Report-"):
|
||||||
comm_ids = comm_ids[0:1]
|
comm_ids = comm_ids[0:1]
|
||||||
@ -92,7 +92,7 @@ class KGSearch(Dealer):
|
|||||||
s = Search()
|
s = Search()
|
||||||
s = s.query(bqry)[0: 6]
|
s = s.query(bqry)[0: 6]
|
||||||
s = s.to_dict()
|
s = s.to_dict()
|
||||||
txt_res = self.es.search(deepcopy(s), idxnm=idxnm, timeout="600s", src=src)
|
txt_res = self.es.search(deepcopy(s), idxnms=idxnm, timeout="600s", src=src)
|
||||||
txt_ids = self.es.getDocIds(txt_res)
|
txt_ids = self.es.getDocIds(txt_res)
|
||||||
if merge_into_first(txt_res, "-Original Content-"):
|
if merge_into_first(txt_res, "-Original Content-"):
|
||||||
txt_ids = txt_ids[0:1]
|
txt_ids = txt_ids[0:1]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user