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
340 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
ID: 24291259
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
ID: 24291969
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
ID: 24294267
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Problem "Can you help me recover my changes?  I double-clicked the attachment, made changes, and then hit Save before closing it.  But when I try to re-open it, my changes are missing!"    Solution This solution opens the Outlook Secure Temp Fold…
For beginners of Lotus Notes user this is important to know about the types of files and their location supported by IBM Notes. Mostly users are unaware about how many file types are created and what their usages are. This Article is fully dedicated…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

863 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

24 Experts available now in Live!

Get 1:1 Help Now