add search TAB backend api (#2375)

### What problem does this PR solve?
 #2247

### Type of change

- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
Kevin Hu
2024-09-11 19:49:18 +08:00
committed by GitHub
parent 8052cbc70e
commit 333608a1d4
6 changed files with 117 additions and 16 deletions

View File

@ -23,7 +23,7 @@ from rag.nlp.search import Dealer
class KGSearch(Dealer):
def search(self, req, idxnm, emb_mdl=None):
def search(self, req, idxnm, emb_mdl=None, highlight=False):
def merge_into_first(sres, title=""):
df,texts = [],[]
for d in sres["hits"]["hits"]: