ANy suggestions about this Search Feature?

Hello Everyone,

I need to create a Search feature where a text string can be searched for in any particular selected view. I have created a form and am planning to insert this form in frameset. The views available for a user to select from is populated according to their roles.

The problem is coming in searching only in a selected view. Using FTsearch is not giving desired results, its searching thro all the documents irrespective of view. Tried doing a full-text search of all the entries in the view entry collection and placing the results in a folder. But folder remains empty as i cant give any queryopen code.

Can anyone suggest how to approach this…?

Thanx in advance…

Subject: ANy suggestions about this Search Feature?

Using FTsearch is not giving desired results, its searching thro all the documents irrespective of view.

You have to use the FTSearch method of NotesView, rather than the FTSearch method of NotesDatabase.

Tried doing a full-text search of all the entries in the view entry collection and placing the results in a folder.

But folder remains empty as i cant give any queryopen code.

I don’t understand this. It might help if you posted code. See, (A) you can give Queryopen code for a folder, and (B) I don’t understand why you would need to in this case anyway.

The free download that accompanies this article may be of help: Views Part 1.

If the above does not solve your problem, we need more information about what you’re doing. If you’re not sure what information to supply, the C R I S P Y document might help you.

  • Andre Guirard, IBM/Lotus Development

Useful blog: Best Practice Makes Perfect

Subject: RE: ANy suggestions about this Search Feature?

Thnx for the response Andre. And sorry, I am not good enough wit Designer.

Used the FTsearch for NotesView and got the documents in the folder.

But now the problem is removing the documents from folder when a new search is executed. Any suggestions for that.

How can i remove the documents from folder without deleting them. Have been trying to select all the documents in a folder wit AllEntries and other such properties, but it returns “Object variable not set” even after being declared properly.

I have been trying to select documents from folder as we select from view. but that doesn’t seem to be working.

Can anyone suggest something…?

Subject: RE: ANy suggestions about this Search Feature?

You can’t just declare a variable. You also have to assign it. Otherwise, yes, you can get the Object variable not set error. If you are assigning it, sorry, but I have no way to tell since you have not provided any code.

Desktop private folders are more difficult to work with than shared private folders because there’s no way to get the NotesView object of a desktop folder. However, you can use formula commands to select and remove all documents from the folder after it is opened on screen.

If the above does not solve your problem, we need more information about what you’re doing. If you’re not sure what information to supply, the C R I S P Y document might help you.

Subject: RE: ANy suggestions about this Search Feature?

Hi, Again thanx for the response.

Got the problem solved. Issue was my trying to work with folder as we do with views. I tried to delete the documents in Notes Shared folder with codes similar to ones used to delete docs from views… I tried that bcoz RemoveAllFromFOlder property was not working…

As nothing seemed to work, I deleted all the codes and started afresh and viola… every thing worked as desired. Below is the working code…

Dim folderview As NotesView	

Dim foldervc As NotesViewEntryCollection



Set folderview = db.GetView("Search Results")

Set foldervc = folderview.AllEntries

Call foldervc.RemoveAllFromFolder("Search Results")