Question

I have a DB that must be full text indexed, so I added the code below to create one if it is not allready indexed:

if (database.isFTIndexed()){
    database.updateFTIndex(false)
} else {
    var options:int = database.FTINDEX_ALL_BREAKS + database.FTINDEX_ATTACHED_FILES + database.FTINDEX_IMMEDIATE
    database.createFTIndex(options , true);
    database.updateFTIndex(false);
}
sessionScope.put("ssSelectedView","vwWFSProfile")

When it runs I get the following error: Error source Page Name:/xpWFSAdmin.xsp Control Id: button2 Property: onclick

Exception Error while executing JavaScript action expression com.ibm.jscript.types.GeneratedWrapperObject$StaticField incompatible with com.ibm.jscript.types.FBSValue

Expression

1: #{javascript:if (database.isFTIndexed()){ 2: database.updateFTIndex(false) 3: } else { 4: var options:int = database.FTINDEX_ALL_BREAKS + database.FTINDEX_ATTACHED_FILES + database.FTINDEX_IMMEDIATE 5: database.createFTIndex(options , true); 6: database.updateFTIndex(false); 7: } 8: sessionScope.put("ssSelectedView","vwWFSProfile")}

It is choking on line 4 it does not like the summing of the parameters. So I comment out line 4 and change line 5 to read database.createFTIndex(4, true) then I get this error:

Error while executing JavaScript action expression Script interpreter error, line=5, col=18: [TypeError] Exception occurred calling method NotesDatabase.createFTIndex(number, boolean) null

JavaScript code

1: if (database.isFTIndexed()){ 2: database.updateFTIndex(false) 3: } else { 4: //var options:int = database.FTINDEX_ALL_BREAKS + database.FTINDEX_ATTACHED_FILES + database.FTINDEX_IMMEDIATE 5: database.createFTIndex(4 , true); 6: database.updateFTIndex(false); 7: } 8: sessionScope.put("ssSelectedView","vwWFSProfile")

Can't seem to get it to work. I can go into the DB and manually create the index so it is not a rights issue.

Was it helpful?

Solution

As far as I can read from the help, you can not use database.FTINDEX_IMMEDIATE as parameter for createFTIndex() only for setFTIndexFrequency().

So remove the use of database.FTINDEX_IMMEDIATE and do this:

var options:int = database.FTINDEX_ALL_BREAKS + database.FTINDEX_ATTACHED_FILES;
database.createFTIndex(options , true);

You can then call setFTIndexFrequency() like this:

database.setFTIndexFrequency(database.FTINDEX_IMMEDIATE);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top