LotusScript button saves time searching large Lotus Notes databases

If you have a Lotus Notes database containing a large amount of data (more than 10 GB), searching for a single word or couple of words can take a great deal of time and may not always produce accurate results. This LotusScript code performs the search activity in your Lotus Notes database and replaces the view selection criteria per the search query. This accurately searches your Lotus Notes database and generates a result in just a few seconds.

While working on a project, I came across a Lotus Notes database that had approximately 20 GB of data. One part of the project requirements from the client side was to develop a search functionality with the following criterion:

  1. Work on multiple search criteria
  2. Take as little time as possible
  3. Use a minimal amount of system resources
  4. Be easy to use
  5. Display the correct results

The following elements were used in the test environment:

  • One Lotus Notes database with a large amount of data (20 GB)
  • One search form
  • One frameset to show the view
  • One view to display the search results by changing the view selection formula

There are nine multi-value fields on the search form. Lotus Notes users can select single or multiple search criteria using these fields.

Related resources from SearchDomino.com:
How to clear a Lotus Notes local cache with LotusScript

LotusScript to update and save Lotus Notes profile documents

Display a custom message box using a LotusScript-generated button

Once the search criteria is defined on the search form -- after selecting multi-value fields -- the user clicks on the search button. The LotusScript code shown below is placed in that button. When the button is selected, the code written on its click event will be triggered as follows:
  1. It will declare variables.
  2. It will create a view selection formula based on the selection of multi-value fields.
  3. The code will put the search query into an array, remove null values and put "&" after each search criteria.
  4. Obtain the handle of the view through a back-end object.
  5. Set the view-selection formula according to the newly created view selection formula from the LotusScript code.
  6. Open the same view inside the frameset.

Note: These steps will take some time during your initial database search.

LotusScript to search large Lotus Notes databases
(Click on code for enlarged view and script download.)

Do you have comments on this tip? Let us know.

This tip was submitted to the SearchDomino.com tip library by member Niranjan Singh. Please let others know how useful it is via the rating scale below. Do you have a useful Lotus Notes/Domino technical tip or code snippet to share? Submit it to our monthly tip contest and you could win a prize.

This was first published in December 2008

There are Comments. Add yours.

TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.