public Map<?, ?> scanDatabase(final org.openntf.domino.Database db) {
// DocumentScanner looks at values of all string-based items in a document
DocumentScanner scanner = new DocumentScanner();
for (org.openntf.domino.Document doc : db.getAllDocuments()) {
scanner.processDocument(doc);
}
// The FieldTokenMap returns a Map with a key of the item name, and a sorted set of the unique strings in each of those items
// Sample uses: Predictive typeahead, custom indexing, external term matching
return scanner.getFieldTokenMap();
}