Monday, November 08, 2010 at 12:04 AM.
system.verbs.builtins.mainResponder.search.server.index
on index (title, url, bodyText, siteName, siteUrl, client, flShowText, lastModDate=nil, indexName=nil) {
<<Index one page.
<<Make sure this is a search engine server.
if not config.mainResponder.prefs.flSearchEngine {
return (false)};
<<Make sure Index.root exists and is open.
mainResponder.search.utilities.assureIndex (indexName);
local (indexPath = mainResponder.search.utilities.getIndexPath (indexName));
msg ("Search Engine: Indexing: " + url);
if lastModDate == nil {
lastModDate = clock.now ()};
<<De-index this page.
mainResponder.search.server.deIndexPage (url, indexName:indexName);
<<Build the table of info about this page.
mainResponder.search.server.buildPageInfo (bodyText, title, url, lastModDate, siteName, siteUrl, flShowText, indexName);
<<Add this page to the index.
mainResponder.search.server.indexOnePage (url, title, bodyText, @searchEngine.data.stopWords, indexName);
<<Log this index.
mainResponder.search.server.logIndexedPage (url, title, siteName, siteUrl, client, indexName);
msg ("");
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.