Storing compressed document copies

Since mnoGoSearch version 3.2.2 it is possible to store compressed copies of indexed documents. Copies are stored and retrieved by the new deamon - stored, that is installed into sbin directory of mnoGoSearch installation (default: /usr/local/mnogosearch/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 support stored, compile mnoGoSearch with zlib support:

    
./configure --with-zlib <other arguments>

  

Configure stored

To start using stored, please do the following:

  • Edit /usr/local/mnogosearch/sbin/stored.conf

    There are two commands available for using with stored: Listen and VarDir.

    • Listen tells stored which address and/or port to bind to. By default stored listens to port 7004 and any address. It is possible to specify port only:

                    Listen 7004 
                  

      Or address only:

                    Listen 127.0.0.2
                  

      Or both address and port:

                    Listen 127.0.0.2:7004
                  
    • VarDir command specifies an alternate var/ working directory, e.g.

                    VarDir /mnt/d/mnogosearch/var/ 
                  
  • Run stored:

              /usr/local/mnogosearch/sbin/stored & 
            
  • Configure indexer.conf. Specify address and port that indexer will use to connect to stored. Use StoredAddr command, e.g.:

              StoredAddr localhost:7004
            

How stored works

After you have successfully configured stored, the indexer pass downloaded documents to stored deamon. After that, stored will compress the received documents and save them.

Using stored during search

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)">Cached copy</A>

  • Specify storedoc.cgi CGI script URL in search.htm (by default $(stored) will return /cgi-bin/storedoc.cgi). In case you have to specify other URL, add to search.htm variables section the following line:

              StoredocURL /path/to/storedoc.cgi
            

    Or an absolute path:

              StoredocURL http://servername/path/to/storedoc.cgi
            

This is how stored works during search, if everything configured correctly:

  1. search.htm displays a link to storedoc.cgi;

  2. When user clicks the link, storedoc.cgi sends a query to stored deamon to the address, specified in storedoc.htm with the StoredAddr;

  3. After the query, stored will decompress the requested saved copy and send it to storedoc.cgi;

  4. storedoc.cig parses the received document and apply highlighting of search keywords. Highlighting method is specified with storedoc.htm HlBeg and HlEnd commands;