.
HCLSoftware Business Partner
Domino Consulting Services
CRUCIAL Notes Tools
+1
212-599-2048
Domino Consulting Services
CRUCIAL Notes Tools
Domino administration
Notes development
Chat now
.
EN - English
CN - 中文
JP - 日本語
DE - Deutsch
FR - Français
BR - Português
RU - Pу́сский
IT - Italiano
IN - हिन्दी
ES - Español
KR - 한국어
ID - Indonesia
NL - Dutch
TR - Türkçe
SA - العربية
SE - Svenska
NO - Norsk
PL - Polski
TH - ไทย
DK - Dansk
MY - Malay
PH - Filipino
GR - Ελληνικά
FI - Suomi
IL - עברית
IE - Gaeilge
CZ - Čeština
UA - Українська
RO - Română
VN - Tiếng Việt
BD - বাংলা
HU - Magyar
Need a Domino Consultant? Call NotesMail +1 212-599-2048
-
HCLSoftware Business Partner
LOTUSSCRIPT/COM/OLE CLASSES
Examples: FTSearch method
1. This agent returns all the documents in the current database that contain a user-specified string.
Sub Initialize
Dim session As New NotesSession
Dim db As NotesDatabase
Dim dc As NotesDocumentCollection
Dim doc As NotesDocument
Set db = session.CurrentDatabase
REM Update full-text index
Call db.UpdateFTIndex(True)
REM Get query and put in quotes
query$ = Inputbox("Enter string to search for", "Query")
If query$ = "" Then Exit Sub
query$ = """" & query$ & """"
REM Get the documents that match the query
Set dc = db.FTSearch( query$, 0, _
FT_SCORES, FT_STEMS)
REM Display Subject for documents matching query
Set doc = dc.GetFirstDocument
While Not(doc Is Nothing)
message$ = message$ & doc.Subject(0) & Chr(10)
Set doc = dc.GetNextDocument(doc)
Wend
Messagebox message$,, _
"Search results " & 1 & " - " & dc.Count
End Sub
2. This agent creates a newsletter of the top ten documents in a database that contain a user-specified string.
Sub Initialize
Dim session As New NotesSession
Dim db As NotesDatabase
Dim dc As NotesDocumentCollection
Dim doc As NotesDocument
Dim news As NotesNewsletter
Set db = session.CurrentDatabase
REM Update full-text index
Call db.UpdateFTIndex(True)
REM Get query and put in quotes
query$ = Inputbox("Enter string to search for", "Query")
If query$ = "" Then Exit Sub
query$ = """" & query$ & """"
REM Get 10 most relevant documents that match the query
Set dc = db.FTSearch(query$, 10)
REM Send newsletter to yourself
If dc.Count > 0 Then
Set nc = New NotesNewsletter(dc)
Set doc = nc.FormatMsgWithDoclinks(db)
Call doc.AppendItemValue("Form", "Memo")
Call doc.AppendItemValue("Subject", "FT search for: " & query$)
Call doc.Send(False, session.UserName)
End If
End Sub
See Also
FTSearch method
Feedback on
Help
or
Product Usability
?
Help on Help
All Help Contents
Feedback on
Help
or
Usability
?
Help on Help
All Help Contents