Forcing immediate indexes to actually update immediately

Have you found that your database's full-text index doesn't update immediately when you save a document, even when the frequency setting is set to "IMMEDIATE"? The UPDATE function on the server checks the queue every 5 seconds for new task requests, however it uses the "Update Suppression Time" setting to wait until multiple, similar requests get deposited in the queue before it runs. This can take up to 15 minutes to execute. Decreasing the suppression time interval on the server isn't a good solution since it will exponentially increase the load on the server's resources. And it still doesn't solve your problem because even a minute delay could frustrate a web user when their new document doesn't show up in search. So instead, the solution below will fire off the UPDALL routine directly in the server console for the specific database.

Insert the code below into an agent and make sure to change the "set runtime security level" setting to #3 Allow restricted operations with full administrator rights. (assuming your ID has sufficient rights on the server). Also be sure to add the %INCLUDE "lsxbeerr.lss". The "-F" parameter ensures that just the full-text index is updated, not the views.

%INCLUDE "lsxbeerr.lss"

Sub Initialize
	
	Set session = New NotesSession
	Dim db As notesdatabase		
	Set db = session.currentdatabase
	Dim doc As notesdocument		
	Set doc = session.DocumentContext
	
	Dim consoleReturn As String
	consoleReturn = session.SendConsoleCommand(db.server, "load updall DATABASE.NSF -F" )
	
End Sub

Images/Screenshots:





Written by fbrefere001

Posted by fbrefere001 on Saturday July 23, 2016