db.FTSearch
Defined in
Database
Syntax
public DocumentCollection FTSearch(String query)
throws NotesException
public DocumentCollection FTSearch(String query, int max)
throws NotesException
public DocumentCollection FTSearch(String query, int max, int sortopt, int otheropt)
throws NotesException
Parameters
String query
The full-text query. See the section "Query Syntax" that follows.
int max
The maximum number of documents you want returned from the query. Set this parameter to 0 to receive all matching documents (up to 5,000. See Usage section below).
sortopt
Integer. Use one of the following constants to specify a sorting option:
Database.FT_SCORES (default) sorts by relevance score. When the collection is sorted by relevance, the highest relevance appears first. To access the relevance score of each document in the collection, use the FTSearchScore property in Document.
Database.FT_DATECREATED_DES sorts by document creation date in descending order.
Database.FT_DATECREATED_ASC sorts by document creation date in ascending order.
Database.FT_DATE_DES sorts by document date in descending order.
Database.FT_DATE_ASC sorts by document date in ascending order
2. This code fragment collects all documents containing both the words "red" and "blue."
DocumentCollection dc = db.FTSearch("red & blue", 100);
3. This code fragment collects all documents containing either the word "red" or "blue" in descending order by creation date.
DocumentCollection dc = db.FTSearch("red | blue", 100, Database.FT_DATE_DES, 0);
4. This code fragment collects all documents that do not contain the word "red" or "blue" in descending order by creation date.
DocumentCollection dc = db.FTSearch("not (red | blue)", 100,Database.FT_DATE_DES, 0);