[Top] [Prev] [Next] [Last]
|
|
Chapter 12Indexing and Searching
SWISH and WWWWAIS
- SWISH, the Simple Web Indexing System for Humans. You can run SWISH periodically to search the files in your Web tree, then save the results in a complete index file.
- WWWWAIS, a CGI program that searches the SWISH index file to generate responses to user search queries. When WWWWAIS receives a user search request, it scans the index file for entries that match the search parameters.
Configuring SWISH
Stronghold's installation program places SWISH in ServerRoot/swish, and its configuration file is ServerRoot/conf/swish.conf. Like httpd.conf, it's a simple text file, but it does not use wrappers. The default configuration file is included in Appendix D.
IndexDir
- Syntax: IndexDir directory
- Context: swish.conf
IndexDir /usr/local/www/htdocs
IndexDir /usr/local/www/vhosts/vhost1
IndexDir /usr/local/www/vhosts/vhost2
IndexDir /usr/local/www/vhosts/vhost2
...
IndexFile
- Syntax: IndexFile filename.swish
- Context: swish.conf
IndexOnly
- Syntax: IndexOnly .suffix1 [.suffix2 .suffix3 ...]
- Context: swish.conf
IndexOnly .html .phtml .php
IndexReport
- Syntax: IndexReport 0|1|2|3
- Context: swish.conf
FollowSymLinks
- Syntax: FollowSymLinks yes|no
- Context: swish.conf
NoContents
- Syntax: NoContents .suffix1 [.suffix2 .suffix3 ...]
- Context: swish.conf
NoContents .ps .gif .au .hqx .xbm .mpg .mpeg .pict .jpg .jpeg ...
SWISH indexes only their filenames instead. This directive is case-insensitive.
IgnoreWords
- Syntax: IgnoreWords word1 [word2 word3 ...]
- Context: swish.conf
IgnoreLimit
- Syntax: IgnoreLimit percent integer
- Context: swish.conf
- A percentage of the total number of Web files. SWISH ignores words that occur in at least this percentage of files.
- A number of files. SWISH ignores words that occur in at least this many Web files.
IgnoreLimit 80 256
IgnoreLimit 50 50
IndexName
- Syntax: IndexName "name"
- Context: swish.conf
IndexDescription
- Syntax: IndexDescription "description" |URL
- Context: swish.conf
IndexDescription is a short description of the index file, or the URL of a description file.
IndexPointer
- Syntax: IndexPointer URL
- Context: swish.conf
IndexAdmin
- Syntax: IndexAdmin "administrator information"
- Context: swish.conf
ReplaceRules
- Syntax: ReplaceRules replace|append|prepend "string" ["replace-string"]
- Context: swish.conf
prepend "http://"
replace "/usr/local/httpd/htdocs/" "www.mainhost.com/"
replace "/usr/local/httpd/vhosts/vhost1/" "www.vhost1.com/"
FileRules
- Syntax: FileRules operator string1 [string2 string3 ...]
- Context: swish.conf
Configuring WWWWAIS
Stronghold's installation program places WWWWAIS in ServerRoot/cgi-bin, and its configuration file is ServerRoot/conf/wwwwais.conf. Like swish.conf, it's a simple text file that does not use containers. The default configuration file is included in Appendix E.
This section explains the WWWWAIS configuration directives.
PageTitle
- Syntax: PageTitle "title"|filename
- Context: wwwwais.conf
SelfURL
- Syntax: SelfURL "URL"
- Context: wwwwais.conf
MaxHits
- Syntax: MaxHits n
- Context: wwwwais.conf
The integer value for MaxHits is the maximum number of search results WWWWAIS is allowed to return.
SortType
- Syntax: SortType type
- Context: wwwwais.conf
AddrMask
- Syntax: AddrMask all|IP1 [IP2 ...]
- Context: wwwwais.conf
SwishBin
- Syntax: SwishBin path
- Context: wwwwais.conf
SwishSource
- Syntax: SwishSource path "description"
- Context: wwwwais.conf
This directive sets the path and description of the SWISH index file.
SourceRules
- Syntax: SourceRules replace|append|prepend arg1 [arg2 ...]
- Context: wwwwais.conf
SourceRules replace "/www/" "http://your.host.com/"
This converts document root paths to proper URLs that take advantage of the DocumentRoot alias.
WaisSource
- Syntax: WaisSource path "description"
- Context: wwwwais.conf
This directive sets the source description for WAIS sources. For WAISSEARCH sources, the syntax is
WaisSource hostname port path "description"
UseIcons
- Syntax: UseIcons yes|no
- Context: wwwwais.conf
WWWWAIS can include icons in the search results page, according to the option set in UseIcons.
IconUrl
- Syntax: IconUrl URL
- Context: wwwwais.conf
TypeDef
- Syntax: TypeDef .suffix "type description" iconfile MIME-type
- Context: wwwwais.conf
Creating a Site Index
Once you have an index file for a host, any HTML search interface for that host must reference the appropriate index file. Make sure the administrator of each virtual host has access to that host's index file, and to the instructions contained in the next section, "Creating a Search Interface."
Creating a Search Interface
<FORM METHOD=GET ACTION="/cgi-bin/wwwwais?sourcedir=/usr/local/www/htdocs/vhost/swish&source=index.swish"
Search for:
<INPUT TYPE=TEXT NAME="keywords" SIZE=40>
<INPUT TYPE=SUBMIT VALUE="Search">
</FORM>
ACTION=/cgi-bin/wwwwais?source=index.src&keywords=sample+search
sourcedir
- Syntax: sourcedir=path
- Context: ACTION
source
- Syntax: source=filename
- Context: ACTION
The source option specifies which index database the search engine should search.
maxhits
- Syntax: maxhits=n
- Context: ACTION
This option sets the maximum number of URLs WWWWAIS returns to the user.
keywords
- Syntax: keywords=keyword1[+keyword2+keyword3 ...]
- Context: ACTION
isindex
- Syntax: isindex=keyword1[+keyword2+keyword3 ...]
- Context: ACTION
The isindex option works identically to the keywords option.
sorttype
- Syntax: sorttype=score|lines|bytes|title|type
- Context: ACTION
This option sets the criteria that WWWWAIS uses to sort the results of a search.
version
- Syntax: version=true|false
- Context: ACTION
When this option is set, WWWWAIS returns its version information and that of WAISQ or WAISSEARCH.
host
- Syntax: host=hostname
- Context: ACTION
port
- Syntax: port=n
- Context: ACTION
useicons
- Syntax: useicons=yes|no
- Context: ACTION
iconurl
- Syntax: iconurl=URL
- Context: ACTION
If you use the useicons option, use iconurl to specify the location of your icon files.
selection
- Syntax: URL?selection="source+description"
- Context: ACTION
searchprog
- Syntax: URL?searchprog=waisq|waissearch|swish
- Context: ACTION
You can use searchprog to specify one of these alternative search programs:
- waisq
- waissearch
- swish
[Top] [Prev] [Next] [Last]
© 1998 C2Net International
Feedback: stronghold-docs@c2.net![]()