Implement the CGI search using 2 Perl script CGI files:
- search_form.cgi - is the page that contains the actual search page and should be loaded into the TOC frame when the Search link is selected in the TAB frame.
- search_index.cgi - is the page that indexes the HTML files once they have been loaded to the web server.
Because you want each Author-it book to be indexed independently of the others, and because CGI script usually execute in one location on a server, you need to be able to specify a parameter to define which Author-it book you want to search.
Both of these files accept the command line parameter SEARCHDIR. This parameter specifies the folder containing the Author-it published book on the server.
- Set up Author-it to produce a book configured for the CGI FTS as described in Set up the server side search.
- Upload the search_form.cgi and search_index.cgi files to your cgi-bin folder (or equivalent) on your web server. These should be set to read, executable, but you may want search_index.cgi protected to prevent outsiders from reindexing your books.
Note: Your web server must support Perl CGI scripts.
- Modify the tab_toc.htm, and tab_index.htm files to link to the cgi-bin folder on your web server and change the SEARCHDIR= parameter to point to the web server folder your Author-it book will be published in. The default is cgi-bin/search_form.cgi?SEARCHDIR=tripane.
Note: You may want to rename and save these changed files. If you do, make sure that the new files are referenced in the HTML Additional Files property of your Author-it Book object.
- Publish the Author-it book and upload all the files in the publishing folder to your web server.
- Run search_index.cgi to index your uploaded HTML files.
Do this each time you change the HTML files. Assuming that your domain is www.mydomain.com, your cgi-bin folder on your web server is cgi-bin, and that the folder you placed your published Author-it book on your web server is myfolder, then your browser URL is:
Progress displays as the script indexes your Author-it published HTML. Once complete the file search.idx is created in the same folder as your Author-it published HTML.
Now you should be able to open your Author-it published HTML in your browser and try some full text searches. It supports full boolean expressions.
- Use "and" (default) and "or" with search terms.
- Write umlauts like Ä as Ae, ...
- "cat and mouse" - or simply "cat mouse"
- "(cat or mouse) and not dog"
- "cat or mouse"
- "not" operates only within the set of files containing at least one of "cat", "mouse" or "dog".