|
@@ -52,11 +52,13 @@ public class ElasticSearchServiceImpl implements IElasticSearchService {
|
|
|
String indexName = "docs_" + info.getSpaceId();
|
|
|
//获取文件
|
|
|
DocumentVO vo = mongoService.downloadFile(info.getFileId());
|
|
|
- String content = handler.apply(vo.getData());
|
|
|
- EsDocInfo esDocInfo = new EsDocInfo(info.getDocId(), content);
|
|
|
+ if (vo != null) {
|
|
|
+ String content = handler.apply(vo.getData());
|
|
|
+ EsDocInfo esDocInfo = new EsDocInfo(info.getDocId(), content);
|
|
|
|
|
|
- esConfig.setIndexName(indexName);
|
|
|
- esDocInfoService.save(esDocInfo);
|
|
|
+ esConfig.setIndexName(indexName);
|
|
|
+ esDocInfoService.save(esDocInfo);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|