Go Premium for a chance to win a PS4. Enter to Win

x
?
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
Medium Priority
?
351 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 1500 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

For users on the Lotus Notes 8 Standard client, this article provides information on checking the Java Heap size and adjusting it to half of your system RAM in attempt to get the Lotus Notes 8.x Standard client to run faster.  I've had to exercise t…
Lack of Storage capacity is a common problem that exists in every field of life. Here we are taking the case of Lotus Notes Emails, as we all know that we are totally depend on e-communication i.e. Emails. This article is fully dedicated to resolvin…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

971 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