This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking.git


The following commit(s) were added to refs/heads/master by this push:
     new 94cf9238c7 Fix ESEventQueryDAO miss metric_table boolQuery criteria. 
(#9971)
94cf9238c7 is described below

commit 94cf9238c7c1f8d7ae3b9f48e7a32104ff1aeee4
Author: zhyyu <[email protected]>
AuthorDate: Wed Nov 16 21:02:44 2022 +0800

    Fix ESEventQueryDAO miss metric_table boolQuery criteria. (#9971)
---
 docs/en/changes/changes.md                                            | 1 +
 .../server/storage/plugin/elasticsearch/query/ESEventQueryDAO.java    | 4 ++++
 2 files changed, 5 insertions(+)

diff --git a/docs/en/changes/changes.md b/docs/en/changes/changes.md
index 781f9fba98..4a9457e0ba 100644
--- a/docs/en/changes/changes.md
+++ b/docs/en/changes/changes.md
@@ -113,6 +113,7 @@
 * Fix wrong system variable name 
`SW_CORE_ENABLE_ENDPOINT_NAME_GROUPING_BY_OPENAPI`. It was **opaenapi**.
 * Fix not-time-series model blocking OAP boots in no-init mode.
 * Changed system variable `SW_SUPERDATASET_STORAGE_DAY_STEP` to 
`SW_STORAGE_ES_SUPER_DATASET_DAY_STEP` to be consistent with other ES storage 
related variables.
+* Fix ESEventQueryDAO missing metric_table boolQuery criteria.
 
 #### UI
 
diff --git 
a/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/query/ESEventQueryDAO.java
 
b/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/query/ESEventQueryDAO.java
index e30599d7d9..2223c1b8ab 100644
--- 
a/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/query/ESEventQueryDAO.java
+++ 
b/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/query/ESEventQueryDAO.java
@@ -78,6 +78,10 @@ public class ESEventQueryDAO extends EsDAO implements 
IEventQueryDAO {
 
     private void buildMustQueryListByCondition(final EventQueryCondition 
condition,
                                                final BoolQueryBuilder query) {
+        if 
(IndexController.LogicIndicesRegister.isPhysicalTable(Event.INDEX_NAME)) {
+            
query.must(Query.term(IndexController.LogicIndicesRegister.METRIC_TABLE_NAME, 
Event.INDEX_NAME));
+        }
+        
         if (!isNullOrEmpty(condition.getUuid())) {
             query.must(Query.term(Event.UUID, condition.getUuid()));
         }

Reply via email to