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

Former-commit-id: a88ba4ac5e919f0cac03e08c04d8f4554a22903b
This commit is contained in:
Jeremy Long
2013-11-16 09:18:02 -05:00
parent f868c3d172
commit 9885b8d117

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();
}
}