docs: public long getCardinality() {
          if (pos > 0) {
              return totalHits;
          }
          try {
              EsResponse res = client.search(index, type, query);
              Document hits = (Document) res.get("hits");
              totalHits = hits.getInteger("total");
              return totalHits;
          } catch (Exception e) {
              throw new EsIndexException(e);
          }
      }