long documentBuildNS = 0l;
long documentPageNS = 0l;
int collectionSize = 0;
int dbDocs = 0;
try {
Database db = session.getDatabase("", "imdb/movies.bak");
dbDocs = db.getAllDocuments().getCount();
long testStartTime = System.nanoTime();
NoteCollection nc = db.createNoteCollection(false);
nc.selectAllDataNotes(true);
nc.setSelectionFormula("@Begins(Title; \"B\")"); //NTF comment or uncomment this to toggle testing selection formula impact
nc.buildCollection();
int[] nids = nc.getNoteIDs();
long collectionTime = System.nanoTime();
collectionBuildNS = collectionTime - testStartTime;
collectionSize = nids.length;
Document[] documents = new Document[collectionSize];
for (int i = 0; i < collectionSize; i++) {
documents[i] = db.getDocumentByID(nids[i], true/*false would mean full load of the Document*/);
}
long documentTime = System.nanoTime();
documentBuildNS = documentTime - collectionTime;
int pageSize = 100;
int pageStart = 2014;