<%@ Language=VBScript %>
<HTML>
<HEAD>
<META NAME="; GENERATOR; " Content="; Microsoft; Visual; Studio; 6#; ">
</HEAD>
<BODY>
<%
'URL http://yourserver/Demo9.asp?key=keyWord
Dim s 'As New NotesSession
Dim db 'As NotesDatabase
Dim v 'As NotesView
Dim vn 'As NotesViewNavigator
Dim e 'As NotesViewEntry
Dim doc 'As NotesDocument
Set s = CreateObject("Lotus.NotesSession")
Call s.Initialize
Dim serverName
serverName = ""
Response.Write("<h2>Full Text Search Result</h2>")
Dim dbName, keyWord
keyWord = Request.QueryString("key")
dbName = "employees.nsf"
Set db = s.GetDatabase(serverName, dbName)
If (db is Nothing) then
Response.Write("<p>Cannot find the database: " + dbName)
Else
Response.Write("<p>Database: " + db.FileName + "<br>")
Response.Write("Key Word: " + keyWord + "<br>")
End if
Call db.UpdateFTIndex(true)
Set dc = db.FTSearch(keyWord, 100)
Response.Write("Records: " + CStr(dc.Count) + "<br><br><br>")
Set doc = dc.GetFirstDocument()
Dim thisItem
If Not (doc is Nothing) then
Response.Write("<table border=1 bgcolor=#CCCCCC>")
Response.Write("<th>ID")
Response.Write("<th>First Name")
Response.Write("<th>Last Name")
Response.Write("<th>Department")
Response.Write("<th>Title")
End if
While Not (doc Is Nothing)
Response.Write("<tr>")
Set thisItem = doc.GetFirstItem("ID")
Response.Write("<td>" + thisItem.Text + "</td>")
Set thisItem = doc.GetFirstItem("FirstName")
Response.Write("<td>" + thisItem.Text + "</td>")
Set thisItem = doc.GetFirstItem("LastName")
Response.Write("<td>" + thisItem.Text + "</td>")
Set thisItem = doc.GetFirstItem("Department")
Response.Write("<td>" + thisItem.Text + "</td>")
Set thisItem = doc.GetFirstItem("Title")
Response.Write("<td>" + thisItem.Text + "</td>")
Set doc = dc.GetNextDocument(doc)
Response.Write("</tr>")
Wend
Response.Write("</table>")
%>
</BODY>
</HTML>
Below is an HTML file to drive the ASP:
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<TITLE></TITLE>
</HEAD>
<BODY>
<form method=GET action="http://mkoma4/COM_AspSep28/Demo/Demo9.asp">
<h2>Full Text Search on Employees Database</h2>
<br>
<br>
<P>Input A Keyword:
<input name=key size=20>
<br>
<br>
<br>
<input type=reset value="Clear Form">
<input type=submit value="Submit">
</form>
</BODY>
</HTML>