All Classes Namespaces Files Functions Variables Pages
IndexedSearchUtility Class Reference

Static Public Member Functions

static isTableUsed ($tableName)
static md5inthash ($stringToHash)
static getExplodedSearchString ($sword, $defaultOperator, $operatorTranslateTable)

Static Protected Member Functions

static split ($origSword, $specchars= '+-', $delchars= '+.,-')
static getOperator ($operator, $operatorTranslateTable)

Detailed Description

Class with common methods used across various classes in the indexed search. Impementation is provided by various people from the TYPO3 community.

Definition at line 21 of file IndexedSearchUtility.php.

Member Function Documentation

static getExplodedSearchString (   $sword,

Takes a search-string (WITHOUT SLASHES or else it'll be a little sppooky , NOW REMEMBER to unslash!!) Sets up search words with operators.

string$swordThe input search-word string.

Definition at line 58 of file IndexedSearchUtility.php.

Referenced by SearchFormController\getSearchWords(), and SearchController\getSearchWords().

static getOperator (   $operator,

This returns an SQL search-operator (eg. AND, OR, NOT) translated from the current localized set of operators (eg. in danish OG, ELLER, IKKE).

string$operatorThe possible operator to find in the internal operator array.
array$operatorTranslateTablean array of possible operators
string If found, the SQL operator for the localized input operator.

Definition at line 148 of file IndexedSearchUtility.php.

static md5inthash (   $stringToHash)

md5 integer hash Using 7 instead of 8 just because that makes the integers lower than 32 bit (28 bit) and so they do not interfere with UNSIGNED integers or PHP-versions which has varying output from the hexdec function.

string$stringToHashString to hash
int Integer intepretation of the md5 hash of input string.

Definition at line 44 of file IndexedSearchUtility.php.

Referenced by Indexer\analyzeBody(), Indexer\analyzeHeaderinfo(), Indexer\indexRegularDocument(), Indexer\indexTypo3PageContent(), IndexSearchRepository\md5inthash(), Indexer\metaphone(), SearchFormController\searchDistinct(), Indexer\setExtHashes(), Indexer\setT3Hashes(), Indexer\submit_grlist(), Indexer\submitFile_grlist(), and Indexer\update_grlist().

static split (   $origSword,
  $specchars = '+-',
  $delchars = '+.,

Used to split a search-word line up into elements to search for. This function will detect boolean words like AND and OR, + and -, and even find sentences encapsulated in "" This function could be re-written to be more clean and effective - yet it's not that important.

string$origSwordThe raw sword string from outside
string$speccharsSpecial chars which are used as operators (+- is default)
string$delcharsSpecial chars which are deleted if the append the searchword (+-., is default)
mixed Returns an ARRAY if there were search words, otherwise the return value may be unset.

Definition at line 93 of file IndexedSearchUtility.php.