Connect Lotus Domino Server through Standalone Application with CORBA - Looking for Documents
(Page 3 of 6 )
We explain methods to search documents, with a View, object and with the Database object.
With Database, we search with method Search or method FTSearch. The differences are, Search have an argument which represents notes @function formula that specifies the selection criteria.
DocumentCollection dc = db.search("Subject = "" + mySubject + """);
With FTSearch executes a full-text query.
DocumentCollection dc = db.FTSearch("red & blue", 100);
Return all documents that match red and blue, but at maximum of 100.
With a View, prior we must have created it in the Domino, we can search documents as simple as:
View view = db.getView("By Category"); DocumentCollection dc = view.getAllDocumentsByKey("Leather");
This code gets all the documents in the category "Leather" in the By Category view of the current database The DocumentCollection class is a collection, and you navigate through it.
DocumentCollection dc = database.getAllDocuments();
Document doc = dc.getFirstDocument();
while (doc != null)
{
System.out.println(doc.getItemValueString("Subject"));
doc = dc.getNextDocument();
}
We put all documents of given database into DocumentCollection, and then we print the value of the field Subject.
Next: Working with Received Mails >>
More Administration Articles
More By Alex Soto Bueno