You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2019/10/13 16:56:24 UTC

[GitHub] [skywalking] dmsolr commented on a change in pull request #3613: [Feature] Support ElasticSearch 7 as storage

dmsolr commented on a change in pull request #3613: [Feature] Support ElasticSearch 7 as storage
URL: https://github.com/apache/skywalking/pull/3613#discussion_r334286114
 
 

 ##########
 File path: oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/query/MetadataQueryEsDAO.java
 ##########
 @@ -95,7 +95,7 @@ public MetadataQueryEsDAO(ElasticSearchClient client, int queryMaxSize) {
         sourceBuilder.size(0);
 
         SearchResponse response = getClient().search(EndpointInventory.INDEX_NAME, sourceBuilder);
-        return (int)response.getHits().getTotalHits();
+        return response.getHits().getHits() == null ? 0 : response.getHits().getHits().length;
 
 Review comment:
   Note that `getTotalHits()` and `getHits().length` are not equivalent.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services