|
|
|
|
|
|
|
|
|
|
|
|
|
|
Adding Search functionality to Domino (continued)
Finally, you need to modify the Search button in the $$Search form to use this formula:
@URLOpen ( "/" +
@WebDbName +
"/" + SearchView + "/?SearchView&Query=" + Query +
"&SearchOrder=" + @Text ( Sort ) +
"&SearchMax=" + @Text ( MaxResults ) +
"&SearchWV=" + @If ( ExactMatch = ""; "TRUE"; "FALSE" ) +
"&SearchThesaurus=" + @If ( UseThesaurus = ""; "FALSE"; "TRUE" )
)
|
The only change here is that instead of using the default "DiscussionSearchResults" view, the view name contained in the SearchView field is used instead. Now when the user searches on "Domino", the search results are displayed using the current view. In Figure H, the search results are displayed using the "All Documents" view, the view where the user clicked on the [Search] action.
FIGURE H
 
Results are now displayed with the All Documents view. Roll over picture for a larger image.
Customize the display of the search results While Domino will use the view you specified in the [Search] button formula to display the search results, results are displayed inside of the default search form. As a result, the look and feel of the search results page may not match that of the current application.
To avoid this behavior, you can create a $$SearchTemplate to display the user's search results using a customized format. If you want the search results to look the same regardless of the view the user searched, all you need to do is create a $$SearchTemplateDefault form.
Otherwise, you can create a $$SearchTemplate for each view that requires a specialized format for search results. Table D details the fields you need to add to your $$SearchTemplateDefault form.
| Field label |
Field name |
Type |
Ouput |
| Search results for |
Query |
Text |
Computed |
| documents found matching search criteria |
TotalHits |
Text |
Computed |
| N/A |
$$ViewBody |
Text |
Editable |
The three computed fields above use their names as the value formula. The $$ViewBody field is used by Domino as a placeholder for the view that will display the search results.
When the user searches on "Domino", the search results are displayed using the $$SearchTemplateDefault form, like you see in Figure I.
FIGURE I
 
Results are displayed using the $$SearchTemplateDefault form. Roll over picture for a larger image.
Conclusion Adding a custom search form and search template to a Domino application is easy. You can use the $$Search form as the foundation for adding more advanced search capabilities. For example, you can include Domino equivalents of the predefined search conditions available to Notes client users.
You can provide the user with the ability to search for documents within a date range, by author, by field value and so on. You can also modify your $$SearchTemplateDefault so that users can page through result sets instead of getting them all in one shot. The possibilities truly are endless!
Michael Sobczak is a certified Notes/Domino, Java and WebSphere developer for NuTechs, an IBM Premier Partner based in Bloomfield Hills, MI. You can read about his exploits on his Weblog at http://www.punkdbynotes.com
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- Advertisement --
Sophisticated Meets Simple For Document Management
Share. Control. Manage.
Documents, emails, and content in the context of how work is done.
Native to Lotus Domino. The User Experience unseen for Lotus Domino.
Do more with less. Really.
See the possibilities Docova unleashes for Lotus Domino. |
-- Advertisement --
Mark your calendar for in-depth Lotus training, May 12-14, Boston
Join experts and peers May 12-14 in Boston for educational and networking events that deliver real-world Lotus training so you can increase productivity and efficiency in your company, advance your skills, and squeeze the most from your current environment. One registration gets you into THE VIEW's Admin2010 and Lotus Developer2010.
Register by April 10 to save $200. |
|
|
|
|
|
|
|
|
|
|