Zoom Front End - CD & Desktop searching without a web server

For advanced users and software developers

Wrensoft has a number of different technical options that are available for adding a search function to a CD, DVD. So you should check that you are using the CD Search solution best suited to your project before starting.

While Javascript is a good solution for distributing small sites on CD it is limited in what it can do. In some cases it will be better to use the CGI option for adding a search function to a CD or DVD or for building a desktop search solution. The Zoom CGI option is normally used for searching large web sites but it can be adapted for searching CDs, DVDs and, for example, providing a desktop search solution for colections of PDF files.

There are two solutions for running the CGI version of Zoom on a CD / DVD. The 1st solution requires the use of a webserver. See this page for use details about using a webserver on a CD. The 2nd solution is by wrapping the CGI with some front-end software that can provide a user interface for the CGI. It is this 2nd option that is discussed on this page, along with an example application and source code.

How the CGI version normally works

Normally the user enters their search request into a HTML form. This information gets sent to the web server software which in turn passes on the encoded data to the search.cgi executable file.

How the CGI search engine works with a web server

The Zoom search.cgi software looks into the index files and creates the search result, then sends it back to the browser via the web server. This solution can't work on a CD or on the Windows desktop because there is normally no web server available to get the input from the browser and pass the information to Zoom.

The Zoom CGI Front End

The Zoom CGI front end (Zoom FE) is a software application that shows how it is possible to remove the need for a web server. It is mainly aimed at the software developer that wants to include Zoom as part of their solution for CD / DVD searching or developers wanting to build a desktop search solution. However it is functional enough for people to use it directly, without the need for customization. There are enough details for 3rd party developers to build a solution around Zoom or we can customize the solution to meet your exact requirements. Using this front-end, the new diagram will look something like this.

How the CGI search engine works on a CD with Zoom FE

Comparing the two diagrams you will note that the index files remain the same and the search.cgi file remains the same. The browser has been removed and replaced by Zoom FE and the internet is not present becuase we are doing a local search on a CD.

Zoom FE Screen shot (V1.x)

CD and Desktop search example

Clicking on the search button will cause Zoom FE to pass the search words and other parameters to the search.cgi executable and then collect the search results in HTML format and display them in a window.

Hint: In V1, You will need to use the search box at the top of the window, and you will need to disable the "second" search form which is normally generated as part of the results page. You can do this from the Indexer's Configuration window (under the "Search Page" tab, select "Do not generate" for "Search form").

How Zoom FE works (the technical details)

Zoom FE simulates the workings of a web server and provides an API interface to the search function by,

  1. Setting up the environment variables that the search.cgi executable expects to find. In particular it sets the HTTP environment variables QUERY_STRING and REQUEST_METHOD. This makes search.cgi think the user input has come from a HTML form via a web server.
  2. Spawns the search.cgi script with the environment created in step 1.
  3. Redirects and collects the output of search.cgi so that the search results generated by search.cgi can be read from a memory buffer. This is done by re-directing the 'stdout' output from search.cgi into a 'pipe'.
  4. Displays the HTML code, which contains the search results, in a HTML window. Using a style sheet to set the text color and fonts.

The two sets of example source code provided (below) shows how this can be done. We have written the same code twice. Once in C/C++ and once in VB.NET. In both cases a Windows executable is produced. These are just example and the same concepts could be used in just about any programming language, on any platform.

The Zoom Indexer is still required to create the index files. This 'front end' software (Zoom FE) can then be used to call the search.cgi executable supplied with Zoom and collect the results for display.

Files required

The following files should be placed in the same directory

File name Description
CGIFrontEnd.exe The Windows executable file built from either of the source code packages below. Run this file to start the search function.
search.cgi The Zoom CGI search function that comes with the normal Zoom installation package. This is also included in the package below.
logo.png A PNG image file that is displayed at the top of the front end window. You can add your own logo by editing this image. This is not used in V1 of the Front End.
search_template.html An example template file in HTML format
settings.zdat Index files generated as a result of indexing your CD or web site with the Zoom indexer V6.

If using V1.x of the FrontEnd, when doing the indexing you should change the configuration for, "Search Form appearance" to be "Do not generate". You will also probably want to turn on exact phrase matching and highlighting.

If using V2.x of the FrontEnd, then you will need to allow Zoom to generate a search form (which is the default setting).
zoom_pagedata.zdat
zoom_dictionary.zdat
zoom_pagetext.zdat
zoom_pageinfo.zdat
zoom_wordmap.zdat

Limitations of the Zoom FE demo

This package is only meant to be a demo to show how 3rd party developers can interface with Zoom. It is not a full search solution. It has the following limitations:

  • It is Windows only, compiled with VS2010 and VS2005 .NET, (but could be ported to Linux and BSD Unix without a great deal of effort)
  • It is implemented in the C/C++ language and again in VB.NET. You can choose one or the other, depending on which of the two languages you are more confortable with. (but the concepts of wrapping the CGI apply equally well to all programming languages)
  • Categories were only implmented in V2.x and not implemented in V1.
  • Local security settings can make it difficult to directly call a executable file from a browser. So it can sometimes be a better solution to autorun an executable file rather than a HTML file from your CD or DVD. See this page for more details of CD search options.
  • In V1 of the FrontEnd, you will need to use the search box at the top of the window, and you will need to disable the "second" search form which is normally generated as part of the results page. You can do this from the Indexer's Configuration window (under the "Search Page" tab, select "Do not generate" for "Search form").

Download Zoom FE with C++ Source Code, V2.1.1000 (For Zoom 7 & VS2010)

Download ZoomCGIFrontEnd Version 2.1 (293 KB Zip file)

Download Zoom FE with VB.NET Source Code, V1.0

Download ZoomCGIFrontEnd Version 1.0 (708 KB Zip file)

Note: Both the above packages will build similar executables. Only the programming language differs.

Back to other solutions for running a search engine on a CD.