Class flSearchManager
flSearchManager Class
Class to provide the functionality to install, upgrade and remove the database
tables required for the search engine system to operate.
Package: fusionLib
Copyright:
Copyright (c) 2008 - 2016 fusionLib. All rights reserved.
Located at system/libs/Search/flSearchManager.php
Methods summary
public
|
#
__construct( flDb $db, string $tableBase )
Construct the manager object.
Construct the manager object.
Parameters
- $db
- The database object to use.
- $tableBase
- The base name for database tables.
|
public
|
#
initializeTables( string $lang = 'en', integer $minWordLen = 2, integer $maxWordLen = 28 )
Initialise the database tables needed for search.
Initialise the database tables needed for search.
Parameters
- $lang
- The language to load the stemmer for, e.g. en, see ISO 639 for the list of 2 letter codes.
- $minWordLen
- The minimum length of a word that will be indexed.
- $maxWordLen
- The maximum length of a word that will be indexed.
|
public
|
#
deleteTables( )
Delete the database tables needed for search.
Delete the database tables needed for search.
|
public
|
#
setMinWordLen( integer $minWordLen )
Set the minimum word length.
Set the minimum word length.
Parameters
- $minWordLen
- The minimum length of a word that will be indexed.
|
public
|
#
setMaxWordLen( integer $maxWordLen )
Set the maximum word length.
Set the maximum word length.
Parameters
- $maxWordLen
- The maximum length of a word that will be indexed.
|
public
boolean
|
#
setLang( string $lang, boolean $reloadStopWords = true )
Set the stemmer language.
Set the stemmer language.
Parameters
- $lang
- The language to load the stemmer for, e.g. en, see ISO 639 for the list of 2 letter codes.
- $reloadStopWords
- If true the stopwords are to be reloaded.
Returns
boolean true if changed; else false.
|
public
boolean
|
#
addField( string $name )
Create a new search field.
Create a new search field.
Parameters
- $name
- The name of the field to create.
Returns
boolean true if the field was added or already existed; false if the field could not be added.
|
public
|
#
deleteField( string $name )
Delete an existing search field and all indexed data in the field.
Delete an existing search field and all indexed data in the field.
Parameters
- $name
- The name of the field to delete.
|
public
array
|
#
getConfig( array $keys )
Get the search configuration.
Get the search configuration.
Parameters
- $keys
- The names of the configuration values to get.
Returns
array The configuration items.
|
public
|
#
setConfig( array $cfg )
Set the search configuration.
Set the search configuration.
Parameters
- $cfg
- The array of configuration options.
|
Properties summary
protected
flDb
|
$db
|
|
protected
string
|
$tableBase
The base name for database tables.
The base name for database tables.
|
|