|
|
@@ -664,7 +664,7 @@ public class VideoSearchServiceImpl implements VideoSearchService {
|
|
|
|
|
|
// 转化为强类型返回格式
|
|
|
for (VideoMatch match : filteredMatches) {
|
|
|
- result.add(new VideoMatchResult(cfgCode, match.getVideoId(), match.getScore()));
|
|
|
+ result.add(new VideoMatchResult(cfgCode, match.getVideoId(), match.getScore(), match.getText()));
|
|
|
}
|
|
|
|
|
|
log.info("配置 {} 搜索完成,返回 {} 条结果", cfgCode, filteredMatches.size());
|
|
|
@@ -698,7 +698,7 @@ public class VideoSearchServiceImpl implements VideoSearchService {
|
|
|
List<VideoMatch> filteredMatches = filterByAuditStatus(matches, topN);
|
|
|
List<VideoMatchResult> result = new ArrayList<>(filteredMatches.size());
|
|
|
for (VideoMatch match : filteredMatches) {
|
|
|
- result.add(new VideoMatchResult(configCode, match.getVideoId(), match.getScore()));
|
|
|
+ result.add(new VideoMatchResult(configCode, match.getVideoId(), match.getScore(), match.getText()));
|
|
|
}
|
|
|
// 填充视频详情
|
|
|
enrichVideoDetail(result);
|
|
|
@@ -777,7 +777,9 @@ public class VideoSearchServiceImpl implements VideoSearchService {
|
|
|
Long videoId = match.getVideoId();
|
|
|
VideoMatch existing = deduped.get(videoId);
|
|
|
if (existing == null || match.getScore() > existing.getScore()) {
|
|
|
- deduped.put(videoId, new VideoMatch(videoId, match.getScore(), configCode));
|
|
|
+ VideoMatch best = new VideoMatch(videoId, match.getScore(), configCode);
|
|
|
+ best.setText(match.getText());
|
|
|
+ deduped.put(videoId, best);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -791,7 +793,7 @@ public class VideoSearchServiceImpl implements VideoSearchService {
|
|
|
private List<DeconstructVectorConfig> getEnabledConfigs() {
|
|
|
try {
|
|
|
DeconstructVectorConfigExample example = new DeconstructVectorConfigExample();
|
|
|
- example.createCriteria().andEnabledEqualTo((short) 1).andSourceFieldEqualTo("result_json");
|
|
|
+ example.createCriteria().andEnabledEqualTo((short) 1);
|
|
|
example.setOrderByClause("priority ASC");
|
|
|
List<DeconstructVectorConfig> configs = deconstructVectorConfigMapper.selectByExample(example);
|
|
|
return configs != null ? configs : Collections.emptyList();
|