added the ability to retrieve the number of documents in the index

Former-commit-id: 9a430f2a1805669d3ef2450d98ca7c2b6ed12ee3
This commit is contained in:
Jeremy Long
2013-11-16 09:18:02 -05:00
parent 220b2c9a2a
commit a91e7b9ed0

View File

@@ -194,4 +194,16 @@ public class CpeIndexReader extends BaseIndex {
vendorSearchFieldAnalyzer.clear();
}
}
/**
* Returns the number of CPE entries stored in the index.
*
* @return the number of CPE entries stored in the index
*/
public int numDocs() {
if (indexReader == null) {
return -1;
}
return indexReader.numDocs();
}
}