Search DominoPower's 11,441 Lotus-related article archive 
Home
EasyPrint
News details Click here for the RSS feed's XML code. This is not a browser URL.
Articles-only Click here for the RSS feed's XML code. This is not a browser URL.
Twitter Feed Click here for the Twitter feed.
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


« Previous  ·  1  ·  2  ·  3  ·  4  ·  5  ·  6
Other articles you might like
Home > Lotus Technologies > Domino (77 articles)
   More about Domino log files
   Why your log.nsf might not be purging properly
   Sloppy analysis at the core of another Domino vs. SharePoint report
Get Weekly Email Updates
Subscribe to our regular weekly email newsletter. It's packed with tips, reviews, deep analysis, and the latest news.
 
Recent DominoPower Articles
Application development, William Shatner, and the origin of the universe
Learn Domino Designer 8.5 for free
The (near) future of Sametime, Quickr, Connections, and Symphony
Inside the IBM Innovations lab
Lotusphere 2010: Hot fixes and cool news for Notes, Domino, and LotusLive
Lotusphere 2010: mobility and collaboration
2010: A Lotusphere of change
Latest Lotus Headlines
Xpages not loading? JVM errors? - Solution
How to implement an iCalendar feed into your Notes calendar with XPages
DWA Hotfixes for Domino 8.5.1FP1 - A Gotcha
IBM Adds DB2 to Lotus Foundations SMB Package
SNTT : XPages onclick Ghosts in the machine
Ports used by Lotus Sametime 8.5 servers
Exploring a Domino Date Bug
>> Read all the news
More from the ZATZ journals
Computing Unplugged: The iPad defenders have spoken
David Gewirtz Online: CNN commentary and analysis
OutlookPower: More about disappearing text
-- 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.
ZATZ Home  ·  News  ·  Back Issues  ·  Credits/Trademarks ·  Link To Us
Copyright © 1998-2010, ZATZ Publishing. All rights reserved worldwide.
Editor's Login