Using FTSearch on the Web

Hello,

Sorry to have to ask a basic question, but I’m not getting how to use FTSearch on the web. I’ve got a $$SearchTemplate Form with a button that calls an agent which does the FTSearch. Here’s the code (in its basic form right now):

Dim session As New NotesSession

Dim db As NotesDatabase

Dim doc As NotesDocument

Dim ndc As NotesDocumentCollection

Dim qstring As String

Print “Search is about to Start”

Set doc = session.DocumentContext

Set db = session.CurrentDatabase

qstring=doc.GetItemValue(SearchQuery)(0)

Print qstring

Set ndc=db.FTSearch(qstring,0)

Call ndc.PutAllInFolder(“Results”)

Print “Agent Complete”

The Print Statements all show except qstring. I’m guessing that since the form isn’t being saved, Lotusscript doesn’t see anything in the field SearchQuery. So how do I do the following:

  1. Somehow get the string contents out of that field into my agent?

  2. How do you redirect the browser to the folder where the results are stored?

I tried to search this forum for the answers before hand but besides someone suggesting using print statements to show the results (which I don’t really want to do)I haven’t found how people are displaying FTSearch results on the web.

Subject: Using FTSearch on the Web

Hi,

$$Return cannot be used to redirect to a view after Searching, as it will only work when the document is submitted.

Hence you have to redirect explicitly by using this code.

redirectpath = “”

Print redirectpath

Please change the folder name in the above url.

Also, regarding to get the value entered in the text field we can use

doc.Searchfield(0) if the field name is Searchfield.

Subject: RE: Using FTSearch on the Web

Hi G Veerappan,

Thanks for the feedback. I’ll keep that info in mind regarding $$Return. When I didn’t get a reply yesterday, I decided to just create a view with all docs from the database and use the current method we have for search, which involves building a URL string and using the SearchView URL. That gets the job done for now. Thanks for your time.

Subject: Using FTSearch on the Web

Hi, you can create an agent adn execute this in format url…

bye

Subject: RE: Using FTSearch on the Web

Hi Luiz,I put the following URL behind the button:

“[/”+@WebDbName + “/search?OpenAgent”+ “]”

When I click the button, it just stays on the page. In my $$Return Field I have:

“[/”+@WebDbName + “/results?SearchView”+ “]”

This URL point to the results folder where the document collection is placed. If I look at the folder in the Notes client, there are no documents there. The agent is not getting the query typed into the field. Have you created a custom search using LS and FTSearch? How did you grab the query from a web form? How did you then redirect it to the results folder (on the web)?