TYPO3 CMS  TYPO3_7-6
TYPO3\CMS\IndexedSearch\Utility\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

◆ getExplodedSearchString()

static TYPO3\CMS\IndexedSearch\Utility\IndexedSearchUtility::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 TYPO3\CMS\IndexedSearch\Controller\SearchFormController\getSearchWords(), and TYPO3\CMS\IndexedSearch\Controller\SearchController\getSearchWords().

◆ getOperator()

static TYPO3\CMS\IndexedSearch\Utility\IndexedSearchUtility::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.

◆ isTableUsed()

static TYPO3\CMS\IndexedSearch\Utility\IndexedSearchUtility::isTableUsed (   $tableName)
static

Check if the tables provided are configured for usage. This becomes necessary for extensions that provide additional database functionality like indexed_search_mysql.

Parameters
string$tableNameTable name to check
Returns
bool True if the given table is used

Definition at line 31 of file IndexedSearchUtility.php.

References $GLOBALS.

Referenced by TYPO3\CMS\IndexedSearch\Indexer\checkContentHash(), TYPO3\CMS\IndexedSearch\Indexer\checkExternalDocContentHash(), TYPO3\CMS\IndexedSearch\Indexer\checkMtimeTstamp(), TYPO3\CMS\IndexedSearch\Controller\SearchFormController\checkResume(), TYPO3\CMS\IndexedSearch\Indexer\checkWordList(), TYPO3\CMS\IndexedSearch\Indexer\indexRegularDocument(), TYPO3\CMS\IndexedSearch\Indexer\indexTypo3PageContent(), TYPO3\CMS\IndexedSearch\Indexer\init(), TYPO3\CMS\IndexedSearch\Controller\SearchFormController\initialize(), TYPO3\CMS\IndexedSearch\Indexer\is_grlist_set(), TYPO3\CMS\IndexedSearch\Domain\Repository\IndexSearchRepository\isTableUsed(), TYPO3\CMS\IndexedSearch\Controller\SearchFormController\makeDescription(), TYPO3\CMS\IndexedSearch\Indexer\removeOldIndexedFiles(), TYPO3\CMS\IndexedSearch\Indexer\removeOldIndexedPages(), TYPO3\CMS\IndexedSearch\Indexer\submit_grlist(), TYPO3\CMS\IndexedSearch\Indexer\submit_section(), TYPO3\CMS\IndexedSearch\Indexer\submitFile_grlist(), TYPO3\CMS\IndexedSearch\Indexer\submitFile_section(), TYPO3\CMS\IndexedSearch\Indexer\submitFilePage(), TYPO3\CMS\IndexedSearch\Indexer\submitPage(), TYPO3\CMS\IndexedSearch\Indexer\submitWords(), TYPO3\CMS\IndexedSearch\Indexer\update_grlist(), TYPO3\CMS\IndexedSearch\Indexer\updateParsetime(), TYPO3\CMS\IndexedSearch\Indexer\updateRootline(), TYPO3\CMS\IndexedSearch\Indexer\updateSetId(), and TYPO3\CMS\IndexedSearch\Indexer\updateTstamp().

◆ md5inthash()

static TYPO3\CMS\IndexedSearch\Utility\IndexedSearchUtility::md5inthash (   $stringToHash)
static

◆ split()

static TYPO3\CMS\IndexedSearch\Utility\IndexedSearchUtility::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.