2

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
}
Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
Salman
  • 21
  • 2
  • If maximum result number is the issue, please, consider this also: https://stackoverflow.com/questions/54311405/setting-maximum-results-number-via-fem – Andrea Nov 05 '21 at 10:35

1 Answers1

1

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

ᄂ ᄀ
  • 5,669
  • 6
  • 43
  • 57
swepss
  • 481
  • 3
  • 9