Solved

How to create a FtIndex on the server dynamically? Or how to do a search in the database on the web without the database being indexed?

Posted on 2009-05-03
3
339 Views
Last Modified: 2013-12-18
I tried using the code below, but he throws down the http after 2 days of use.
Const FT_INDEX_REINDEX = 2 'Re-index from scratch

Const FT_INDEX_CASE_SENS = 4 'Build case sensitive index

Const FT_INDEX_STEM_INDEX = 8 'Build stem index

Const FT_INDEX_PSW = 16 'Index paragraph & sentece breaks

Const FT_INDEX_OPTIMIZE = 32 'Optimize index (e.g. for CD-ROM)

Const FT_INDEX_ATT = 64 'Index attachments

Const FT_INDEX_ENCRYPTED_FIELDS = 128 'Index encrypted fields

Const FT_INDEX_AUTOOPTIONS = 256 'Get options from database

Const FT_INDEX_SUMMARY_ONLY = 512 'Index summary data only

Const FT_INDEX_ATT_BINARY = 1024 'Index binary attachments
 

Declare Function NSFDbOpen Lib "nnotes.dll" Alias "NSFDbOpen" (Byval dbName As String, hDb As Long) As Integer

Declare Function NSFDbClose Lib "nnotes.dll" Alias "NSFDbClose" (Byval hDb As Long) As Integer

Declare Function FTIndex Lib "nnotes.dll" Alias "FTIndex" (Byval hDb As Long, Byval options As Integer, stopfile As Long, stats As Long) As Integer
 

Dim session As NotesSession

Dim db As NotesDatabase
 

Sub Initialize

	Dim docCfg As NotesDocument

	

	Set session = New NotesSession

	Set db = session.CurrentDatabase

	Set docCfg = db.GetProfileDocument( "fo_cfg" )

	

	CreateIndex

	

	Set docCfg.ca_cfg_dataatualiz = New NotesDateTime( Now )

	docCfg.Save True , False	

End Sub
 

Sub CreateIndex()

	Dim hDb As Long
 

	If NSFDbOpen( db.FilePath , hDb ) = 0 Then

		Call FTIndex( hDb , FT_INDEX_PSW , 0 , 0 )

	Else

		Print "CreateIndex: Unable to open database at location."

	End If

	

	Call NSFDbClose(hDb)

End Sub

Open in new window

0
Comment
Question by:guilhermeclen
3 Comments
 
LVL 63

Expert Comment

by:SysExpert
Comment Utility
WHat notes ad Domino  version ?

WHy do you need a dynamic FTindex.

Normally just turn it on and leave it set to automatic.

I hope this helps !
0
 

Author Comment

by:guilhermeclen
Comment Utility
My lotus notes version is 7.5 and 8.0.
And I will try to explain the whole process.
I import SQL Server data to a lotus notes database six times a day.
Every time I cared, I had to delete all documents and create them all again. The database has at least  20,000 documents, what make the process heavy and slow for the lotus notes to select, delete and recreate all these documents.
So I decided to change the process and make it faster. Every time the data is imported, I delete the database and rebuild from a template, in the end I have to create the index.
The database contains information on inventory, invoices and more sales information. This database is  available on our extranet, and it is based on Lotus Notes.
To create the index, I use the code that I posted before.
0
 
LVL 46

Accepted Solution

by:
Sjef Bosman earned 500 total points
Comment Utility
You delete and import TWENTYTHOUSAND documents SIX times per day? The number of deletion stubs will be astronomical after 90 days...

Why don't you buy NotesSQL, for a two-way replication out of the box?

The alternative would be to add a key that is unique on both sides, so you can walk through the SQL rows and retrieve the corresponding document in Notes. Then compare both sides and find out if anything has to be modified.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

I thought it will be a good idea to make a post as it will help in case someone else faces these issues. I trust this gives an idea how each entry in Notes.ini can mean a lot for the Domino Server to be functioning properly. This article discusses t…
This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now