|
@ -193,10 +193,10 @@ public class ElasticSearchDataProcessService {
|
|
|
String cubeId = "";
|
|
|
if (dataMap.containsKey("cubeId")) {
|
|
|
cubeId = dataMap.remove("cubeId").toString();
|
|
|
String index = this.getIndexTypeById(cubeId);
|
|
|
try {
|
|
|
elasticSearchUtil.remove(index);
|
|
|
} catch (Exception e) {
|
|
|
Cube cube = this.getIndexTypeById(cubeId);
|
|
|
if (null != cube) {
|
|
|
elasticSearchUtil.deleteByField(cube.getIndexName(), cube.getIndexType(), "_index", cube.getIndexName());
|
|
|
} else {
|
|
|
throw new Exception("索引不存在");
|
|
|
}
|
|
|
}
|
|
@ -487,13 +487,9 @@ public class ElasticSearchDataProcessService {
|
|
|
* @param cubeId
|
|
|
* @return
|
|
|
*/
|
|
|
public String getIndexTypeById(String cubeId) {
|
|
|
String index = "";
|
|
|
public Cube getIndexTypeById(String cubeId) {
|
|
|
Cube cube = cubeService.findOne(Integer.parseInt(cubeId));
|
|
|
if (null != cube) {
|
|
|
index = cube.getIndexName();
|
|
|
}
|
|
|
return index;
|
|
|
return cube;
|
|
|
}
|
|
|
|
|
|
}
|