FTSearch (NotesViewEntryCollection - JavaScript™)
Conducts a full-text search on all entries in a view entry collection and filters the collection so that it represents only the entries that match the full-text query.
Defined in
NotesViewEntryCollectionSyntax
FTSearch(query:string) : void | Parameter | Description |
|---|---|
query |
The full-text query. See the syntax section that follows. |
maxdocs |
The maximum number of documents you want returned from the query. Set this parameter to 0 to receive all matching documents. |
Usage
The collection of entries that match the full-text query are sorted by relevance with highest relevance first. You can access the relevance score of each entry in the collection with getFTSearchScore inNotesViewEntry.If
the database is not full-text indexed, this method works, but less
efficiently. To test for an index, use isFTIndexed in NotesDatabase.
To create an index on a local database, use updateFTIndex in NotesDatabase.
The current pointer is reset to the first document in the collection.
To search for a word or phrase, enter the word or phrase as is, except that search keywords must be enclosed in quotes. Remember to escape quotes if you are inside a literal.
Wildcards, operators, and other syntax are permitted. For the complete syntax rules, see "Refining a search query using operators" in Notes® Help. You can also search for "query syntax" in the Domino® Designer Eclipse help system.
Examples
This button gets the first entry in a view that matches a user search query.if (requestScope.query.isEmpty()) return;
if (!database.isFTIndexed()) database.createFTIndex(0, false);
var vec:NotesViewEntryCollection = database.getView("main").getAllEntries();
vec.FTSearch(requestScope.query, 1);
var entry:NotesViewEntry = vec.getFirstEntry();
requestScope.status = entry != null ?
entry.getPosition(".") + " " + entry.getDocument().getItemValueString("subject") :
"No match";