How To Index a Database Through code

Hi All, I have a database and I want that every time the database will open it will indexed.

Please guide me that what the class for indexing a database.

Thanks in advance

Subject: How To Index a Database Through code

Hi

Call UpdateFTIndex in the NotesDatabase class.

You’re not saying if you’re using a Notes client or a web browser.

If it’s a Notes client call it in the Database Script.

If from a browser then make an agent which updates the database FT index and call it somewhere appropriate.

Like webqueryopen on a document or call an URL with ?openagent

regards

Jesper Kiaer

http://www.jezzper.com

Subject: How To Index a Database Through code

Dear Pawan,

Use NotesDatabase class , Use CreateFTIndex and UpdateFTIndex function.

Rishi

Subject: RE: How To Index a Database Through code

Thanks It Working. My Problem was that when ever the database open in web it should be full text index. Ihave written the code.

Dim session As New Notessession

Dim db As NotesDatabase

Set db = session.CurrentDatabase

options& = FTINDEX_ALL_BREAKS + FTINDEX_CASE_SENSITIVE +FTINDEX_ATTACHED_FILES+FTINDEX_ENCRYPTED_FIELDS+FTINDEX_ATTACHED_BIN_FILES

If db.IsFTIndexed Then

Call db.CreateFTIndex(options&, True)

Print “Database index recreated”

Else

Call db.CreateFTIndex(options&, False)

Print "New Database index "

End If