Community articleFTSearchSorted - LotusScript API
Added by IBM contributorPaul Fiore | Edited by IBM contributorDeanna Drschiwiski on October 7, 2011
Rate this article 1 starsRate this article 2 starsRate this article 3 starsRate this article 4 starsRate this article 5 stars

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 in sorted order.

Reference Links

NotesView classexternal link
FTSearchSorted - Java API
FTSearchSorted (NotesView - JavaScriptâ„¢)external link

Interface Methods

numDocs& = notesView.FTSearch( query [maxDocs%] [column] [ascending] [exact] [variants] [fuzzy] )


queryVariant. The full-text query or the intersection of multiple queries. See below for the query syntax.
maxdocs%Integer. Optional. The maximum number of documents you want returned from the search. If you want to receive all documents that match the query, specify 0. Defaults to 0.
columnVariant. Optional. The name or 0-based index of a sorted column. A specification of NotesView.VIEW_FTSS_RELEVANCE_ORDER (512) returns results in relevance order while honoring the use of the extended flags for exact case, variants, and fuzzy search.
ascending Boolean. Optional. Sorts column data in ascending order if true, descending order if false. Defaults to true. Ignored if NotesView.VIEW_FTSS_RELEVANCE_ORDER is in effect. The availability of a column to be sorted in ascending or descending order is determined by "Click on column header to sort" on the Sorting tab of the column properties. The relevant options are Ascending, Descending, and Both. Trying to sort a column in an unsupported direction throws an NOTES_ERR_INVALIDVIEWRESORT exception.
exact Boolean. Optional. Applies the EXACTCASE filter to the search if true. Defaults to false.
variantsBoolean. Optional. Returns word variants in the search results if true. Defaults to false.
fuzzyBoolean. Optional. Returns misspelled words in the search results if true. Defaults to false.

Return Value

Return valueDescription
numDocs&The number of documents in the view after the search. Each of these documents matches the query.


After calling this method, you can use the regular NotesView methods to navigate the result, which is a subset of the documents in the view. When passing in just the query argument, the documents in the subset are sorted using the default collation of 0. To retrieve the documents with a different collation pass in the name or index of the column you wish to sort on along with any optional search flags. The method GetFirstDocumentexternal link returns the first document in the subset, GetLastDocumentexternal link returns the last document, and so on.

Use the Clearexternal link 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 will issue an error. To test for an index, use the IsFTIndexedexternal link property. To create an index on a local database, use the UpdateFTIndexexternal link method.

Query Syntax

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 Lotus Notes Help. Search for "query syntax" in the Domino Designer Eclipse help system or information center ( for example, IBM Lotus Domino and Notes Information Centerexternal link ), both of which include Lotus Notes.

The query is of type Variant which can either be a single String or a Array of String which will be combined together with an AND during the search.