clear (NotesView - JavaScript)

Clears the full-text search filtering on a view.

Defined in

NotesView

Syntax

clear() : void

Usage

Subsequent calls to getDocument methods get all documents in the view, not just the search results.

Examples

This button puts documents in a folder based on a view search, clears the search, and puts documents in another folder based on another search of the same view.
database.updateFTIndex(true);
var v:NotesView = database.getView("main");
var query:string = requestScope.query;
if (!query.isEmpty()) {
	if (v.FTSearch(query) > 0) {
		var doc:NotesDocument = v.getFirstDocument();
		while (doc != null) {
			doc.putInFolder("Search Results", true);
			tmpdoc = v.getNextDocument(doc);
			doc.recycle();
			doc = tmpdoc;
		}
	}
}
v.clear();
if (!query2.isEmpty()) {
	if (v.FTSearch(query2) > 0) {
		doc = v.getFirstDocument();
		while (doc != null) {
			doc.putInFolder("Search Results 2", true);
			tmpdoc = v.getNextDocument(doc);
			doc.recycle();
			doc = tmpdoc;
		}
	}
}