Abstract base search class. Provides general properties and functions for child implementations.

author Murat Purc

 Methods

Constructor, set object properties

Index(\DB_Contenido $oDB) : void

Parameters

$oDB

\DB_Contenido

Contenido Database object

addSpecialUmlauts()

addSpecialUmlauts(\$key $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

\$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

get the keywords of an article

getKeywords() : void

remove special characters from index term

removeSpecialChars(\$key $key) : \$key

Parameters

$key

\$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

none

set the cms types

setContentTypes() : void

Setter for debug

setDebug(bool $bDebug) 
Inherited

inherited_from \SearchBaseAbstract::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.

Initialises some properties

__construct(\DB_Contenido $oDB, bool $bDebug) 
Inherited

inherited_from \SearchBaseAbstract::__construct()

Parameters

$oDB

\DB_Contenido

Optional database instance

$bDebug

bool

Optional, flag to enable debugging

Main debug function, prints dumps parameter if debugging is enabled

_debug(string $msg, mixed $var) 
Inherited

inherited_from \SearchBaseAbstract::_debug()

Parameters

$msg

string

Some text

$var

mixed

The variable to dump

 Properties

 

array of cms types

$cms_options : array

 

array of all available cms types

$cms_type : 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.

 

the suffix of all available cms types

$cms_type_suffix : array

 

the content of the cms-types of an article

$keycode : array

 

the list of keywords of an article

$keywords : array

 

the keywords to be deleted

$keywords_del : array

 

the keywords of an article stored in the DB

$keywords_old : array

 

'auto' or 'self' The field 'auto' in table con_keywords is used for automatic indexing.

$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.

 

the words, which should not be indexed

$stopwords : array

 

Flag to enable debug

$bDebug : bool
Inherited

inherited_from \SearchBaseAbstract::$$bDebug
 

Contenido configuration data

$cfg : array
Inherited

inherited_from \SearchBaseAbstract::$$cfg
 

Client id

$client : int
Inherited

inherited_from \SearchBaseAbstract::$$client
 

Language id of a client

$lang : int
Inherited

inherited_from \SearchBaseAbstract::$$lang
 

Contenido database object

$oDB : \DB_Contenido
Inherited

inherited_from \SearchBaseAbstract::$$oDB