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
346 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

Question has a verified solution.

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

You’ve got a lotus Domino web server, and you have been told that “leverage browser caching” is a must do. This means that we have to tell the browser everywhere in the web to use cache. In other words, we set (and send) an expiration date in the HT…
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…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

635 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