that we create search functionality for our Corporate directory. The key was that they wanted a custom look on the page and that the search be applied to only certain fields in this database and that the results be displayed in alphabetical order without the relevence boxes?. Outch! We tried to build the search in Lotusscript? it seemed to work great at first, but as soon as we added any type of user load it would take a long time to return the results (3-4 minutes), it's a huge database. We then tried the following method which has worked like a charm! Enjoy!
Search form where the entry field is contained: SideBar
The search results form: $$SearchTemplate for WebSearch
View that will contain the search results: (WebSearch)
I added this script around the $$ViewBody in the $$SearchTemplate for WebSearch:
for (i = 0; i < sortit.length ; i++)
ss = sortit[i].toString();
pos = ss.indexOf("[");
disp = ss.substr(pos+1);
I have a field called ?namesearch? where the user will enter a name to search on:
?namesearch? (editable text field)
In the form where the user is entering the name to search on, the following code must be added to the $$Return This code builds the url to be used in the search that will bring back the specific info we need from designated fields only.
criteria := @If(@Contains(namesearch;" ");@ReplaceSubstring(namesearch;"
In the view ?(WebSearch)? I added the following code to the first column that displays the information to the web client? all the HTML formatting is used to display the information returned in a pleasing manner:
"sortit[j]="" + LastName + "," + FirstName + "[" +