public final int totalCount() throws XQueryException {
for(Pair<DbCollection, String> pair : lst) {
final DbCollection col = pair.getFirst();
final String docName = pair.getSecond();
final File idxFile = getIndexFile(col, docName);
BTreeIndexer indexer = new BTreeIndexer(idxFile);
final IndexMatch matched;
try {
matched = indexer.find(idxCond);
} catch (DbException e) {
throw new XQRTException("failed to query index: " + idxFile.getAbsolutePath(), e);
}
final long[] ptrs = filter(matched.getMatchedUnsorted(), docName, idxFile);
final int matchCounts = ptrs.length;