提交 64542b45 作者: obcy

Merge remote-tracking branch 'origin/event_fusion' into event_fusion

...@@ -1166,9 +1166,11 @@ public class InformationServiceImpl implements InformationService { ...@@ -1166,9 +1166,11 @@ public class InformationServiceImpl implements InformationService {
for (String word : keywordList) { for (String word : keywordList) {
Map<String, Object> deleteParams = new HashMap<>(); Map<String, Object> deleteParams = new HashMap<>();
deleteParams.put("fieldType", word); deleteParams.put("fieldType", word);
long start = System.currentTimeMillis();
esOpUtil.batchNestedDeleteScript(indexArr, buildQuery, deleteParams, "sortField"); esOpUtil.batchNestedDeleteScript(indexArr, buildQuery, deleteParams, "sortField");
log.info("删除关键词-{},耗时:{}",word, System.currentTimeMillis()-start);
try { try {
Thread.sleep(3000); Thread.sleep(1000);
} catch (InterruptedException e) { } catch (InterruptedException e) {
e.printStackTrace(); e.printStackTrace();
} }
...@@ -1191,7 +1193,9 @@ public class InformationServiceImpl implements InformationService { ...@@ -1191,7 +1193,9 @@ public class InformationServiceImpl implements InformationService {
Map<String, Object> modifyParams = new HashMap<>(); Map<String, Object> modifyParams = new HashMap<>();
modifyParams.put("checkStatus", 1); modifyParams.put("checkStatus", 1);
modifyParams.put("deleteFlag",0); modifyParams.put("deleteFlag",0);
long start = System.currentTimeMillis();
esOpUtil.batchUpdateScript(indexArr, buildQuery, modifyParams); esOpUtil.batchUpdateScript(indexArr, buildQuery, modifyParams);
log.info("添加到精选,耗时:{}", System.currentTimeMillis()-start);
} }
@Override @Override
...@@ -1210,7 +1214,9 @@ public class InformationServiceImpl implements InformationService { ...@@ -1210,7 +1214,9 @@ public class InformationServiceImpl implements InformationService {
Map<String, Object> modifyParams = new HashMap<>(); Map<String, Object> modifyParams = new HashMap<>();
modifyParams.put("checkStatus",3); modifyParams.put("checkStatus",3);
modifyParams.put("deleteFlag",0); modifyParams.put("deleteFlag",0);
long start = System.currentTimeMillis();
esOpUtil.batchUpdateScript(indexArr, buildQuery, modifyParams); esOpUtil.batchUpdateScript(indexArr, buildQuery, modifyParams);
log.info("添加到待定,耗时:{}", System.currentTimeMillis()-start);
} }
@Override @Override
...@@ -1228,7 +1234,9 @@ public class InformationServiceImpl implements InformationService { ...@@ -1228,7 +1234,9 @@ public class InformationServiceImpl implements InformationService {
} }
Map<String, Object> modifyParams = new HashMap<>(); Map<String, Object> modifyParams = new HashMap<>();
modifyParams.put("deleteFlag",1); modifyParams.put("deleteFlag",1);
long start = System.currentTimeMillis();
esOpUtil.batchUpdateScript(indexArr, buildQuery, modifyParams); esOpUtil.batchUpdateScript(indexArr, buildQuery, modifyParams);
log.info("添加到删除,耗时:{}", System.currentTimeMillis()-start);
} }
@Override @Override
...@@ -1241,7 +1249,9 @@ public class InformationServiceImpl implements InformationService { ...@@ -1241,7 +1249,9 @@ public class InformationServiceImpl implements InformationService {
Map<String, Object> modifyParams = new HashMap<>(); Map<String, Object> modifyParams = new HashMap<>();
modifyParams.put("checkStatus",0); modifyParams.put("checkStatus",0);
modifyParams.put("deleteFlag",0); modifyParams.put("deleteFlag",0);
long start = System.currentTimeMillis();
esOpUtil.batchUpdateScript(indexArr, buildQuery, modifyParams); esOpUtil.batchUpdateScript(indexArr, buildQuery, modifyParams);
log.info("初始化数据,耗时:{}", System.currentTimeMillis()-start);
} }
@Override @Override
...@@ -1276,7 +1286,9 @@ public class InformationServiceImpl implements InformationService { ...@@ -1276,7 +1286,9 @@ public class InformationServiceImpl implements InformationService {
String minCreateTime = subjectService.getMinCreateTime(subjectIdList); String minCreateTime = subjectService.getMinCreateTime(subjectIdList);
String[] indexArr = EsIndexUtil.getIndexIntervalYearStr(Constants.SUBJECT_INDEX, minCreateTime); String[] indexArr = EsIndexUtil.getIndexIntervalYearStr(Constants.SUBJECT_INDEX, minCreateTime);
BoolQueryBuilder buildQuery = esService.buildQuery(searchCondition, subjectIdList); BoolQueryBuilder buildQuery = esService.buildQuery(searchCondition, subjectIdList);
long start = System.currentTimeMillis();
esOpUtil.batchReplaceScript(indexArr, buildQuery, modifyFields, oldWord, newWord); esOpUtil.batchReplaceScript(indexArr, buildQuery, modifyFields, oldWord, newWord);
log.info("字符串替换-{},耗时:{}", oldWord,System.currentTimeMillis()-start);
} }
@Override @Override
...@@ -1296,9 +1308,11 @@ public class InformationServiceImpl implements InformationService { ...@@ -1296,9 +1308,11 @@ public class InformationServiceImpl implements InformationService {
for (Label markTag : searchCondition.getMarkTags()) { for (Label markTag : searchCondition.getMarkTags()) {
Map<String, String> addTag = ObjectUtil.objectToMap(markTag); Map<String, String> addTag = ObjectUtil.objectToMap(markTag);
addParams.put("labels",addTag); addParams.put("labels",addTag);
long start = System.currentTimeMillis();
esOpUtil.batchNestedAddScript(indexArr, buildQuery, addParams,"labels","relationId"); esOpUtil.batchNestedAddScript(indexArr, buildQuery, addParams,"labels","relationId");
log.info("打标-{},耗时:{}", markTag.getRelationName(),System.currentTimeMillis()-start);
try { try {
Thread.sleep(3000); Thread.sleep(1000);
} catch (InterruptedException e) { } catch (InterruptedException e) {
e.printStackTrace(); e.printStackTrace();
} }
...@@ -1323,12 +1337,14 @@ public class InformationServiceImpl implements InformationService { ...@@ -1323,12 +1337,14 @@ public class InformationServiceImpl implements InformationService {
buildQuery.must(QueryBuilders.nestedQuery("labels", buildQuery.must(QueryBuilders.nestedQuery("labels",
QueryBuilders.termsQuery("labels.relationId", tagIds), QueryBuilders.termsQuery("labels.relationId", tagIds),
ScoreMode.None)); ScoreMode.None));
for (String tagId : tagIds) { for (Label markTag : markTags) {
Map<String, Object> deleteParams = new HashMap<>(); Map<String, Object> deleteParams = new HashMap<>();
deleteParams.put("relationId", tagId); deleteParams.put("relationId", markTag.getRelationId());
long start = System.currentTimeMillis();
esOpUtil.batchNestedDeleteScript(indexArr, buildQuery, deleteParams, "labels"); esOpUtil.batchNestedDeleteScript(indexArr, buildQuery, deleteParams, "labels");
log.info("删除标签-{},耗时:{}", markTag.getRelationName(),System.currentTimeMillis()-start);
try { try {
Thread.sleep(3000); Thread.sleep(1000);
} catch (InterruptedException e) { } catch (InterruptedException e) {
e.printStackTrace(); e.printStackTrace();
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论