|
@@ -158,26 +158,13 @@ public class EsDenseVectorService {
|
|
|
SearchResponse<PatentVector> response = client.search(builder.build(), PatentVector.class);
|
|
|
List<Hit<PatentVector>> hits = response.hits().hits();
|
|
|
List<EsPatentVectorVo> vectorVos = new ArrayList<>();
|
|
|
- Double fixedScore = 1.7d;
|
|
|
for (Hit<PatentVector> hit : hits) {
|
|
|
- if (!CollectionUtils.isEmpty(imageList)) {
|
|
|
- Double score = hit.score();
|
|
|
- if (score > fixedScore) {
|
|
|
- PatentVector vector = hit.source();
|
|
|
- EsPatentVectorVo vectorVo = new EsPatentVectorVo();
|
|
|
- BeanUtil.copy(vector, vectorVo);
|
|
|
- PatentColumnDTO columnDTO = esPatentService.selectPatentByAppNo(vector.getAppNo());
|
|
|
- vectorVo.setPatentNo(columnDTO.getPatentNo());
|
|
|
- vectorVos.add(vectorVo);
|
|
|
- }
|
|
|
- } else {
|
|
|
- PatentVector vector = hit.source();
|
|
|
- EsPatentVectorVo vectorVo = new EsPatentVectorVo();
|
|
|
- BeanUtil.copy(vector, vectorVo);
|
|
|
- PatentColumnDTO columnDTO = esPatentService.selectPatentByAppNo(vector.getAppNo());
|
|
|
- vectorVo.setPatentNo(columnDTO.getPatentNo());
|
|
|
- vectorVos.add(vectorVo);
|
|
|
- }
|
|
|
+ PatentVector vector = hit.source();
|
|
|
+ EsPatentVectorVo vectorVo = new EsPatentVectorVo();
|
|
|
+ BeanUtil.copy(vector, vectorVo);
|
|
|
+ PatentColumnDTO columnDTO = esPatentService.selectPatentByAppNo(vector.getAppNo());
|
|
|
+ vectorVo.setPatentNo(columnDTO.getPatentNo());
|
|
|
+ vectorVos.add(vectorVo);
|
|
|
}
|
|
|
|
|
|
Aggregate aggregate = response.aggregations().get("count");
|
|
@@ -186,8 +173,7 @@ public class EsDenseVectorService {
|
|
|
records.setCurrent(pageNum);
|
|
|
records.setSize(pageSize);
|
|
|
records.setData(vectorVos);
|
|
|
- long count = total >= vectorVos.size() ? total : vectorVos.size();
|
|
|
- records.setTotal(count);
|
|
|
+ records.setTotal(total);
|
|
|
|
|
|
if (Boolean.TRUE.equals(ifAddSearchRecord)) {
|
|
|
//添加检索历史
|
|
@@ -203,7 +189,7 @@ public class EsDenseVectorService {
|
|
|
if (!CollectionUtils.isEmpty(getGuids)) {
|
|
|
recordDTO.setGuid(getGuids.get(0));
|
|
|
}
|
|
|
- recordDTO.setAllNum(Integer.parseInt(String.valueOf(count)));
|
|
|
+ recordDTO.setAllNum(Integer.parseInt(String.valueOf(total)));
|
|
|
recordDTO.setSearchTime(new Date());
|
|
|
searchRecordService.addSearchRecord(recordDTO);
|
|
|
}
|