Abstract base search class.

Provides general properties and functions for child implementations.

author Murat Purc

 Methods

SearchIndex()

SearchIndex($db) 
deprecated [2012-07-24] use __construct()

Parameters

$db

Constructor, set object properties

__construct(\cDb $db) : void
deprecated [2012-07-24] class was renamed to cSearchIndex

Parameters

$db

\cDb

CONTENIDO Database object

addSpecialUmlauts()

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

Parameters

$key

Keyword

Returns

\$key

check if the current cms type is in the cms_options array

checkCmsType($idtype) : \bolean
Inherited
inherited_from \cSearchIndex::checkCmsType()

Parameters

$idtype

Returns

\bolean

for each cms-type create index structure.

createKeywords() : void
Inherited

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 )

inherited_from \cSearchIndex::createKeywords()

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

deleteKeywords() : void
Inherited
inherited_from \cSearchIndex::deleteKeywords()

getCmsType()

getCmsType() : array
Inherited
inherited_from \cSearchIndex::getCmsType()

Returns

arraythe _cmsType property

getCmsTypeSuffix()

getCmsTypeSuffix() : array
Inherited
inherited_from \cSearchIndex::getCmsTypeSuffix()

Returns

arraythe _cmsTypeSuffix property

get the keywords of an article

getKeywords() : void
Inherited
inherited_from \cSearchIndex::getKeywords()

remove special characters from index term

removeSpecialChars($key) : \$key
Inherited
inherited_from \cSearchIndex::removeSpecialChars()

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
Inherited
inherited_from \cSearchIndex::saveKeywords()

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

setCmsOptions($cms_options) : void
Inherited
inherited_from \cSearchIndex::setCmsOptions()

Parameters

$cms_options

set the cms types

setContentTypes() : void
Inherited
inherited_from \cSearchIndex::setContentTypes()

Setter for debug

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

Parameters

$bDebug

bool

set the array of stopwords which should not be indexed

setStopwords(array $aStopwords) : void
Inherited
inherited_from \cSearchIndex::setStopwords()

Parameters

$aStopwords

array

Start indexing the article.

start(int $idart, array $aContent, string $place, array $cms_options, array $aStopwords) : void
Inherited
inherited_from \cSearchIndex::start()

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()
inherited_from \cSearchIndex::_debug()

Parameters

$msg

string

Some text

$var

mixed

The variable to dump

 Properties

 

$_cmsOptions : array
Inherited
inherited_from \cSearchIndex::$$_cmsOptions
 

$_cmsType : array
Inherited

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.

inherited_from \cSearchIndex::$$_cmsType
 

$_cmsTypeSuffix : array
Inherited
inherited_from \cSearchIndex::$$_cmsTypeSuffix
 

$_keycode : array
Inherited
inherited_from \cSearchIndex::$$_keycode
 

$_keywords : array
Inherited
inherited_from \cSearchIndex::$$_keywords
 

$_keywordsDel : array
Inherited
inherited_from \cSearchIndex::$$_keywordsDel
 

$_keywordsOld : array
Inherited
inherited_from \cSearchIndex::$$_keywordsOld
 

$_place : string
Inherited

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.

inherited_from \cSearchIndex::$$_place
 

$_stopwords : array
Inherited
inherited_from \cSearchIndex::$$_stopwords
 

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

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

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

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

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