Abstract base search class.

Provides general properties and functions for child implementations.

author Murat Purc

 Methods

Constructor, set object properties

__construct(\cDb $db) : void

Parameters

$db

\cDb

CONTENIDO Database object

addSpecialUmlauts()

addSpecialUmlauts($key) : \$key
modified 2008-04-17, Timo Trautmann - reverse function to removeSpecialChars (important for syntaxhighlighting searchterm in searchresults) adds umlauts to search term

Parameters

$key

Keyword

Returns

\$key

check if the current cms type is in the cms_options array

checkCmsType($idtype) : \bolean

Parameters

$idtype

Returns

\bolean

for each cms-type create index structure.

createKeywords() : void

it looks like Array ( [die] => CMS_HTML-1 [inhalte] => CMS_HTML-1 [auf] => CMS_HTML-1 CMS_HTMLHEAD-2 [dieser] => CMS_HTML-1 [website] => CMS_HTML-1 CMS_HTML-1 CMS_HTMLHEAD-2 )

if keywords don't occur in the article anymore, update index_string and delete keyword if necessary

deleteKeywords() : void

getCmsType()

getCmsType() : array

Returns

arraythe _cmsType property

getCmsTypeSuffix()

getCmsTypeSuffix() : array

Returns

arraythe _cmsTypeSuffix property

get the keywords of an article

getKeywords() : void

remove special characters from index term

removeSpecialChars($key) : \$key

Parameters

$key

Keyword

Returns

\$key

generate index_string from index structure and save keywords The index_string looks like "&12=2(CMS_HTMLHEAD-1,CMS_HTML-1)"

saveKeywords() : void

set the cms_options array of cms types which should be treated special

setCmsOptions($cms_options) : void

Parameters

$cms_options

set the cms types

setContentTypes() : void

Setter for debug

setDebug(bool $bDebug) 
Inherited
inherited_from \cSearchBaseAbstract::setDebug()

Parameters

$bDebug

bool

set the array of stopwords which should not be indexed

setStopwords(array $aStopwords) : void

Parameters

$aStopwords

array

Start indexing the article.

start(int $idart, array $aContent, string $place, array $cms_options, array $aStopwords) : void

Parameters

$idart

int

Article Id

$aContent

array

The complete content of an article specified by its content types. It looks like Array ( [CMS_HTMLHEAD] => Array ( [1] => Herzlich Willkommen... [2] => ...auf Ihrer Website! ) [CMS_HTML] => Array ( [1] => Die Inhalte auf dieser Website ...

$place

string

The field where to store the index information in db.

$cms_options

array

One can specify explicitly cms types which should not be indexed.

$aStopwords

array

Array with words which should not be indexed.

Main debug function, prints dumps parameter if debugging is enabled

_debug(string $msg, mixed $var) 
Inherited
inherited_from \cSearchBaseAbstract::_debug()

Parameters

$msg

string

Some text

$var

mixed

The variable to dump

 Properties

 

$_cmsOptions : array
 

$_cmsType : array

htmlhead - HTML Headline html - HTML Text head - Headline (no HTML) text - Text (no HTML) img - Upload id of the element imgdescr - Image description link - Link (URL) linktarget - Linktarget (_self, _blank, _top ...) linkdescr - Linkdescription swf - Upload id of the element etc.

 

$_cmsTypeSuffix : array
 

$_keycode : array
 

$_keywords : array
 

$_keywordsDel : array
 

$_keywordsOld : array
 

$_place : string

The value is a string like "&12=2(CMS_HTMLHEAD-1,CMS_HTML-1)", which means a keyword occurs 2 times in article with $idart 12 and can be found in CMS_HTMLHEAD[1] and CMS_HTML[1]. The field 'self' can be used in the article properties to index the article manually.

 

$_stopwords : array
 

$bDebug : bool
Inherited
inherited_from \cSearchBaseAbstract::$$bDebug
 

$cfg : array
Inherited
inherited_from \cSearchBaseAbstract::$$cfg
 

$client : int
Inherited
inherited_from \cSearchBaseAbstract::$$client
 

$lang : int
Inherited
inherited_from \cSearchBaseAbstract::$$lang
 

$oDB : \cDb
Inherited
inherited_from \cSearchBaseAbstract::$$oDB