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

system.verbs.builtins.searchEngine.indexRemotePage

on indexRemotePage (s, url, title, lastModified, siteName, adrStopWords=nil) {
	<<Index a page that does not live in this odb.
		<<This script should be called from an RPC handler
		<<that allows remote sites to add their pages
		<<to the search engine.
	
	local (adrIndex = searchEngine.getIndexAddress (siteName));
	local (adrPreviews = searchEngine.getPreviewsAddress (siteName));
	
	if adrStopWords == nil {
		adrStopWords = @searchEngine.data.stopWords};
	
	msg ("SearchEngine: Indexing: " + url + ".");
	
	<<Create the preview. Always create a preview before indexing the page.
	searchEngine.createPreview (s, title, url, url, adrPreviews, lastModified);
	
	<<Index the page.
	searchEngine.indexPage (url, url, title, s, adrIndex, adrStopWords);
	
	<<Save the guest database containing the index.
	searchEngine.saveIndex (siteName, adrIndex);
	
	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.