xuanyuan1hao commented on issue #7152:
URL: https://github.com/apache/skywalking/issues/7152#issuecomment-865492463


   正确代码应该如下:
   public boolean indexDocIsZero(String tableName,RestHighLevelClient client) 
throws IOException {
           SearchSourceBuilder sourceBuilder = new SearchSourceBuilder();
           sourceBuilder.from(0);
           sourceBuilder.size(1);
           SearchRequest rq = new SearchRequest();
           rq.indices(tableName);
           rq.source(sourceBuilder);
           SearchResponse search = client.search(rq);
           return search.getHits().getHits().length==0;
       }


-- 
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:
[email protected]


Reply via email to