Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

FTSearch for view doesn't really work, does it?

157 views
Skip to first unread message

Dee Philipp

unread,
Nov 26, 1998, 3:00:00 AM11/26/98
to
All I want to do is conduct an FTSearch on a view and then filter the
view to show only the documents that match the search criteria.

The Lotus Notes Online Help claims that it can be done, and I followed
their example to a T. That didn't work, but after trying different
things, I did get it to work and was able to retrieve the number of
documents in the view that match the search criteria.

BUT HOW DO I FILTER THE VIEW? I even used doc.GetFirstDocument, but that
didn't do anything. I'm conducting this search from an Action button.
Any examples or ideas...anyone? Below is the code I'm using. I'm
desperate. It's Thanksgiving, and I've pulled an all-nighter.


Dee Philipp
e-mail: bing...@usa.net

====================================================================
ACTION BUTTON SCRIPT:
====================================================================
Sub Click(Source As Button)

Dim session As New NotesSession
Dim db As NotesDatabase
Dim j As Integer
Dim johnny As NotesView
Dim doc As NotesDocument
Dim num As Integer

Set db = session.CurrentDatabase

' If db.IsFTIndexed Then
' Messagebox "Is full text indexed " _
' & db.LastFTIndexed
' Else
' Messagebox "Database is not full text indexed."
' End If

Set johnny = db.GetView( "By _Author" )

j = johnny.FTSearch( "five", 0 )

Set doc = johnny.GetFirstDocument
' BUT NOTHING HAPPENS...THE VIEW DOESN'T CHANGE!

If j > 0 Then
Messagebox "Found something...somewhere." & Str$(j)
End If


End Sub

=======================================================================

Ian O'Rourke

unread,
Nov 26, 1998, 3:00:00 AM11/26/98
to
I had this problem also, though I realise it may not be your problem.
FTSearch only works on indexed documents as you know, I found that Notes
does not index documents immediatly, and as such depending on the indexing
rates, and the document composition rate their will always be items in the
view that are not found with an FTSearch. Remember, you could build the view
before each search, but this could get slow, and only works on local copies.

My situation allowed me to place the value I wanted to seach, a ship name,
in the first column of the view (remember you can have another view which
shows the data in a search specific order but it is not the one the 'client'
sees) ordered in ascending order (or whatever). You then use
GetAllDocumentsByUniqueKey, which would have the Ships Name passed to it and
it would pull out all documents into a collection whether the Full Text
index was current or not.

In your case it may be a persons name, a department or an ID number, the
principle is the same, put that field in the first column, index it and then
pass the value to GetAllDocumentsBuUniqueKey - I nearly prayed for
delieverence when I found this command.

Hope it helps!!!


Dee Philipp wrote in message <365D61...@email.com>...

J Knezevich

unread,
Nov 26, 1998, 3:00:00 AM11/26/98
to
FTSearch works just fine. What your code is doing is instantiating back end
objects. This will have no effect on the front end objects that are
displayed to the user. I'm not aware of how to programmatically accomplish
what you are trying to do. However, Domino can do this via the web using a
$$SearchTemplate form.

John Knezevich
CLP


garys...@my-dejanews.com

unread,
Nov 27, 1998, 3:00:00 AM11/27/98
to
Dee

You're getting the backend view, which won't effect what the user sees

I've done this in the past for a similar request.

1. Prompt user for selection value & store in an evironment var 2. Run a
selection agent that selects all docs meeting the criteria from the var. 3.
Run a "run once @commands may be used" agent that has the command formula
ViewShowOnlySelected. 4. Give them a toggle button to turn it off.

If the selection value is always the same you can omit step 1.


Gary


In article <365D61...@email.com>,

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own

Richard Abraham

unread,
Dec 1, 1998, 3:00:00 AM12/1/98
to
Dee,

This is probably too late now, but I hit a similar problem when I was
attempting to filter views to certain documents only. In the end, I put in
a logical field in the document, wrote a routine in script that reset the
value to False for all documents, then set it to True only for the documents
that met the conditions of the time (in this case if the body contained a
phrase the user had typed into a field in a custom 'search' form), and then
changed the select condition for the view to only show documents where the
logical field was set to True. That worked out well for me.

Dee Philipp wrote in message <365D61...@email.com>...

0 new messages