Updating Database Full Text Search Via Lotusscript On Doc Save

I've created two databases. DB 1 creates a document (Doc a). DB2 uses
FTSearch to select a doc from DB1. However, when I setup Doc a in DB 1 and
then try searching from DB 2, it's not found. Why?

This is due to the way full text indexes are updated. The help text says that
"immediate" updates are performed "As quickly as possible after the database is
closed".

If, for example, you have both databases open at the same time and try the
search,the doc can't be found because DB 1 has not had it's FT index updated.
To solve this, put the following code as a "Save and Exit" button for the form
in DB 1.

The coding examples will force your users to use a button to save & exit, which
will also update the Full Text Search (see last line)
1. In your form for DB 1, Create a Text, hidden, Editable field, default value
"0" called Allowsave with the following code for Input Validation:

@If(@IsDocBeingRecalculated=@False;
@If(AllowSave = "0"; @Failure("To validate and save this document, use the
\'Save and Exit\' Button!"); @Success);@Success)

2. Create a button with the following Script in the Click event:

Sub Click(Source As Button)
'Set up Session & Current Document
Dim session As New Notessession
Dim ws As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Set uidoc = ws.CurrentDocument


'Set up the Current Database in this session
Dim db As notesdatabase
Set db=session.currentdatabase

'Update the field to allow save of doc.
Call uidoc.fieldsettext("allowsave","1")

'Save the Doc
Call uidoc.save

'Close the Doc
Call uidoc.close

'Update the Index
Call db.UpdateFTIndex( False )


End Sub

Dig Deeper on Domino Resources

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchWindowsServer

Search400

  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

SearchDataCenter

SearchContentManagement

Close