FTSearch (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. This method does not find word variants.

Defined in

View

Syntax

public int FTSearch(String query)
    throws NotesException
public int FTSearch(String query, int maxdocs)
    throws NotesException

Parameters

String query

The full-text query.

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.

Return value

int

The number of documents in the view after the search. Each of these documents matches the query.

Usage

After calling FTSearch, you can use the regular View methods to navigate the result, which is a subset of the documents in the view. If the database is not full-text indexed, the documents in the subset are in the same order as they are in the original view. However, if the database is full-text indexed, the documents in the subset are sorted into descending order of relevance. 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 works, but less efficiently. To test for an index, use isFTIndexed. To create an index on a local database, use updateFTIndex.

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 Notes®.

Example