‪TYPO3CMS  10.4
TYPO3\CMS\IndexedSearch\Utility\IndexedSearchUtility Class Reference

Static Public Member Functions

static bool isTableUsed ($tableName)
 
static int md5inthash ($stringToHash)
 
static array getExplodedSearchString ($sword, $defaultOperator, $operatorTranslateTable)
 
static int milliseconds ()
 

Static Protected Member Functions

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

Detailed Description

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

Definition at line 25 of file IndexedSearchUtility.php.

Member Function Documentation

◆ getExplodedSearchString()

static array TYPO3\CMS\IndexedSearch\Utility\IndexedSearchUtility::getExplodedSearchString (   $sword,
  $defaultOperator,
  $operatorTranslateTable 
)
static

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

Parameters
string$sword‪The input search-word string.
string$defaultOperator
array$operatorTranslateTable
Returns
‪array

Definition at line 62 of file IndexedSearchUtility.php.

References TYPO3\CMS\IndexedSearch\Utility\IndexedSearchUtility\getOperator(), and TYPO3\CMS\IndexedSearch\Utility\IndexedSearchUtility\split().

Referenced by TYPO3\CMS\IndexedSearch\Controller\SearchController\getSearchWords().

◆ getOperator()

static string null 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$operator‪The possible operator to find in the internal operator array.
array$operatorTranslateTable‪an array of possible operators
Returns
‪string|null If found, the SQL operator for the localized input operator.

Definition at line 152 of file IndexedSearchUtility.php.

Referenced by TYPO3\CMS\IndexedSearch\Utility\IndexedSearchUtility\getExplodedSearchString().

◆ isTableUsed()

static bool 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$tableName‪Table name to check
Returns
‪bool True if the given table is used

Definition at line 35 of file IndexedSearchUtility.php.

References $GLOBALS.

Referenced by TYPO3\CMS\IndexedSearch\Indexer\__construct(), TYPO3\CMS\IndexedSearch\Indexer\checkContentHash(), TYPO3\CMS\IndexedSearch\Indexer\checkExternalDocContentHash(), TYPO3\CMS\IndexedSearch\Indexer\checkMtimeTstamp(), TYPO3\CMS\IndexedSearch\Indexer\checkWordList(), TYPO3\CMS\IndexedSearch\Indexer\indexRegularDocument(), TYPO3\CMS\IndexedSearch\Indexer\indexTypo3PageContent(), TYPO3\CMS\IndexedSearch\Indexer\is_grlist_set(), TYPO3\CMS\IndexedSearch\Domain\Repository\IndexSearchRepository\isTableUsed(), 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 int TYPO3\CMS\IndexedSearch\Utility\IndexedSearchUtility::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$stringToHash‪String to hash
Returns
‪int Integer interpretation of the md5 hash of input string.

Definition at line 48 of file IndexedSearchUtility.php.

Referenced by TYPO3\CMS\IndexedSearch\Indexer\analyzeBody(), TYPO3\CMS\IndexedSearch\Indexer\analyzeHeaderinfo(), TYPO3\CMS\IndexedSearch\Indexer\indexRegularDocument(), TYPO3\CMS\IndexedSearch\Indexer\indexTypo3PageContent(), TYPO3\CMS\IndexedSearch\Domain\Repository\IndexSearchRepository\md5inthash(), TYPO3\CMS\IndexedSearch\Indexer\metaphone(), TYPO3\CMS\IndexedSearch\Indexer\setExtHashes(), TYPO3\CMS\IndexedSearch\Indexer\setT3Hashes(), TYPO3\CMS\IndexedSearch\Indexer\submit_grlist(), TYPO3\CMS\IndexedSearch\Indexer\submitFile_grlist(), and TYPO3\CMS\IndexedSearch\Indexer\update_grlist().

◆ milliseconds()

static int TYPO3\CMS\IndexedSearch\Utility\IndexedSearchUtility::milliseconds ( )
static

◆ split()

static mixed 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$origSword‪The raw sword string from outside
string$specchars‪Special chars which are used as operators (+- is default)
string$delchars‪Special 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 97 of file IndexedSearchUtility.php.

Referenced by TYPO3\CMS\IndexedSearch\Utility\IndexedSearchUtility\getExplodedSearchString().