You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by wu...@apache.org on 2018/09/28 06:39:06 UTC
[incubator-skywalking] branch fix-endpoint-query created (now
972801b)
This is an automated email from the ASF dual-hosted git repository.
wusheng pushed a change to branch fix-endpoint-query
in repository https://gitbox.apache.org/repos/asf/incubator-skywalking.git.
at 972801b Make sure can get endpoint list with empty keyword.
This branch includes the following new commits:
new 972801b Make sure can get endpoint list with empty keyword.
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
[incubator-skywalking] 01/01: Make sure can get endpoint list with
empty keyword.
Posted by wu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
wusheng pushed a commit to branch fix-endpoint-query
in repository https://gitbox.apache.org/repos/asf/incubator-skywalking.git
commit 972801b214361c2c005cacbbce8857c87089b35f
Author: Wu Sheng <wu...@foxmail.com>
AuthorDate: Fri Sep 28 14:38:53 2018 +0800
Make sure can get endpoint list with empty keyword.
---
.../storage/plugin/elasticsearch/query/MetadataQueryEsDAO.java | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/query/MetadataQueryEsDAO.java b/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/query/MetadataQueryEsDAO.java
index bfe37f3..07b6dd5 100644
--- a/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/query/MetadataQueryEsDAO.java
+++ b/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/query/MetadataQueryEsDAO.java
@@ -26,6 +26,7 @@ import org.apache.skywalking.oap.server.core.source.DetectPoint;
import org.apache.skywalking.oap.server.core.storage.query.IMetadataQueryDAO;
import org.apache.skywalking.oap.server.library.client.elasticsearch.ElasticSearchClient;
import org.apache.skywalking.oap.server.library.util.BooleanUtils;
+import org.apache.skywalking.oap.server.library.util.StringUtils;
import org.apache.skywalking.oap.server.storage.plugin.elasticsearch.base.*;
import org.elasticsearch.action.get.GetResponse;
import org.elasticsearch.action.search.SearchResponse;
@@ -143,7 +144,9 @@ public class MetadataQueryEsDAO extends EsDAO implements IMetadataQueryDAO {
boolQueryBuilder.must().add(QueryBuilders.termQuery(EndpointInventory.SERVICE_ID, serviceId));
String matchCName = MatchCNameBuilder.INSTANCE.build(EndpointInventory.NAME);
- boolQueryBuilder.must().add(QueryBuilders.matchQuery(matchCName, keyword));
+ if (StringUtils.isNotEmpty(keyword)) {
+ boolQueryBuilder.must().add(QueryBuilders.matchQuery(matchCName, keyword));
+ }
sourceBuilder.query(boolQueryBuilder);
sourceBuilder.size(limit);