Community articleFTSearchSorted - Java 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.

Referrence Links


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

Interface Methods


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;

Parameters


ParameterDescription
String query / Vector queryThe full-text query or the intersection of multiple queries. See below for the query syntax.
int maxDocsThe 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 columnNumThe name or 0-based index of a sorted column. A specification of View.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 ascendingSorts column data in ascending order if true, descending order if false. Defaults to true. Ignored if View.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 exactApplies the EXACTCASE filter to the search if true. Defaults to false.
boolean variantsReturns word variants in the search results if true. Defaults to false.
boolean fuzzyReturns misspelled words in the search results if true. Defaults to false.

Return Value


Return ValueDescription
intThe 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 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 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 isFTIndexedexternal link. To create an index on a local database, use updateFTIndexexternal link.

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 can either be a single String or a Vector of String which will be combined together with an AND during the search.