|
|
@@ -56,7 +56,7 @@ public class MaterialSearchServiceImpl implements MaterialSearchService {
|
|
|
private EmbeddingService embeddingService;
|
|
|
|
|
|
@Resource
|
|
|
- private ContentVectorMapperExt contentVectorMapper;
|
|
|
+ private ContentVectorMapperExt contentVectorMapperExt;
|
|
|
|
|
|
// ================================================================ 入库
|
|
|
@Override
|
|
|
@@ -214,7 +214,7 @@ public class MaterialSearchServiceImpl implements MaterialSearchService {
|
|
|
|
|
|
// 搜索 content_vectors
|
|
|
String queryVectorStr = queryVector.toString();
|
|
|
- List<ContentVector> matches = contentVectorMapper.searchTopNByCosine(
|
|
|
+ List<ContentVector> matches = contentVectorMapperExt.searchTopNByCosine(
|
|
|
cfgCode, queryVectorStr, candidateSize);
|
|
|
|
|
|
if (CollectionUtils.isEmpty(matches)) {
|
|
|
@@ -334,9 +334,9 @@ public class MaterialSearchServiceImpl implements MaterialSearchService {
|
|
|
}
|
|
|
List<ContentVector> vectors;
|
|
|
if (StringUtils.hasText(configCode)) {
|
|
|
- vectors = contentVectorMapper.selectByContentIdAndConfigCode(content.getId(), configCode);
|
|
|
+ vectors = contentVectorMapperExt.selectByContentIdAndConfigCode(content.getId(), configCode);
|
|
|
} else {
|
|
|
- vectors = contentVectorMapper.selectByContentId(content.getId());
|
|
|
+ vectors = contentVectorMapperExt.selectByContentId(content.getId());
|
|
|
}
|
|
|
if (vectors == null || vectors.isEmpty()) {
|
|
|
return null;
|
|
|
@@ -363,9 +363,9 @@ public class MaterialSearchServiceImpl implements MaterialSearchService {
|
|
|
try {
|
|
|
ContentVector cached;
|
|
|
if (StringUtils.hasText(configCode)) {
|
|
|
- cached = contentVectorMapper.selectByTextHashAndConfigCode(textHash, configCode);
|
|
|
+ cached = contentVectorMapperExt.selectByTextHashAndConfigCode(textHash, configCode);
|
|
|
} else {
|
|
|
- cached = contentVectorMapper.selectByTextHash(textHash);
|
|
|
+ cached = contentVectorMapperExt.selectByTextHash(textHash);
|
|
|
}
|
|
|
if (cached != null && StringUtils.hasText(cached.getEmbedding())) {
|
|
|
return VectorUtils.parseVectorString(cached.getEmbedding());
|