using java api you can search a specific directory and then get the total number of hits.
DatabaseClient client = DatabaseClientFactory.newClient(host,port, "admin", "****", Authentication.DIGEST);
QueryManager queryMgr = client.newQueryManager();
StructuredQueryBuilder qb = new StructuredQueryBuilder();
StructuredQueryDefinition querydef =
qb.directory(true, "/content/enhanced-rosetta/");
SearchHandle resultsHandle = queryMgr.search(querydef,new SearchHandle());
MatchDocumentSummary[] results = resultsHandle.getMatchResults();
System.out.println("Total count=" + resultsHandle.getTotalResults());
client.release();
prker source
share