|mnoGoSearch 3.2.43 reference manual: Full-featured search engine software|
|Prev||Chapter 3. Indexing||Next|
Since mnoGoSearch version 3.2.2, it is possible to store compressed copies of the indexed documents, so called cached copies. Cached copies are stored in the same SQL database.
If cached copies creation is active, then one can open the cached copy in the browser during search time. The cached copy is especially useful if the site's server is temporarily down or the page does not exist any longer.
Cached copies are displayed by means of the search.cgi CGI script, executed with a special HTTP query string parameters. search.cgi fetches a cached copy of the document from the SQL database, then the document is displayed in your web browser, with search keywords highlighted.
To enable cached copies support, compile mnoGoSearch with zlib support:
./configure --with-zlib <other arguments>
To start using cached copies, please do the following:
Open /usr/local/mnogosearch/etc/indexer.conf in your favorite text editor and add this line:
Section CachedCopy 0 64000
where 64000 is maximum compressed cached copy size. If after compression a document's cached copy size is bigger than this number, then the cached copy is not stored. You can change this number according to your needs and your SQL database features.
To enable displaying cached copies during search time, do the following:
Make sure you have a cached copy link in your search.htm <!--res--> section: e.g. <A HREF="$(stored_href)">Cached copy</A> . You may take a look into default search template search.htm-dist to see an example.
Optionally specify an alternative search.cgi URL in your search.htm. By default $(stored_href) will refer to the same search.cgi. However it is possible to reside displaying cached copies under another location, and even on another physical machine thus distributing CPU load. In this case you can specify another URL by adding the following line to search.htm variables section:
Or an absolute path:
After cached copies have been configured, it works in the following order during search time:
For each document a link to its cached copy is displayed;
When the user clicks the link, search.cgi is executed. It sends a query to the SQL database and fetches the cached copy content.