@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()); }
public Long countAll() { return client.prepareCount(this.getIndexName()).setTypes(this.getIndexType()).get().getCount(); }