iSearch PHP Site Search Engine - Installation
- Follow the quick installation instructions.
- To include a search form from another PHP page, include the following PHP
code:
<?php
/* Include the iSearch search form */
/* Optional - set the width of the entry box in chars */
$isearch_searchFormWidth = 12;
/* Optional - set target frame for search results.
* Default value is "_self".
*/
$isearch_resultFrame = "_blank";
/* Optional - add a "Search Internet" button to be displayed.
* Default value is True.
*/
$isearch_allowSearchInternet = True;
define('IN_ISEARCH', true);
include("isearch2/inc/form.inc.php");
?>
Alter the include line to be a reference to the iSearch2 directory.
e.g. if you are editing a file stored at
http://www.yoursite.com/dir1/dir2/file.php, change the include line to:
include("../../isearch2/inc/form.inc.php");
The variable $isearch_searchFormWidth can be used to set the size of the
entry box. If it is not set it will default to 12 characters. If it is 12
characters or less, the "Search Site" button will be displayed below the entry
field, otherwise it will be displayed to the right of it.
The $isearch_resultFrame variable can be used to cause search to be
displayed in an alternative frame.
The $isearch_allowSearchInternet variable can be used to show a
"Search Internet" button on the search form, allowing your visitors to perform
internet searches also.
- To include a search form from an HTML page, you'll have to add the one of
the following sections of HTML code to the page:
For a small search box use the following:
<!-- iSearch search form -->
<FORM METHOD="post" ACTION="/isearch2/index.php">
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="3" CELLSPACING="1">
<TR ALIGN="center">
<TD ALIGN="center"><INPUT MAXLENGTH="255" NAME="s" SIZE="40"></TD>
<TD ALIGN="center"><INPUT TYPE="submit" VALUE="Search Site"></TD>
</TR>
</TABLE>
<INPUT TYPE="hidden" NAME="action" VALUE="search">
</FORM>
<!-- iSearch search form -->
<FORM METHOD="post" ACTION="/isearch2/index.php">
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="3" CELLSPACING="1">
<TR><TD><INPUT maxLength="255" name="s" size="12"></TD></TR>
<TR align="center"><TD><input type="submit" value="Search Site"></TD></TR>
</TABLE>
<input type="hidden" name="action" value="search">
</FORM>
For a large search box, with a help button, use the following:
<!-- iSearch search form -->
<FORM METHOD="post" ACTION="/isearch2/index.php">
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="3" CELLSPACING="1">
<TR>
<TD ALIGN="center">
<INPUT maxLength="255" name="s" size="40">
<input type="submit" value="Search Site">
<input type="submit" name="internet" value="Search Internet">
<A TARGET="_blank" HREF="/isearch2/help.php">Help</A></TD>
</TD>
</TR>
</TABLE>
<input type="hidden" name="action" value="search">
</FORM>
Installation Service
If the installation seems too daunting for you, I can install iSearch on your
server for you. There is a small charge for this service to cover my time.
To see more information about the installation service, please click here.
Keeping your Search Index Up-to-date
It is important to regularly respider your site so that any changes are built
into the search index. There are a number of ways to do this:
- Use the configuration interface "Spider" button, or nativagate to the "isearch2/admin/reindex.php" web page to regenerate the search index manually.
- Set a Unix "cron" job or Windows Scheduled Task on your server to run the spider engine. Use PHP from the command line as follows (replace "/www" with the full file path to your sites root directory):
Unix : /usr/bin/php -q /www/isearch2/admin/reindex.php cmd
Windows : c:\php\php -q c:\www\isearch2\admin\reindex.php cmd
- Use the Auto Spider Engine to keep your site up-to-date.
The Auto Spider Engine
The Auto Spider allows you to keep your search index up to date
automatically. It works by using page requests from visitors to your site to
perform maintainance of the search index. This means that there is no reliance
on manual spidering or cron jobs.
The Auto Spider is a PHP script that produces a 1 pixel transparent image.
This means that it can be triggered by an embedded image in one (or more) of
your web pages. Each time this image is displayed, a single web page will be
spidered. Once the whole site has been spidered, the Auto Spider is disabled for
a configurable length of time, then it starts again.
To install the Auto Spider, follow these steps:
- Choose a page on your web site that is visited roughly the twice the number
of times each day as you have pages on your site. e.g. If you have 20 web pages
on your site, choose a page that is visited about 40 times a day. If your site
does not get many hits, you can choose multiple pages.
- Within the <BODY> section (i.e. between the "<BODY>" and "</BODY>" tags) of your chosen page(es), add the following HTML code:
<IMG SRC="/isearch2/auto_spider_img.php" WIDTH="1" HEIGHT="1">
Modify the "/isearch2" part to the directory into which you installed iSearch2.
PDF Support
There are 2 possible mechanisms for spidering PDF files:
- Executable PDF Support - conversion occurs on your server. Fastest and most efficient.
- Online PDF Support - PDF file is sent to another server, processed and text version sent back. Easiest to setup.
Executable PDF Support
This requires an installation of the
Xpdf package on your server. To install this, either:
- download source code or precompiled binaries from the
Xpdf download page. Once
downloaded, install Xpdf on your server. Only the pdftotext binary
executable is required (and can simply be copied anywhere on the server).
- download and install the appropriate "extras" zip file from here.
To configure:
- Login to the iSearch configuration page
- Click on the "Advanced" tab
- Under "PDF Support" select "Executable PDF Support"
- Under "PDF Executable Path" enter the full path name to the pdftotext executable.
Online PDF Support
Visit http://www.iSearchTheNet.com/pro/purchase.php to find out your online conversion ID. Then:
- Login to the iSearch configuration page
- Click on the "Advanced" tab
- Under "PDF Support" select "Online PDF Support"
- Under "Online Conversion ID" enter your online conversion ID.
Microsoft Word Support
As for PDF support, you have the option of Executable or Online conversion of MS Word documents.
Executable MS Word Support
This requires an installation of the
antiword package on your server. To install this either:
- download source code or precompiled binaries from the
antiword home page. Once
downloaded, install antiword on your server and copy the files "antiword.sh" and "antiword.bat" from the
"isearch2/extras/antiword" directory into the directory containing the antiword executable.
- download and install the appropriate "extras" zip file from here.
If you are using a unix server you need to ensure that executable permission
is set on the "antiword.sh""antiword" files. If you have shell access, cd to the directory
containing these files and type "chmod 755 antiword antiword.sh".
To configure:
- Login to the iSearch configuration page
- Click on the "Advanced" tab
- Under "MS Word Support" select "Executable MS Word Support"
- Under "MS Word Executable Path" enter the full path name to the antiword.sh (unix servers) or antiword.bat (windows servers) script.
Online MS Word Support
Visit http://www.iSearchTheNet.com/pro/purchase.php to find out your online conversion ID. Then:
- Login to the iSearch configuration page
- Click on the "Advanced" tab
- Under "MS Word Support" select "Online MS Word Support"
- Under "Online Conversion ID" enter your online conversion ID.
|
iSearch Home
Purchase / Download
Requirements
Quick Install
Installation
Excluding Pages
Site Map
FAQ
Support
Toolbar Removal
Forums
PHP Mission - PHP Tutorials and Forums
|