peng
3 天以前 aac2321d1cf5536f7ea03f30d55a4aba30fbf710
framework/src/main/java/cn/lili/modules/lmk/service/impl/VideoEsServiceImpl.java
@@ -108,7 +108,6 @@
        }
        // 2. 多线程查询视频数据,构建文档对象
        Long totalVideo = new LambdaQueryChainWrapper<>(videoMapper)
                .eq(Video::getStatus, VideoStatusEnum.PUBLISHED.getValue())
                .count();
        int totalThreads = (int) Math.ceil((double) totalVideo / 200); // 计算需要多少个线程
        CountDownLatch latch = new CountDownLatch(totalThreads);
@@ -155,15 +154,17 @@
    }
    @Override
    public void addOrUpdateDocument(String indexName, String id, Object data) {
        indexName = this.getIndexFullName(indexName);
        IndexRequest request = new IndexRequest(indexName);
        request.id(id).source(data);
        try {
            client.index(request, RequestOptions.DEFAULT);
        } catch (IOException e) {
            throw new RuntimeException("es文档添加/修改失败", e);
        }
    public void addOrUpdateDocument(Object data) {
        VideoIndex videoIndex = (VideoIndex) data;
        esVideoIndexRepository.save(videoIndex);
//        indexName = this.getIndexFullName(indexName);
//        IndexRequest request = new IndexRequest(indexName);
//        request.id(id).source(data);
//        try {
//            client.index(request, RequestOptions.DEFAULT);
//        } catch (IOException e) {
//            throw new RuntimeException("es文档添加/修改失败", e);
//        }
    }
    @Override