Class swish_search

Description

The swish search class

This class inherits the functionality of the generic 'search' class. It extends it to implement a swish++ search. To use this you must install the swish++ system on the web server running this code. There is a Debian package to do this for you or else retrieve the tarball from: http://homepage.mac.com/pauljlucas/software/swish/

NB: After installing make sure that there are links to the main executables: search++, index++, extract++ etc. in a directory on the path of the executing script, eg: /usr/bin

Located in /swish-defs.php (line 52)

search
   |
   --swish_search
Variable Summary
 mixed $searchdir
 mixed $searchindex
Method Summary
 swish_search swish_search ([string $title = "Search Results"], [string $searchdir = ""])
 void execute ([string $executable = ""])
 void set_searchdir ([string $dir = ""])
 void set_searchindex ([string $fname = ""])
Variables
mixed $searchdir = "" (line 54)

Directory to do the search from

mixed $searchindex = "" (line 56)

Name of index file to use (defaults to 'swish++.index')

Inherited Variables

Inherited from search

search::$date_end
search::$date_fieldname
search::$date_start
search::$executed
search::$hit
search::$max_results
search::$query
search::$searchterm
search::$skip_results
search::$title
Methods
Constructor swish_search (line 64)

Constructor

Create a new swish++ search

swish_search swish_search ([string $title = "Search Results"], [string $searchdir = ""])
  • string $title: Title describing this search
  • string $searchdir: Directory root in which to perform the search
execute (line 105)

Execute the swish++ search

Here we execute a swish++ search, overriding the method in the parent class. This involves piping an OS command containing the search query terms. The default is to execute 'search++' without any path to the executable, relying on webserver PATH settings. You can over-ride this by specifying a path to the executable here if required.

void execute ([string $executable = ""])
  • string $executable: Alternative executable to use to search
set_searchdir (line 77)

Set search directory Set the root directory to go to and search from.

void set_searchdir ([string $dir = ""])
  • string $dir: Directory root in which to perform the search
set_searchindex (line 90)

Set search index filename Defines the index filename to use for searching. If no filename is specified in the constructor (@see swish_search()) or via this method, then the default is used: 'swish++.index'.

NB: This should be the basename only, not a path to a file.

void set_searchindex ([string $fname = ""])
  • string $fname: Alternative name of index file to use in search

Inherited Methods

Inherited From search

 search::search()
 search::clear_daterange()
 search::clear_search()
 search::does_not_match()
 search::has_daterange()
 search::hitcount()
 search::initialise()
 search::match()
 search::may_match()
 search::must_match()
 search::reset_search()
 search::set_daterange()
 search::set_maxresults()
 search::set_skipresults()
 search::termcount()

Documentation generated by phpDocumentor 1.3.0RC3