Installation guidelines:

1. Edit configuration variables in the init.php file.

2. Upload all files to your server.

3. Open setup.php script in your browser
   and follow the guidelines therein to index your website.

4. Check search.php script to see how to use search engine.

5. If you want to (re-)index your webpages dynamically,
   you need to add two PHP includes to the header and footer sections:

   a. The following code should be placed at the beginning of a webpage:
      <?php include_once "path_to_auto.php"; ?>
      This code will turn on buffering of HTML output.

   b. The following code should be placed at the end of the webpage:
      <?php src_auto_index("http://web_page_url"); ?>
      This code will compare the HTML output with the indexed content
      and (re-)index webpage, if necessary.
      Note that you should pass the URL of the webpage to the function src_auto_index.

   The advantage of this method of dynamic indexing is that
   it does not require additional bandwidth. However, if you have other scripts
   that improperly use output buffering, this might not work.

   Check sample.php script to see how to implement dynamic re-indexing.


Templates overview:

1. template_none    - template for the page for the case when no results found

2. template_results - template for the page with search results

   %%ind%%      - links th the pages with search results
   %%ref%%      - search results
   %%numrows%%  - total number of search results
   %%time%%     - query time

3. template_result  - template for the search result

   %%excerpt%%  - relevant excerpt
   %%title%%    - webpage title
   %%url%%      - webpage url

4. template_page_page_ref - template for the link to the         page with search results
   template_page_page_cur - template for the link to the current page with search results

   %%offset%%   - the sequence number of the first search result on the current page
   %%page%%     - the sequence number of the current page
   %%q%%        - search query


If you have any difficulties installing the script, feel free to contact me.

If you find this script useful, consider placing the link to the homepage of this script
http://www.php-development.ru/php-scripts/search-engine.php
somewhere on your site.

Ilya S. Lyubinskiy
http://www.php-development.ru/