FTSearchRange (NotesDatabase - LotusScript®)

Conducts a full-text search of all the documents in a database.

Note: This method is new with Release 6.

Defined in

NotesDatabase

Syntax

Set notesDocumentCollection = notesDatabase .FTSearchRange( query$ , maxdocs% , [ sortoptions% ], [ otheroptions% ], [ start&] )

Parameters

query$

String. The full-text query. See the following for the syntax.

maxdocs%

Integer. The maximum number of documents you want returned from the query. Set this parameter to 0 to retrieve all documents (up to 5,000; see the Usage section) that match the search criteria.

sortoptions%

Integer. Optional. Sorting options. Choose one.

  • FT_DATE_ASC (64) sorts by document date in ascending order.
  • FT_DATE_DES (32) sorts by document date in descending order.
  • FT_DATECREATED_ASC (1543) sorts by document creation date in ascending order.
  • FT_DATECREATED_DES (1542) sorts by document creation date in descending order.
  • FT_SCORES (8) sorts by relevance score (default).

otheroptions%

Integer. Optional. Search options. Combine options by adding.

  • FT_DATABASE (8192) includes Domino® databases.
  • FT_FUZZY (16384) searches for related words. Need not be an exact match.
  • FT_FILESYSTEM (4096) includes files that are not Domino® databases.
  • FT_STEMS (512) uses stem words as the basis of the search.
  • FT_THESAURUS (1024) uses thesaurus synonyms.

start&

Long. Optional. The starting document to return.

Return value

notesDocumentCollection

NotesDocumentCollection. A collection of documents that match the full-text query, sorted by the selected option.

Usage

This method is the same as FTSearch plus the start parameter.

If the database is not full-text indexed, this method works, but less efficiently. To test for an index, use the IsFTIndexed property in NotesDatabase. If the full-text is not updated after changes are made, it does not fully reflect the content of the database. To create or update an index on a local database, use the UpdateFTIndex method.

This method returns a maximum of 5,000 documents by default. The Notes®.ini variable FT_MAX_SEARCH_RESULTS overrides this limit for indexed databases or databases that are not indexed but that are running in an agent on the client. For a database that is not indexed and is running in an agent on the server, you must set the TEMP_INDEX_MAX_DOC Notes®.ini variable as well. The absolute maximum is 2,147,483,647.

This method searches all of the documents in a database. To search only documents found in a particular view, use the FTSearch method in NotesView. To search only documents found in a particular document collection, use the FTSearch method in NotesDocumentCollection.

If you don't specify any sort options, the documents are sorted by relevance score. When the collection is sorted by relevance the highest relevance appears first. To access the relevance score of each document in the collection, use FTSearchScore in NotesDocument.

If you ask for a sort by date, you don't get relevance scores. If you pass the resulting DocumentCollection to a NotesNewsLetter object, it formats its doclink report with either the document creation date or the relevance score, depending on the sort options.

If the database has a multi-database index, you get a multi-database search. Navigation through the resulting document collection may be slow, but you can create a newsletter from the collection.

If the collection is empty, the Count property for the returned NotesCollection is 0.

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