Conducts a full-text search on all documents in a view and filters the view so it represents only those documents that match the full-text query.
Parameter | Description |
---|---|
query | The full-text query. See below. |
maxdocs | The maximum number of documents you want returned from the search. If you want to receive all documents that match the query, specify 0. |
Return value | Description |
---|---|
int | The number of documents in the view after the search. Each of these documents matches the query. |
This method does not find word variants.
Use the clear method to clear the full-text search filtering. The NotesView methods now navigate to the full set of documents in the view.
If the database is not full-text indexed, this method works, but less efficiently. To test for an index, use isFTIndexed. To create an index on a local database, use updateFTIndex.
Wildcards, operators, and other syntax are permitted. For the complete syntax rules, see "Refining a search query using operators" in Lotus Notes® Help. Search for "query syntax" in the Domino® Designer Eclipse help system or information center (for example, http://publib.boulder.ibm.com/infocenter/domhelp/v8r0/index.jsp), both of which include Lotus Notes.
database.updateFTIndex(true); var v:NotesView = database.getView("main"); var query:string = requestScope.query; if (!query.isEmpty()) { if (v.FTSearch(query) > 0) { var doc:NotesDocument = v.getFirstDocument(); while (doc != null) { doc.putInFolder("Search Results", true); tmpdoc = v.getNextDocument(doc); doc.recycle(); doc = tmpdoc; } } } v.clear(); if (!query2.isEmpty()) { if (v.FTSearch(query2) > 0) { doc = v.getFirstDocument(); while (doc != null) { doc.putInFolder("Search Results 2", true); tmpdoc = v.getNextDocument(doc); doc.recycle(); doc = tmpdoc; } } }