TYPO3CMS  8
 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,
  $defaultOperator,
  $operatorTranslateTable 
)
static

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

Parameters
string$swordThe input search-word string.
string$defaultOperator
array$operatorTranslateTable
Returns
array

Definition at line 58 of file IndexedSearchUtility.php.

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

static getOperator (   $operator,
  $operatorTranslateTable 
)
staticprotected

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

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

Definition at line 148 of file IndexedSearchUtility.php.

static md5inthash (   $stringToHash)
static

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.

Parameters
string$stringToHashString to hash
Returns
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 = '+.,
-'   
)
staticprotected

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.

Parameters
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)
Returns
mixed Returns an ARRAY if there were search words, otherwise the return value may be unset.

Definition at line 93 of file IndexedSearchUtility.php.