Пример #1
0
 public Long countByQualityProfileKey(QualityProfileKey key) {
   CountRequestBuilder request =
       getClient()
           .prepareCount(getIndexName())
           .setQuery(
               QueryBuilders.termQuery(
                   ActiveRuleNormalizer.ActiveRuleField.PROFILE_KEY.field(), key.toString()))
           .setRouting(key.toString());
   return request.get().getCount();
 }
Пример #2
0
 @Override
 public IndexStat getIndexStat() {
   CountRequestBuilder countRequest =
       client
           .prepareCount(this.getIndexName())
           .setTypes(this.getIndexType())
           .setQuery(QueryBuilders.matchAllQuery());
   CountResponse response = countRequest.get();
   return new IndexStat(getLastSynchronization(), response.getCount());
 }