In DataparkSearch it is possible to store compressed copies of indexed documents. Copies are stored and retrieved by the new daemon - stored, that is installed into sbin directory of DataparkSearch installation (default: /usr/local/dpsearch/sbin).
Stored document copies are retrieved by means of storedoc.cgi CGI script. It requests a saved copy of a documents from stored, then a copy is displayed with user's web browser with search keywords highlighted.
To enable stored support, compile DataparkSearch with zlib support:
./configure --with-zlib <other arguments>
You may use the Store and NoStore commands to allow or disallow storing several files by pattern. For arguments of those commands are exactly the same as for the Allow command (see Section 3.10.14>). All documents are stores by defaults, if support for stored is enabled.
To start using stored, please do the following:
Copy /usr/local/dpsearch/etc/stored.conf-dist to /usr/local/dpsearch/etc/stored.conf.
There are several commands available for using with stored:
Or address only:
Or both address and port:
Configure indexer.conf and search.htm (or searchd.conf, if searchd is used). Specify address and port that indexer will use to connect to stored. Use stored parameter for DBAddr command, e.g.:
After you have successfully configured stored, the indexer pass downloaded documents to stored daemon. After that, stored compress the received documents and save them.
To enable displaying stored documents during search, do the following:
Configure storedoc.htm (storedoc.cgi template) if necessary.
Add a storedoc.cgi link to search.htm <!--res--> section: e.g. <A HREF="$(stored_href)">Cached copy</A>
Specify storedoc.cgi CGI script URL in search.htm (by default $(stored_href) will return /cgi-bin/storedoc.cgi). In case you have to specify other URL, add to search.htm variables section the following line:
Or an absolute path:
This is how stored works during search, if everything configured correctly:
search.htm displays a link to storedoc.cgi;
When user clicks the link, storedoc.cgi sends a query to stored daemon to the address, specified in storedoc.htm with the Stored parameter of DBAddr command;
After the query, stored will decompress the requested saved copy and send it to storedoc.cgi;
stored is also used to make documents excerpts for search results.