createFTIndex (NotesDatabase - JavaScript™)
Creates a full-text index for a database.
Defined in
NotesDatabaseSyntax
createFTIndex(options:int, recreate:boolean) : void
Parameter | Description |
---|---|
options |
Combine options with addition. Specify 0 for
no options.
|
recreate |
True removes any existing full-text index before creating one. If this parameter is false and an index exists, no action is taken. |
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";
var tmpdoc = dc.getNextDocument();
doc.recycle();
doc = tmpdoc;
}
return list
This button creates or re-creates a full-text
index for the current database.
var options:int = NotesDatabase.FTINDEX_ALL_BREAKS + NotesDatabase.FTINDEX_CASE_SENSITIVE;
if (database.isFTIndexed()) {
database.createFTIndex(options, true);
requestScope.status = "Database index re-created";
} else {
database.createFTIndex(options, false);
requestScope.status = "New database index created";
}