TYPO3 CMS  TYPO3_7-6
TYPO3\CMS\IndexedSearch\Indexer Class Reference

Public Member Functions

 hook_indexContent (&$pObj)
 
 backend_initIndexer ($id, $type, $sys_language_uid, $MP, $uidRL, $cHash_array=[], $createCHash=false)
 
 backend_setFreeIndexUid ($freeIndexUid, $freeIndexSetId=0)
 
 backend_indexAsTYPO3Page ($title, $keywords, $description, $content, $charset, $mtime, $crdate=0, $recordUid=0)
 
 init ()
 
 initializeExternalParsers ()
 
 indexTypo3PageContent ()
 
 splitHTMLContent ($content)
 
 getHTMLcharset ($content)
 
 convertHTMLToUtf8 ($content, $charset='')
 
 embracingTags ($string, $tagName, &$tagContent, &$stringAfter, &$paramList)
 
 typoSearchTags (&$body)
 
 extractLinks ($content)
 
 extractHyperLinks ($html)
 
 extractBaseHref ($html)
 
 indexExternalUrl ($externalUrl)
 
 getUrlHeaders ($url)
 
 indexRegularDocument ($file, $force=false, $contentTmpFile='', $altExtension='')
 
 readFileContent ($fileExtension, $absoluteFileName, $sectionPointer)
 
 fileContentParts ($ext, $absFile)
 
 splitRegularContent ($content)
 
 charsetEntity2utf8 (&$contentArr, $charset)
 
 processWordsInArrays ($contentArr)
 
 bodyDescription ($contentArr)
 
 indexAnalyze ($content)
 
 analyzeHeaderinfo (&$retArr, $content, $key, $offset)
 
 analyzeBody (&$retArr, $content)
 
 metaphone ($word, $returnRawMetaphoneValue=false)
 
 submitPage ()
 
 submit_grlist ($hash, $phash_x)
 
 submit_section ($hash, $hash_t3)
 
 removeOldIndexedPages ($phash)
 
 submitFilePage ($hash, $file, $subinfo, $ext, $mtime, $ctime, $size, $content_md5h, $contentParts)
 
 submitFile_grlist ($hash)
 
 submitFile_section ($hash)
 
 removeOldIndexedFiles ($phash)
 
 checkMtimeTstamp ($mtime, $phash)
 
 checkContentHash ()
 
 checkExternalDocContentHash ($hashGr, $content_md5h)
 
 is_grlist_set ($phash_x)
 
 update_grlist ($phash, $phash_x)
 
 updateTstamp ($phash, $mtime=0)
 
 updateSetId ($phash)
 
 updateParsetime ($phash, $parsetime)
 
 updateRootline ()
 
 getRootLineFields (array &$fieldArray)
 
 includeCrawlerClass ()
 
 checkWordList ($wordListArray)
 
 submitWords ($wordList, $phash)
 
 freqMap ($freq)
 
 setT3Hashes ()
 
 setExtHashes ($file, $subinfo=[])
 
 log_push ($msg, $key)
 
 log_pull ()
 
 log_setTSlogMessage ($msg, $errorNum=0)
 

Public Attributes

 $reasons
 
 $excludeSections = 'script,style'
 
 $external_parsers = []
 
 $defaultGrList = '0,-1'
 
 $tstamp_maxAge = 0
 
 $tstamp_minAge = 0
 
 $maxExternalFiles = 0
 
 $forceIndexing = false
 
 $crawlerActive = false
 
 $defaultContentArray
 
 $wordcount = 0
 
 $externalFileCounter = 0
 
 $conf = []
 
 $indexerConfig = []
 
 $hash = []
 
 $file_phash_arr = []
 
 $contentParts = []
 
 $content_md5h = ''
 
 $internal_log = []
 
 $indexExternalUrl_content = ''
 
 $cHashParams = []
 
 $freqRange = 32000
 
 $freqMax = 0.1
 
 $enableMetaphoneSearch = false
 
 $storeMetaphoneInfoAsWords
 
 $metaphoneContent = ''
 
 $csObj
 
 $metaphoneObj
 
 $lexerObj
 
 $flagBitMask
 

Protected Member Functions

 createLocalPath ($sourcePath)
 
 createLocalPathFromT3vars ($sourcePath)
 
 createLocalPathUsingDomainURL ($sourcePath)
 
 createLocalPathUsingAbsRefPrefix ($sourcePath)
 
 createLocalPathFromAbsoluteURL ($sourcePath)
 
 createLocalPathFromRelativeURL ($sourcePath)
 
 addSpacesToKeywordList ($keywordList)
 

Static Protected Member Functions

static isRelativeURL ($url)
 
static isAllowedLocalFile ($filePath)
 

Detailed Description

Indexing class for TYPO3 frontend

Definition at line 25 of file Indexer.php.

Member Function Documentation

◆ addSpacesToKeywordList()

TYPO3\CMS\IndexedSearch\Indexer::addSpacesToKeywordList (   $keywordList)
protected

Makes sure that keywords are space-separated. This is impotant for their proper displaying as a part of fulltext index.

Parameters
string$keywordList
Returns
string
See also
http://forge.typo3.org/issues/14959

Definition at line 2131 of file Indexer.php.

References TYPO3\CMS\Core\Utility\GeneralUtility\trimExplode().

Referenced by TYPO3\CMS\IndexedSearch\Indexer\splitHTMLContent().

◆ analyzeBody()

TYPO3\CMS\IndexedSearch\Indexer::analyzeBody ( $retArr,
  $content 
)

Calculates relevant information for bodycontent

Parameters
array$retArrIndex array, passed by reference
array$contentStandard content array
Returns
void

Definition at line 1378 of file Indexer.php.

References TYPO3\CMS\IndexedSearch\Utility\IndexedSearchUtility\md5inthash(), and TYPO3\CMS\IndexedSearch\Indexer\metaphone().

Referenced by TYPO3\CMS\IndexedSearch\Indexer\indexAnalyze().

◆ analyzeHeaderinfo()

TYPO3\CMS\IndexedSearch\Indexer::analyzeHeaderinfo ( $retArr,
  $content,
  $key,
  $offset 
)

Calculates relevant information for headercontent

Parameters
array$retArrIndex array, passed by reference
array$contentStandard content array
string$keyKey from standard content array
int$offsetBit-wise priority to type
Returns
void

Definition at line 1347 of file Indexer.php.

References TYPO3\CMS\IndexedSearch\Utility\IndexedSearchUtility\md5inthash(), and TYPO3\CMS\IndexedSearch\Indexer\metaphone().

Referenced by TYPO3\CMS\IndexedSearch\Indexer\indexAnalyze().

◆ backend_indexAsTYPO3Page()

TYPO3\CMS\IndexedSearch\Indexer::backend_indexAsTYPO3Page (   $title,
  $keywords,
  $description,
  $content,
  $charset,
  $mtime,
  $crdate = 0,
  $recordUid = 0 
)

Indexing records as the content of a TYPO3 page.

Parameters
string$titleTitle equivalent
string$keywordsKeywords equivalent
string$descriptionDescription equivalent
string$contentThe main content to index
string$charsetThe charset of the title, keyword, description and body-content. MUST BE VALID, otherwise nothing is indexed!
int$mtimeLast modification time, in seconds
int$crdateThe creation date of the content, in seconds
int$recordUidThe record UID that the content comes from (for registration with the indexed rows)
Returns
void

Definition at line 407 of file Indexer.php.

References TYPO3\CMS\IndexedSearch\Indexer\indexTypo3PageContent().

◆ backend_initIndexer()

TYPO3\CMS\IndexedSearch\Indexer::backend_initIndexer (   $id,
  $type,
  $sys_language_uid,
  $MP,
  $uidRL,
  $cHash_array = [],
  $createCHash = false 
)

Initializing the "combined ID" of the page (phash) being indexed (or for which external media is attached)

Parameters
int$idThe page uid, &id=
int$typeThe page type, &type=
int$sys_language_uidsys_language uid, typically &L=
string$MPThe MP variable (Mount Points), &MP=
array$uidRLRootline array of only UIDs.
array$cHash_arrayArray of GET variables to register with this indexing
bool$createCHashIf set, calculates a cHash value from the $cHash_array. Probably you will not do that since such cases are indexed through the frontend and the idea of this interface is to index non-cacheable pages from the backend!
Returns
void

Definition at line 338 of file Indexer.php.

References TYPO3\CMS\Core\Utility\GeneralUtility\implodeArrayForUrl(), TYPO3\CMS\IndexedSearch\Indexer\init(), and TYPO3\CMS\Core\Utility\GeneralUtility\makeInstance().

◆ backend_setFreeIndexUid()

TYPO3\CMS\IndexedSearch\Indexer::backend_setFreeIndexUid (   $freeIndexUid,
  $freeIndexSetId = 0 
)

Sets the free-index uid. Can be called right after backend_initIndexer()

Parameters
int$freeIndexUidFree index UID
int$freeIndexSetIdSet id - an integer identifying the "set" of indexing operations.
Returns
void

Definition at line 388 of file Indexer.php.

◆ bodyDescription()

TYPO3\CMS\IndexedSearch\Indexer::bodyDescription (   $contentArr)

Extracts the sample description text from the content array.

Parameters
array$contentArrContent array
Returns
string Description string

Definition at line 1309 of file Indexer.php.

References TYPO3\CMS\Core\Utility\MathUtility\forceIntegerInRange().

Referenced by TYPO3\CMS\IndexedSearch\Indexer\submitFilePage(), and TYPO3\CMS\IndexedSearch\Indexer\submitPage().

◆ charsetEntity2utf8()

TYPO3\CMS\IndexedSearch\Indexer::charsetEntity2utf8 ( $contentArr,
  $charset 
)

Convert character set and HTML entities in the value of input content array keys

Parameters
array$contentArrStandard content array
string$charsetCharset of the input content (converted to utf-8)
Returns
void

Definition at line 1269 of file Indexer.php.

Referenced by TYPO3\CMS\IndexedSearch\Indexer\indexTypo3PageContent().

◆ checkContentHash()

TYPO3\CMS\IndexedSearch\Indexer::checkContentHash ( )

Check content hash in phash table

Returns
mixed Returns TRUE if the page needs to be indexed (that is, there was no result), otherwise the phash value (in an array) of the phash record to which the grlist_record should be related!

Definition at line 1772 of file Indexer.php.

References $GLOBALS, and TYPO3\CMS\IndexedSearch\Utility\IndexedSearchUtility\isTableUsed().

Referenced by TYPO3\CMS\IndexedSearch\Indexer\indexTypo3PageContent().

◆ checkExternalDocContentHash()

TYPO3\CMS\IndexedSearch\Indexer::checkExternalDocContentHash (   $hashGr,
  $content_md5h 
)

Check content hash for external documents Returns TRUE if the document needs to be indexed (that is, there was no result)

Parameters
int$hashGrphash value to check (phash_grouping)
int$content_md5hContent hash to check
Returns
bool Returns TRUE if the document needs to be indexed (that is, there was no result)

Definition at line 1793 of file Indexer.php.

References TYPO3\CMS\IndexedSearch\Indexer\$content_md5h, $GLOBALS, and TYPO3\CMS\IndexedSearch\Utility\IndexedSearchUtility\isTableUsed().

Referenced by TYPO3\CMS\IndexedSearch\Indexer\indexRegularDocument().

◆ checkMtimeTstamp()

TYPO3\CMS\IndexedSearch\Indexer::checkMtimeTstamp (   $mtime,
  $phash 
)

Check the mtime / tstamp of the currently indexed page/file (based on phash) Return positive integer if the page needs to be indexed

Parameters
int$mtimemtime value to test against limits and indexed page (usually this is the mtime of the cached document)
int$phash"phash" used to select any already indexed page to see what its mtime is.
Returns
int Result integer: Generally: <0 = No indexing, >0 = Do indexing (see $this->reasons): -2) Min age was NOT exceeded and so indexing cannot occur. -1) mtime matched so no need to reindex page. 0) N/A 1) Max age exceeded, page must be indexed again. 2) mtime of indexed page doesn't match mtime given for current content and we must index page. 3) No mtime was set, so we will index... 4) No indexed page found, so of course we will index.

Definition at line 1718 of file Indexer.php.

References $GLOBALS, TYPO3\CMS\IndexedSearch\Utility\IndexedSearchUtility\isTableUsed(), TYPO3\CMS\IndexedSearch\Indexer\log_setTSlogMessage(), and TYPO3\CMS\IndexedSearch\Indexer\updateTstamp().

Referenced by TYPO3\CMS\IndexedSearch\Indexer\indexRegularDocument(), and TYPO3\CMS\IndexedSearch\Indexer\indexTypo3PageContent().

◆ checkWordList()

TYPO3\CMS\IndexedSearch\Indexer::checkWordList (   $wordListArray)

Adds new words to db

Parameters
array$wordListArrayWord List array (where each word has information about position etc).
Returns
void

Definition at line 1945 of file Indexer.php.

References $GLOBALS, TYPO3\CMS\IndexedSearch\Utility\IndexedSearchUtility\isTableUsed(), and TYPO3\CMS\IndexedSearch\Indexer\log_setTSlogMessage().

Referenced by TYPO3\CMS\IndexedSearch\Indexer\indexRegularDocument(), and TYPO3\CMS\IndexedSearch\Indexer\indexTypo3PageContent().

◆ convertHTMLToUtf8()

TYPO3\CMS\IndexedSearch\Indexer::convertHTMLToUtf8 (   $content,
  $charset = '' 
)

Converts a HTML document to utf-8

Parameters
string$contentHTML content, any charset
string$charsetOptional charset (otherwise extracted from HTML)
Returns
string Converted HTML

Definition at line 666 of file Indexer.php.

References TYPO3\CMS\IndexedSearch\Indexer\getHTMLcharset().

◆ createLocalPath()

TYPO3\CMS\IndexedSearch\Indexer::createLocalPath (   $sourcePath)
protected

Checks if the file is local

Parameters
string$sourcePath
Returns
string Absolute path to file if file is local, else empty string

Definition at line 943 of file Indexer.php.

Referenced by TYPO3\CMS\IndexedSearch\Indexer\extractHyperLinks().

◆ createLocalPathFromAbsoluteURL()

TYPO3\CMS\IndexedSearch\Indexer::createLocalPathFromAbsoluteURL (   $sourcePath)
protected

Attempts to create a local file path from the absolute URL without schema.

Parameters
string$sourcePath
Returns
string

Definition at line 1038 of file Indexer.php.

◆ createLocalPathFromRelativeURL()

TYPO3\CMS\IndexedSearch\Indexer::createLocalPathFromRelativeURL (   $sourcePath)
protected

Attempts to create a local file path from the relative URL.

Parameters
string$sourcePath
Returns
string

Definition at line 1057 of file Indexer.php.

◆ createLocalPathFromT3vars()

TYPO3\CMS\IndexedSearch\Indexer::createLocalPathFromT3vars (   $sourcePath)
protected

Attempts to create a local file path from T3VARs. This is useful for various download extensions that hide actual file name but still want the file to be indexed.

Parameters
string$sourcePath
Returns
string

Definition at line 970 of file Indexer.php.

References $GLOBALS, and TYPO3\CMS\Core\Utility\GeneralUtility\shortMD5().

◆ createLocalPathUsingAbsRefPrefix()

TYPO3\CMS\IndexedSearch\Indexer::createLocalPathUsingAbsRefPrefix (   $sourcePath)
protected

Attempts to create a local file path by matching absRefPrefix. This requires TSFE. If TSFE is missing, this function does nothing.

Parameters
string$sourcePath
Returns
string

Definition at line 1014 of file Indexer.php.

References $GLOBALS.

◆ createLocalPathUsingDomainURL()

TYPO3\CMS\IndexedSearch\Indexer::createLocalPathUsingDomainURL (   $sourcePath)
protected

Attempts to create a local file path by matching a current request URL.

Parameters
string$sourcePath
Returns
string

Definition at line 992 of file Indexer.php.

References TYPO3\CMS\Core\Utility\GeneralUtility\getIndpEnv().

◆ embracingTags()

TYPO3\CMS\IndexedSearch\Indexer::embracingTags (   $string,
  $tagName,
$tagContent,
$stringAfter,
$paramList 
)

Finds first occurrence of embracing tags and returns the embraced content and the original string with the tag removed in the two passed variables. Returns FALSE if no match found. ie. useful for finding <title> of document or removing <script>-sections

Parameters
string$stringString to search in
string$tagNameTag name, eg. "script
string$tagContentPassed by reference: Content inside found tag
string$stringAfterPassed by reference: Content after found tag
string$paramListPassed by reference: Attributes of the found tag.
Returns
bool Returns FALSE if tag was not found, otherwise TRUE.

Definition at line 691 of file Indexer.php.

Referenced by TYPO3\CMS\IndexedSearch\Indexer\splitHTMLContent().

◆ extractBaseHref()

TYPO3\CMS\IndexedSearch\Indexer::extractBaseHref (   $html)

Extracts the "base href" from content string.

Parameters
string$htmlContent to analyze
Returns
string The base href or an empty string if not found

Definition at line 856 of file Indexer.php.

References TYPO3\CMS\Core\Utility\GeneralUtility\makeInstance().

◆ extractHyperLinks()

TYPO3\CMS\IndexedSearch\Indexer::extractHyperLinks (   $html)

Extracts all links to external documents from the HTML content string

Parameters
string$html
Returns
array Array of hyperlinks (keys: tag, href, localPath (empty if not local))
See also
extractLinks()

Definition at line 827 of file Indexer.php.

References TYPO3\CMS\IndexedSearch\Indexer\createLocalPath(), and TYPO3\CMS\Core\Utility\GeneralUtility\makeInstance().

Referenced by TYPO3\CMS\IndexedSearch\Indexer\extractLinks().

◆ extractLinks()

◆ fileContentParts()

TYPO3\CMS\IndexedSearch\Indexer::fileContentParts (   $ext,
  $absFile 
)

Creates an array with pointers to divisions of document.

Parameters
string$extFile extension
string$absFileAbsolute filename (must exist and be validated OK before calling function)
Returns
array Array of pointers to sections that the document should be divided into

Definition at line 1233 of file Indexer.php.

Referenced by TYPO3\CMS\IndexedSearch\Indexer\indexRegularDocument().

◆ freqMap()

TYPO3\CMS\IndexedSearch\Indexer::freqMap (   $freq)

maps frequency from a real number in [0;1] to an integer in [0;$this->freqRange] with anything above $this->freqMax as 1 and back.

Parameters
float$freqFrequency
Returns
int Frequency in range.

Definition at line 2016 of file Indexer.php.

References TYPO3\CMS\IndexedSearch\Indexer\$freqRange.

Referenced by TYPO3\CMS\IndexedSearch\Indexer\submitWords().

◆ getHTMLcharset()

TYPO3\CMS\IndexedSearch\Indexer::getHTMLcharset (   $content)

Extract the charset value from HTML meta tag.

Parameters
string$contentHTML content
Returns
string The charset value if found.

Definition at line 650 of file Indexer.php.

Referenced by TYPO3\CMS\IndexedSearch\Indexer\convertHTMLToUtf8().

◆ getRootLineFields()

TYPO3\CMS\IndexedSearch\Indexer::getRootLineFields ( array &  $fieldArray)

Adding values for root-line fields. rl0, rl1 and rl2 are standard. A hook might add more.

Parameters
array$fieldArrayField array, passed by reference
Returns
void

Definition at line 1912 of file Indexer.php.

References $GLOBALS.

Referenced by TYPO3\CMS\IndexedSearch\Indexer\submit_section(), and TYPO3\CMS\IndexedSearch\Indexer\updateRootline().

◆ getUrlHeaders()

TYPO3\CMS\IndexedSearch\Indexer::getUrlHeaders (   $url)

Getting HTTP request headers of URL

Parameters
string$urlThe URL
Returns
mixed If no answer, returns FALSE. Otherwise an array where HTTP headers are keys

Definition at line 918 of file Indexer.php.

References TYPO3\CMS\Core\Utility\GeneralUtility\getUrl(), and TYPO3\CMS\Core\Utility\GeneralUtility\trimExplode().

Referenced by TYPO3\CMS\IndexedSearch\Indexer\indexExternalUrl().

◆ hook_indexContent()

TYPO3\CMS\IndexedSearch\Indexer::hook_indexContent ( $pObj)

◆ includeCrawlerClass()

TYPO3\CMS\IndexedSearch\Indexer::includeCrawlerClass ( )

Includes the crawler class

Returns
void

Definition at line 1929 of file Indexer.php.

References TYPO3\CMS\Core\Utility\GeneralUtility\requireOnce().

Referenced by TYPO3\CMS\IndexedSearch\Indexer\extractLinks().

◆ indexAnalyze()

TYPO3\CMS\IndexedSearch\Indexer::indexAnalyze (   $content)

Analyzes content to use for indexing,

Parameters
array$contentStandard content array: an array with the keys title,keywords,description and body, which all contain an array of words.
Returns
array Index Array (whatever that is...)

Definition at line 1327 of file Indexer.php.

References TYPO3\CMS\IndexedSearch\Indexer\analyzeBody(), and TYPO3\CMS\IndexedSearch\Indexer\analyzeHeaderinfo().

Referenced by TYPO3\CMS\IndexedSearch\Indexer\indexRegularDocument(), and TYPO3\CMS\IndexedSearch\Indexer\indexTypo3PageContent().

◆ indexExternalUrl()

TYPO3\CMS\IndexedSearch\Indexer::indexExternalUrl (   $externalUrl)

◆ indexRegularDocument()

TYPO3\CMS\IndexedSearch\Indexer::indexRegularDocument (   $file,
  $force = false,
  $contentTmpFile = '',
  $altExtension = '' 
)

Indexing a regular document given as $file (relative to PATH_site, local file)

Parameters
string$fileRelative Filename, relative to PATH_site. It can also be an absolute path as long as it is inside the lockRootPath (validated with ::isAbsPath()). Finally, if $contentTmpFile is set, this value can be anything, most likely a URL
bool$forceIf set, indexing is forced (despite content hashes, mtime etc).
string$contentTmpFileTemporary file with the content to read it from (instead of $file). Used when the $file is a URL.
string$altExtensionFile extension for temporary file.
Returns
void

Definition at line 1109 of file Indexer.php.

References TYPO3\CMS\IndexedSearch\Indexer\$content_md5h, TYPO3\CMS\IndexedSearch\Indexer\$contentParts, TYPO3\CMS\IndexedSearch\Indexer\checkExternalDocContentHash(), TYPO3\CMS\IndexedSearch\Indexer\checkMtimeTstamp(), TYPO3\CMS\IndexedSearch\Indexer\checkWordList(), TYPO3\CMS\IndexedSearch\Indexer\fileContentParts(), TYPO3\CMS\Core\Utility\GeneralUtility\getFileAbsFileName(), TYPO3\CMS\IndexedSearch\Indexer\indexAnalyze(), TYPO3\CMS\Core\Utility\GeneralUtility\isAbsPath(), TYPO3\CMS\Core\Utility\GeneralUtility\isAllowedAbsPath(), TYPO3\CMS\IndexedSearch\Utility\IndexedSearchUtility\isTableUsed(), TYPO3\CMS\IndexedSearch\Indexer\log_pull(), TYPO3\CMS\IndexedSearch\Indexer\log_push(), TYPO3\CMS\IndexedSearch\Indexer\log_setTSlogMessage(), TYPO3\CMS\IndexedSearch\Utility\IndexedSearchUtility\md5inthash(), TYPO3\CMS\Core\Utility\GeneralUtility\milliseconds(), TYPO3\CMS\IndexedSearch\Indexer\processWordsInArrays(), TYPO3\CMS\IndexedSearch\Indexer\readFileContent(), TYPO3\CMS\IndexedSearch\Indexer\setExtHashes(), TYPO3\CMS\IndexedSearch\Indexer\submitFile_section(), TYPO3\CMS\IndexedSearch\Indexer\submitFilePage(), TYPO3\CMS\IndexedSearch\Indexer\submitWords(), TYPO3\CMS\IndexedSearch\Indexer\updateParsetime(), and TYPO3\CMS\IndexedSearch\Indexer\updateTstamp().

Referenced by TYPO3\CMS\IndexedSearch\Indexer\extractLinks(), and TYPO3\CMS\IndexedSearch\Indexer\indexExternalUrl().

◆ indexTypo3PageContent()

◆ init()

◆ initializeExternalParsers()

TYPO3\CMS\IndexedSearch\Indexer::initializeExternalParsers ( )

Initialize external parsers

Returns
void private
See also
init()

Definition at line 496 of file Indexer.php.

References $GLOBALS, and TYPO3\CMS\Core\Utility\GeneralUtility\getUserObj().

Referenced by TYPO3\CMS\IndexedSearch\Indexer\init().

◆ is_grlist_set()

TYPO3\CMS\IndexedSearch\Indexer::is_grlist_set (   $phash_x)

Checks if a grlist record has been set for the phash value input (looking at the "real" phash of the current content, not the linked-to phash of the common search result page)

Parameters
int$phash_xPhash integer to test.
Returns
bool

Definition at line 1809 of file Indexer.php.

References $GLOBALS, and TYPO3\CMS\IndexedSearch\Utility\IndexedSearchUtility\isTableUsed().

Referenced by TYPO3\CMS\IndexedSearch\Indexer\indexTypo3PageContent().

◆ isAllowedLocalFile()

static TYPO3\CMS\IndexedSearch\Indexer::isAllowedLocalFile (   $filePath)
staticprotected

Checks if the path points to the file inside the web site

Parameters
string$filePath
Returns
bool

Definition at line 1087 of file Indexer.php.

References TYPO3\CMS\Core\Utility\GeneralUtility\resolveBackPath().

◆ isRelativeURL()

static TYPO3\CMS\IndexedSearch\Indexer::isRelativeURL (   $url)
staticprotected

Checks if URL is relative.

Parameters
string$url
Returns
bool

Definition at line 1075 of file Indexer.php.

◆ log_pull()

TYPO3\CMS\IndexedSearch\Indexer::log_pull ( )

◆ log_push()

TYPO3\CMS\IndexedSearch\Indexer::log_push (   $msg,
  $key 
)

Push function wrapper for TT logging

Parameters
string$msgTitle to set
string$keyKey (?)
Returns
void

Definition at line 2089 of file Indexer.php.

References $GLOBALS.

Referenced by TYPO3\CMS\IndexedSearch\Indexer\hook_indexContent(), TYPO3\CMS\IndexedSearch\Indexer\indexRegularDocument(), and TYPO3\CMS\IndexedSearch\Indexer\indexTypo3PageContent().

◆ log_setTSlogMessage()

TYPO3\CMS\IndexedSearch\Indexer::log_setTSlogMessage (   $msg,
  $errorNum = 0 
)

◆ metaphone()

TYPO3\CMS\IndexedSearch\Indexer::metaphone (   $word,
  $returnRawMetaphoneValue = false 
)

Creating metaphone based hash from input word

Parameters
string$wordWord to convert
bool$returnRawMetaphoneValueIf set, returns the raw metaphone value (not hashed)
Returns
mixed Metaphone hash integer (or raw value, string)

Definition at line 1409 of file Indexer.php.

References TYPO3\CMS\IndexedSearch\Utility\IndexedSearchUtility\md5inthash().

Referenced by TYPO3\CMS\IndexedSearch\Indexer\analyzeBody(), and TYPO3\CMS\IndexedSearch\Indexer\analyzeHeaderinfo().

◆ processWordsInArrays()

TYPO3\CMS\IndexedSearch\Indexer::processWordsInArrays (   $contentArr)

Processing words in the array from split*Content -functions

Parameters
array$contentArrArray of content to index, see splitHTMLContent() and splitRegularContent()
Returns
array Content input array modified so each key is not a unique array of words

Definition at line 1289 of file Indexer.php.

Referenced by TYPO3\CMS\IndexedSearch\Indexer\indexRegularDocument(), and TYPO3\CMS\IndexedSearch\Indexer\indexTypo3PageContent().

◆ readFileContent()

TYPO3\CMS\IndexedSearch\Indexer::readFileContent (   $fileExtension,
  $absoluteFileName,
  $sectionPointer 
)

Reads the content of an external file being indexed. The content from the external parser MUST be returned in utf-8!

Parameters
string$fileExtensionFile extension, eg. "pdf", "doc" etc.
string$absoluteFileNameAbsolute filename of file (must exist and be validated OK before calling function)
string$sectionPointerPointer to section (zero for all other than PDF which will have an indication of pages into which the document should be splitted.)
Returns
array Standard content array (title, description, keywords, body keys)

Definition at line 1216 of file Indexer.php.

Referenced by TYPO3\CMS\IndexedSearch\Indexer\indexRegularDocument().

◆ removeOldIndexedFiles()

TYPO3\CMS\IndexedSearch\Indexer::removeOldIndexedFiles (   $phash)

Removes records for the indexed page, $phash

Parameters
int$phashphash value to flush
Returns
void

Definition at line 1694 of file Indexer.php.

References $GLOBALS, and TYPO3\CMS\IndexedSearch\Utility\IndexedSearchUtility\isTableUsed().

Referenced by TYPO3\CMS\IndexedSearch\Indexer\submitFilePage().

◆ removeOldIndexedPages()

TYPO3\CMS\IndexedSearch\Indexer::removeOldIndexedPages (   $phash)

Removes records for the indexed page, $phash

Parameters
int$phashphash value to flush
Returns
void

Definition at line 1557 of file Indexer.php.

References $GLOBALS, and TYPO3\CMS\IndexedSearch\Utility\IndexedSearchUtility\isTableUsed().

Referenced by TYPO3\CMS\IndexedSearch\Indexer\submitPage().

◆ setExtHashes()

TYPO3\CMS\IndexedSearch\Indexer::setExtHashes (   $file,
  $subinfo = [] 
)

Get search hash, external files

Parameters
string$fileFile name / path which identifies it on the server
array$subinfoAdditional content identifying the (subpart of) content. For instance; PDF files are divided into groups of pages for indexing.
Returns
array Array with "phash_grouping" and "phash" inside.

Definition at line 2062 of file Indexer.php.

References TYPO3\CMS\IndexedSearch\Indexer\$hash, and TYPO3\CMS\IndexedSearch\Utility\IndexedSearchUtility\md5inthash().

Referenced by TYPO3\CMS\IndexedSearch\Indexer\indexRegularDocument().

◆ setT3Hashes()

TYPO3\CMS\IndexedSearch\Indexer::setT3Hashes ( )

◆ splitHTMLContent()

TYPO3\CMS\IndexedSearch\Indexer::splitHTMLContent (   $content)

Splits HTML content and returns an associative array, with title, a list of metatags, and a list of words in the body.

Parameters
string$contentHTML content to index. To some degree expected to be made by TYPO3 (ei. splitting the header by ":")
Returns
array Array of content, having keys "title", "body", "keywords" and "description" set.
See also
splitRegularContent()

Definition at line 599 of file Indexer.php.

References TYPO3\CMS\IndexedSearch\Indexer\$defaultContentArray, TYPO3\CMS\IndexedSearch\Indexer\addSpacesToKeywordList(), TYPO3\CMS\IndexedSearch\Indexer\embracingTags(), TYPO3\CMS\Core\Utility\GeneralUtility\get_tag_attributes(), and TYPO3\CMS\IndexedSearch\Indexer\typoSearchTags().

Referenced by TYPO3\CMS\IndexedSearch\Indexer\indexTypo3PageContent().

◆ splitRegularContent()

TYPO3\CMS\IndexedSearch\Indexer::splitRegularContent (   $content)

Splits non-HTML content (from external files for instance)

Parameters
string$contentInput content (non-HTML) to index.
Returns
array Array of content, having the key "body" set (plus "title", "description" and "keywords", but empty)
See also
splitHTMLContent()

Definition at line 1250 of file Indexer.php.

References TYPO3\CMS\IndexedSearch\Indexer\$defaultContentArray.

◆ submit_grlist()

TYPO3\CMS\IndexedSearch\Indexer::submit_grlist (   $hash,
  $phash_x 
)

◆ submit_section()

TYPO3\CMS\IndexedSearch\Indexer::submit_section (   $hash,
  $hash_t3 
)

Stores section $hash and $hash_t3 are the same for TYPO3 pages, but different when it is external files.

Parameters
int$hashphash of TYPO3 parent search result record
int$hash_t3phash of the file indexation search record
Returns
void

Definition at line 1538 of file Indexer.php.

References $GLOBALS, TYPO3\CMS\IndexedSearch\Indexer\$hash, TYPO3\CMS\IndexedSearch\Indexer\getRootLineFields(), and TYPO3\CMS\IndexedSearch\Utility\IndexedSearchUtility\isTableUsed().

Referenced by TYPO3\CMS\IndexedSearch\Indexer\submitFile_section(), and TYPO3\CMS\IndexedSearch\Indexer\submitPage().

◆ submitFile_grlist()

TYPO3\CMS\IndexedSearch\Indexer::submitFile_grlist (   $hash)

Stores file gr_list for a file IF it does not exist already

Parameters
int$hashphash value of file
Returns
void

Definition at line 1660 of file Indexer.php.

References $GLOBALS, TYPO3\CMS\IndexedSearch\Indexer\$hash, TYPO3\CMS\IndexedSearch\Utility\IndexedSearchUtility\isTableUsed(), TYPO3\CMS\IndexedSearch\Utility\IndexedSearchUtility\md5inthash(), and TYPO3\CMS\IndexedSearch\Indexer\submit_grlist().

◆ submitFile_section()

TYPO3\CMS\IndexedSearch\Indexer::submitFile_section (   $hash)

Stores file section for a file IF it does not exist

Parameters
int$hashphash value of file
Returns
void

Definition at line 1677 of file Indexer.php.

References $GLOBALS, TYPO3\CMS\IndexedSearch\Indexer\$hash, TYPO3\CMS\IndexedSearch\Utility\IndexedSearchUtility\isTableUsed(), and TYPO3\CMS\IndexedSearch\Indexer\submit_section().

Referenced by TYPO3\CMS\IndexedSearch\Indexer\indexRegularDocument().

◆ submitFilePage()

TYPO3\CMS\IndexedSearch\Indexer::submitFilePage (   $hash,
  $file,
  $subinfo,
  $ext,
  $mtime,
  $ctime,
  $size,
  $content_md5h,
  $contentParts 
)

Updates db with information about the file

Parameters
array$hashArray with phash and phash_grouping keys for file
string$fileFile name
array$subinfoArray of "cHashParams" for files: This is for instance the page index for a PDF file (other document types it will be a zero)
string$extFile extension determining the type of media.
int$mtimeModification time of file.
int$ctimeCreation time of file.
int$sizeSize of file in bytes
int$content_md5hContent HASH value.
array$contentPartsStandard content array (using only title and body for a file)
Returns
void

Definition at line 1591 of file Indexer.php.

References TYPO3\CMS\IndexedSearch\Indexer\$content_md5h, TYPO3\CMS\IndexedSearch\Indexer\$contentParts, $GLOBALS, TYPO3\CMS\IndexedSearch\Indexer\$hash, TYPO3\CMS\IndexedSearch\Indexer\$metaphoneContent, TYPO3\CMS\IndexedSearch\Indexer\bodyDescription(), TYPO3\CMS\IndexedSearch\Utility\IndexedSearchUtility\isTableUsed(), and TYPO3\CMS\IndexedSearch\Indexer\removeOldIndexedFiles().

Referenced by TYPO3\CMS\IndexedSearch\Indexer\indexRegularDocument().

◆ submitPage()

◆ submitWords()

TYPO3\CMS\IndexedSearch\Indexer::submitWords (   $wordList,
  $phash 
)

Submits RELATIONS between words and phash

Parameters
array$wordListWord list array
int$phashphash value
Returns
void

Definition at line 1984 of file Indexer.php.

References TYPO3\CMS\IndexedSearch\Indexer\$flagBitMask, $GLOBALS, TYPO3\CMS\IndexedSearch\Indexer\freqMap(), and TYPO3\CMS\IndexedSearch\Utility\IndexedSearchUtility\isTableUsed().

Referenced by TYPO3\CMS\IndexedSearch\Indexer\indexRegularDocument(), and TYPO3\CMS\IndexedSearch\Indexer\indexTypo3PageContent().

◆ typoSearchTags()

TYPO3\CMS\IndexedSearch\Indexer::typoSearchTags ( $body)

Removes content that shouldn't be indexed according to TYPO3SEARCH-tags.

Parameters
string$bodyHTML Content, passed by reference
Returns
bool Returns TRUE if a TYPOSEARCH_ tag was found, otherwise FALSE.

Definition at line 720 of file Indexer.php.

Referenced by TYPO3\CMS\IndexedSearch\Indexer\splitHTMLContent().

◆ update_grlist()

TYPO3\CMS\IndexedSearch\Indexer::update_grlist (   $phash,
  $phash_x 
)

Check if an grlist-entry for this hash exists and if not so, write one.

Parameters
int$phashphash of the search result that should be found
int$phash_xThe real phash of the current content. The two values are different when a page with userlogin turns out to contain the exact same content as another already indexed version of the page; This is the whole reason for the grlist table in fact...
Returns
void
See also
submit_grlist()

Definition at line 1827 of file Indexer.php.

References $GLOBALS, TYPO3\CMS\IndexedSearch\Utility\IndexedSearchUtility\isTableUsed(), TYPO3\CMS\IndexedSearch\Indexer\log_setTSlogMessage(), TYPO3\CMS\IndexedSearch\Utility\IndexedSearchUtility\md5inthash(), and TYPO3\CMS\IndexedSearch\Indexer\submit_grlist().

Referenced by TYPO3\CMS\IndexedSearch\Indexer\indexTypo3PageContent().

◆ updateParsetime()

TYPO3\CMS\IndexedSearch\Indexer::updateParsetime (   $phash,
  $parsetime 
)

Update parsetime for phash row.

Parameters
int$phashphash value.
int$parsetimeParsetime value to set.
Returns
void

Definition at line 1881 of file Indexer.php.

References $GLOBALS, and TYPO3\CMS\IndexedSearch\Utility\IndexedSearchUtility\isTableUsed().

Referenced by TYPO3\CMS\IndexedSearch\Indexer\indexRegularDocument(), and TYPO3\CMS\IndexedSearch\Indexer\indexTypo3PageContent().

◆ updateRootline()

TYPO3\CMS\IndexedSearch\Indexer::updateRootline ( )

◆ updateSetId()

TYPO3\CMS\IndexedSearch\Indexer::updateSetId (   $phash)

Update SetID of the index_phash record.

Parameters
int$phashphash value
Returns
void

Definition at line 1864 of file Indexer.php.

References $GLOBALS, and TYPO3\CMS\IndexedSearch\Utility\IndexedSearchUtility\isTableUsed().

Referenced by TYPO3\CMS\IndexedSearch\Indexer\indexTypo3PageContent().

◆ updateTstamp()

TYPO3\CMS\IndexedSearch\Indexer::updateTstamp (   $phash,
  $mtime = 0 
)

Update tstamp for a phash row.

Parameters
int$phashphash value
int$mtimeIf set, update the mtime field to this value.
Returns
void

Definition at line 1845 of file Indexer.php.

References $GLOBALS, and TYPO3\CMS\IndexedSearch\Utility\IndexedSearchUtility\isTableUsed().

Referenced by TYPO3\CMS\IndexedSearch\Indexer\checkMtimeTstamp(), TYPO3\CMS\IndexedSearch\Indexer\indexRegularDocument(), and TYPO3\CMS\IndexedSearch\Indexer\indexTypo3PageContent().

Member Data Documentation

◆ $cHashParams

TYPO3\CMS\IndexedSearch\Indexer::$cHashParams = []

Definition at line 175 of file Indexer.php.

Referenced by TYPO3\CMS\IndexedSearch\Indexer\setT3Hashes().

◆ $conf

TYPO3\CMS\IndexedSearch\Indexer::$conf = []

Definition at line 123 of file Indexer.php.

Referenced by TYPO3\CMS\IndexedSearch\Indexer\extractLinks().

◆ $content_md5h

◆ $contentParts

TYPO3\CMS\IndexedSearch\Indexer::$contentParts = []

◆ $crawlerActive

TYPO3\CMS\IndexedSearch\Indexer::$crawlerActive = false

Definition at line 96 of file Indexer.php.

◆ $csObj

TYPO3\CMS\IndexedSearch\Indexer::$csObj

Definition at line 209 of file Indexer.php.

◆ $defaultContentArray

TYPO3\CMS\IndexedSearch\Indexer::$defaultContentArray
Initial value:
= [
'title' => ''

Definition at line 103 of file Indexer.php.

Referenced by TYPO3\CMS\IndexedSearch\Indexer\splitHTMLContent(), and TYPO3\CMS\IndexedSearch\Indexer\splitRegularContent().

◆ $defaultGrList

TYPO3\CMS\IndexedSearch\Indexer::$defaultGrList = '0,-1'

Definition at line 60 of file Indexer.php.

◆ $enableMetaphoneSearch

TYPO3\CMS\IndexedSearch\Indexer::$enableMetaphoneSearch = false

Definition at line 192 of file Indexer.php.

Referenced by TYPO3\CMS\IndexedSearch\Indexer\init().

◆ $excludeSections

TYPO3\CMS\IndexedSearch\Indexer::$excludeSections = 'script,style'

Definition at line 44 of file Indexer.php.

◆ $external_parsers

TYPO3\CMS\IndexedSearch\Indexer::$external_parsers = []

Definition at line 51 of file Indexer.php.

◆ $externalFileCounter

TYPO3\CMS\IndexedSearch\Indexer::$externalFileCounter = 0

Definition at line 118 of file Indexer.php.

◆ $file_phash_arr

TYPO3\CMS\IndexedSearch\Indexer::$file_phash_arr = []

Definition at line 144 of file Indexer.php.

◆ $flagBitMask

TYPO3\CMS\IndexedSearch\Indexer::$flagBitMask

Definition at line 228 of file Indexer.php.

Referenced by TYPO3\CMS\IndexedSearch\Indexer\submitWords().

◆ $forceIndexing

TYPO3\CMS\IndexedSearch\Indexer::$forceIndexing = false

Definition at line 89 of file Indexer.php.

◆ $freqMax

TYPO3\CMS\IndexedSearch\Indexer::$freqMax = 0.1

Definition at line 187 of file Indexer.php.

◆ $freqRange

TYPO3\CMS\IndexedSearch\Indexer::$freqRange = 32000

Definition at line 182 of file Indexer.php.

Referenced by TYPO3\CMS\IndexedSearch\Indexer\freqMap().

◆ $hash

◆ $indexerConfig

TYPO3\CMS\IndexedSearch\Indexer::$indexerConfig = []

Definition at line 130 of file Indexer.php.

Referenced by TYPO3\CMS\IndexedSearch\Indexer\hook_indexContent().

◆ $indexExternalUrl_content

TYPO3\CMS\IndexedSearch\Indexer::$indexExternalUrl_content = ''

Definition at line 170 of file Indexer.php.

◆ $internal_log

TYPO3\CMS\IndexedSearch\Indexer::$internal_log = []

Definition at line 163 of file Indexer.php.

◆ $lexerObj

TYPO3\CMS\IndexedSearch\Indexer::$lexerObj

Definition at line 223 of file Indexer.php.

◆ $maxExternalFiles

TYPO3\CMS\IndexedSearch\Indexer::$maxExternalFiles = 0

Definition at line 82 of file Indexer.php.

◆ $metaphoneContent

TYPO3\CMS\IndexedSearch\Indexer::$metaphoneContent = ''

◆ $metaphoneObj

TYPO3\CMS\IndexedSearch\Indexer::$metaphoneObj

Definition at line 216 of file Indexer.php.

◆ $reasons

TYPO3\CMS\IndexedSearch\Indexer::$reasons
Initial value:
= [
-1 => 'mtime matched the document, so no changes detected and no content updated'

Definition at line 30 of file Indexer.php.

◆ $storeMetaphoneInfoAsWords

TYPO3\CMS\IndexedSearch\Indexer::$storeMetaphoneInfoAsWords

Definition at line 197 of file Indexer.php.

◆ $tstamp_maxAge

TYPO3\CMS\IndexedSearch\Indexer::$tstamp_maxAge = 0

Definition at line 67 of file Indexer.php.

◆ $tstamp_minAge

TYPO3\CMS\IndexedSearch\Indexer::$tstamp_minAge = 0

Definition at line 75 of file Indexer.php.

◆ $wordcount

TYPO3\CMS\IndexedSearch\Indexer::$wordcount = 0

Definition at line 113 of file Indexer.php.