updateFTIndex (NotesDatabase - JavaScript)

Updates the full-text index of a database.

Defined in

NotesDatabase

Syntax

updateFTIndex(create:boolean) : void
Parameter Description
create Specify true if you want to create an index if none exists (valid only for local databases). Otherwise, specify false.

Usage

A database must contain at least one document in order for an index to be created, even if the create parameter is set to true.

Examples

This data binding for a multiline edit box returns the subject values for all documents containing "new" in a full-text search. The index is created if necessary.
if (database.isFTIndexed()) {
	database.updateFTIndex(false)
} else {
	database.createFTIndex(0, true)
}
var list = "";
var dc = database.FTSearch("new");
var doc = dc.getFirstDocument();
while (doc != null) {
	list = list + doc.getItemValueString("Subject") + "\n";
	doc = dc.getNextDocument();
}
return list
This example is the same as the previous but uses updateFTIndex to test for and create an index if necessary.
database.updateFTIndex(true);
var list = "";
var dc = database.FTSearch("new");
var doc = dc.getFirstDocument();
while (doc != null) {
	list = list + doc.getItemValueString("Subject") + "\n";
	doc = dc.getNextDocument();
}
return list