diff --git a/src/main/java/com/qniao/iot/IotMonitoringDataJob.java b/src/main/java/com/qniao/iot/IotMonitoringDataJob.java index 4cd1c28..2d78adb 100644 --- a/src/main/java/com/qniao/iot/IotMonitoringDataJob.java +++ b/src/main/java/com/qniao/iot/IotMonitoringDataJob.java @@ -439,11 +439,11 @@ public class IotMonitoringDataJob { searchSourceBuilder.sort("reportTime", SortOrder.DESC); searchSourceBuilder.size(1); // 创建查询请求对象,将查询对象配置到其中 - SearchRequest searchRequest = new SearchRequest(ApolloConfig.getStr(ConfigConstant.SINK_ELASTICSEARCH_INDEX) + "_*"); + SearchRequest searchRequest = new SearchRequest(ApolloConfig.getStr(ConfigConstant.SINK_ELASTICSEARCH_INDEX)); searchRequest.source(searchSourceBuilder); String nowDate = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyyMM")); GetIndexRequest exist = new GetIndexRequest(ApolloConfig.getStr(ConfigConstant.SINK_ELASTICSEARCH_INDEX) + "_" + nowDate); - // 先判断客户端是否存在 + // 先判断索引是否存在 boolean exists = restHighLevelClient.indices().exists(exist, RequestOptions.DEFAULT); if (exists) { // 执行查询,然后处理响应结果 diff --git a/src/main/resources/META-INF/app.properties b/src/main/resources/META-INF/app.properties index d10864b..f979514 100644 --- a/src/main/resources/META-INF/app.properties +++ b/src/main/resources/META-INF/app.properties @@ -2,4 +2,4 @@ app.id=iot-device-monitoring-data # test 8.135.8.221 # prod 47.112.164.224 -apollo.meta=http://47.112.164.224:5000 \ No newline at end of file +apollo.meta=http://8.135.8.221:5000 \ No newline at end of file