How to get the count of documents for the object store using FileNet API's

1.3k views Asked by At

I have more than a million documents in object store, and I want to know the count of documents for a specific time period. How can I get the count using FileNet CE api's

The code I use is below, which gives me only a maximum of 200 documents.

--Code
SearchScope scope= new SearchScope(obj);
SearchSQL sql= new SearchSQL();
sql.setMaxRecords(100000);
String query="select * from document where datecreated >(date)";
RepositoryRowSet res= scope.fetchRows(sql,1000,null,null);
int count=0;
PageIterator p= result.pageIterator();
while(p.nextPage){
count+=p.getElementCount();a
}
1

There are 1 answers

0
swepss On

It is possible to use COUNT() function in background searches:

select COUNT(Id) from Document

Link to SQL syntax for background search query

Working with background search queries via API

Or, you can use a direct database connection and find the count of documents using documented database tables schema from DocVersion table.

Table schema - DocVersion