(improvement)(headless) Headless integration embedding functionality, with support for viewId in embeddings. (#725)

This commit is contained in:
lexluo09
2024-02-12 22:44:25 +08:00
committed by GitHub
parent 329ad327b0
commit 39158d6877
17 changed files with 239 additions and 112 deletions

View File

@@ -97,12 +97,12 @@ public class SearchServiceImpl implements SearchService {
List<S2Term> originals = knowledgeService.getTerms(queryText);
log.info("hanlp parse result: {}", originals);
MapperHelper mapperHelper = ContextUtils.getBean(MapperHelper.class);
Set<Long> detectModelIds = mapperHelper.getViewIds(queryReq.getModelId(), agentService.getAgent(agentId));
Set<Long> detectViewIds = mapperHelper.getViewIds(queryReq.getModelId(), agentService.getAgent(agentId));
QueryContext queryContext = new QueryContext();
BeanUtils.copyProperties(queryReq, queryContext);
Map<MatchText, List<HanlpMapResult>> regTextMap =
searchMatchStrategy.match(queryContext, originals, detectModelIds);
searchMatchStrategy.match(queryContext, originals, detectViewIds);
regTextMap.entrySet().stream().forEach(m -> HanlpHelper.transLetterOriginal(m.getValue()));
// 4.get the most matching data