FTSearchSorted (View - Java)

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.

Defined in

View

Syntax

int FTSearchSorted(String query) throws NotesException;

int FTSearchSorted(String query, int maxDocs) throws NotesException;

int FTSearchSorted(String query, int maxDocs, String column) throws NotesException;

int FTSearchSorted(String query, int maxDocs, String column, boolean ascending, boolean exact, boolean variants, boolean fuzzy) throws NotesException;

int FTSearchSorted(String query, int maxDocs, int columnNum) throws NotesException;

int FTSearchSorted(String query, int maxDocs, int columnNum, boolean ascending, boolean exact, boolean variants, boolean fuzzy) throws NotesException;

int FTSearchSorted(java.util.Vector query) throws NotesException;

int FTSearchSorted(java.util.Vector query, int maxDocs) throws NotesException;

int FTSearchSorted(java.util.Vector query, int maxDocs, String column) throws NotesException;

int FTSearchSorted(java.util.Vector query, int maxDocs, String column, boolean ascending, boolean exact, boolean variants, boolean fuzzy) throws NotesException;

int FTSearchSorted(java.util.Vector query, int maxDocs, int columnNum) throws NotesException;

int FTSearchSorted(java.util.Vector query, int maxDocs, int columnNum, boolean ascending, boolean exact, boolean variants, boolean fuzzy) throws NotesException;

Parameter Description
String query / Vector query The full-text query or the intersection of multiple queries. See below for the query syntax.
int 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. Defaults to 0.
String column / int columnNum 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.
boolean ascending 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.

boolean exact Applies the EXACTCASE filter to the search if true. Defaults to false.
boolean variants Returns word variants in the search results if true. Defaults to false.
boolean fuzzy Returns misspelled words in the search results if true. Defaults to false.
Return value Description
int The number of documents in the view after the search. Each of these documents matches the query.

Usage

After calling FTSearchSorted, you can use the regular View 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 getFirstDocument returns the first document in the subset, getLastDocument returns the last document, and so on.

Use the clear method to clear the full-text search filtering. The View 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 isFTIndexed property. To create an index on a local database, use the updateFTIndex 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 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®.

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

Language cross-reference

FTSearchSorted method in JavaScript NotesView class

FTSearchSorted method in LotusScript® NotesView class

ViewShowOnlySearchResults @command in formula language