Monday, November 08, 2010 at 12:04 AM.

system.verbs.builtins.mainResponder.search.utilities.assureIndex

on assureIndex (indexName=nil) {
	local (indexPath = mainResponder.search.utilities.getIndexPath (indexName));
	if defined ([indexPath]) { //is Index.root already open?
		return (true)};
	if file.exists (indexPath) { //does Index.root exist?
		fileMenu.open (indexPath, true); //it does, open it
		return (true)};
	
	<<Create a new Index.root.
	fileMenu.new (indexPath);
	window.hide (@[indexPath]);
	new (tableType, @[indexPath].pageInfo);
	new (tableType, @[indexPath].index);
	fileMenu.save (indexPath);
	return (true)}



This listing is for code that runs in the OPML Editor environment. I created these listings because I wanted the search engines to index it, so that when I want to look up something in my codebase I don't have to use the much slower search functionality in my object database. Dave Winer.