IndexSearchRepository

Index search abstraction to search through the index

Internal

This class is a specific repository implementation and is not considered part of the Public TYPO3 API.

Table of Contents

Properties

$descendingSortOrderFlag  : bool
Descending sort order flag formally known as $this->piVars['desc']
$displayForbiddenRecords  : bool
Display forbidden records formally known as $this->conf['show.']['forbiddenRecords']
$externalParsers  : array<string|int, mixed>
External Parsers
$frontendUserGroupList  : string
Frontend User Group List
$languageUid  : int
Language uid formally known as $this->piVars['lang']
$mediaType  : MediaType
Media type formally known as $this->piVars['media']
$numberOfResults  : int
Number of results formally known as $this->piVars['result']
$resultpagePointer  : int
Result page pointer formally known as $this->piVars['pointer']
$searchRootPageIdList  : string
list of all root pages that will be used If this value is set to less than zero (eg. -1) searching will happen in ALL of the page tree with no regard to branches at all.
$searchType  : SearchType
Search type formally known as $this->piVars['type']
$sections  : string
Sections formally known as $this->piVars['sections']
$sortOrder  : string
Sort order formally known as $this->piVars['sort_order']
$useExactCount  : bool
Flag for exact search count formally known as $conf['search.']['exactCount']
$wSelClauses  : array<string|int, mixed>
Select clauses for individual words, will be filled during the search

Methods

__construct()  : mixed
doSearch()  : array<string|int, mixed>|false
Get search result rows / data from database. Returned as data in array.
getFullTextRowByPhash()  : array<string|int, mixed>|null
getIndexConfigurationById()  : array<string|int, mixed>|null
initialize()  : void
initialize all options that are necessary for the search
writeSearchStat()  : void
Write statistics information to database for the search operation if there was at least one search word.
checkResume()  : bool
Checking if the resume can be shown for the search result (depending on whether the rights are OK) ? Should it also check for gr_list "0,-1"?
execFinalQuery()  : Result
Execute final query, based on phash integer list. The main point is sorting the result in the right order.
execFinalQuery_fulltext()  : Result
Execute final query, based on phash integer list. The main point is sorting the result in the right order.
execPHashListQuery()  : Result
Returns a query which selects the search-word from the word/rel tables.
freeIndexUidWhere()  : string
Where-clause for free index-uid value.
getDescendingSortOrderFlag()  : string
Returns "DESC" or "" depending on the settings of the incoming highest/lowest result order (piVars['desc'])
getPhashList()  : string
Returns a COMPLETE list of phash-integers matching the search-result composed of the search-words in the $searchWords array.
getResultRows_SQLpointer()  : Result|false
Gets a SQL result pointer to traverse for the search records.
getResultRows_SQLpointerMysqlFulltext()  : Result|false
Gets a SQL result pointer to traverse for the search records.
getSearchRootPageIdList()  : array<string|int, int>
A list of integer which should be root-pages to search from
getSearchString()  : array<string|int, mixed>
Returns a search string for use with MySQL FULLTEXT query
languageWhere()  : string
Returns AND statement for selection of language
mediaTypeWhere()  : string
Returns AND statement for selection of media type
multiplePagesType()  : bool
Returns if an item type is a multipage item type
searchDistinct()  : Result
Search for one distinct word
searchSentence()  : Result
Search for a sentence
searchWord()  : Result
Search for a word
sectionTableWhere()  : string
Returns AND statement for selection of section in database. (rootlevel 0-2 + page_id)

Properties

$descendingSortOrderFlag

Descending sort order flag formally known as $this->piVars['desc']

protected bool $descendingSortOrderFlag = false

$displayForbiddenRecords

Display forbidden records formally known as $this->conf['show.']['forbiddenRecords']

protected bool $displayForbiddenRecords = false

enabled through settings.displayForbiddenRecords

$externalParsers

External Parsers

protected array<string|int, mixed> $externalParsers = []

$frontendUserGroupList

Frontend User Group List

protected string $frontendUserGroupList = ''

$languageUid

Language uid formally known as $this->piVars['lang']

protected int $languageUid = 0

$mediaType

Media type formally known as $this->piVars['media']

protected MediaType $mediaType = \TYPO3\CMS\IndexedSearch\Type\MediaType::INTERNAL_PAGES

$numberOfResults

Number of results formally known as $this->piVars['result']

protected int $numberOfResults = 10

$resultpagePointer

Result page pointer formally known as $this->piVars['pointer']

protected int $resultpagePointer = 0

$searchRootPageIdList

list of all root pages that will be used If this value is set to less than zero (eg. -1) searching will happen in ALL of the page tree with no regard to branches at all.

protected string $searchRootPageIdList = ''

$searchType

Search type formally known as $this->piVars['type']

protected SearchType $searchType = \TYPO3\CMS\IndexedSearch\Type\SearchType::DISTINCT

$sections

Sections formally known as $this->piVars['sections']

protected string $sections = ''

$sortOrder

Sort order formally known as $this->piVars['sort_order']

protected string $sortOrder = ''

$useExactCount

Flag for exact search count formally known as $conf['search.']['exactCount']

protected bool $useExactCount = false

Continue counting and checking of results even if we are sure they are not displayed in this request. This will slow down your page rendering, but it allows precise search result counters. enabled through settings.exactCount

$wSelClauses

Select clauses for individual words, will be filled during the search

protected array<string|int, mixed> $wSelClauses = []

Methods

doSearch()

Get search result rows / data from database. Returned as data in array.

public doSearch(array<string|int, mixed> $searchWords, int $freeIndexUid) : array<string|int, mixed>|false
Parameters
$searchWords : array<string|int, mixed>

Search word array

$freeIndexUid : int

Pointer to which indexing configuration you want to search in. -1 means no filtering. 0 means only regular indexed content.

Return values
array<string|int, mixed>|false

FALSE if no result, otherwise an array with keys for first row, result rows and total number of results found.

getFullTextRowByPhash()

public getFullTextRowByPhash(string $phash) : array<string|int, mixed>|null
Parameters
$phash : string
Return values
array<string|int, mixed>|null

getIndexConfigurationById()

public getIndexConfigurationById(int $id) : array<string|int, mixed>|null
Parameters
$id : int
Return values
array<string|int, mixed>|null

initialize()

initialize all options that are necessary for the search

public initialize(array<string|int, mixed> $settings, array<string|int, mixed> $searchData, array<string|int, mixed> $externalParsers, int|string $searchRootPageIdList) : void
Parameters
$settings : array<string|int, mixed>

the extbase plugin settings

$searchData : array<string|int, mixed>

the search data

$externalParsers : array<string|int, mixed>
$searchRootPageIdList : int|string

writeSearchStat()

Write statistics information to database for the search operation if there was at least one search word.

public writeSearchStat(int $pageId, array<string|int, mixed> $searchWords) : void
Parameters
$pageId : int
$searchWords : array<string|int, mixed>

Search Word array

checkResume()

Checking if the resume can be shown for the search result (depending on whether the rights are OK) ? Should it also check for gr_list "0,-1"?

protected checkResume(array<string|int, mixed> $row) : bool
Parameters
$row : array<string|int, mixed>

Result row array.

Return values
bool

Returns TRUE if resume can safely be shown

execFinalQuery()

Execute final query, based on phash integer list. The main point is sorting the result in the right order.

protected execFinalQuery(string $list, int $freeIndexUid) : Result
Parameters
$list : string

List of phash integers which match the search.

$freeIndexUid : int

Pointer to which indexing configuration you want to search in. -1 means no filtering. 0 means only regular indexed content.

Return values
Result

execFinalQuery_fulltext()

Execute final query, based on phash integer list. The main point is sorting the result in the right order.

protected execFinalQuery_fulltext(array<string|int, mixed> $searchData, int $freeIndexUid) : Result

mysql fulltext specific helper method

Parameters
$searchData : array<string|int, mixed>

Array with search string, boolean indicator, and fulltext index reference

$freeIndexUid : int

Pointer to which indexing configuration you want to search in. -1 means no filtering. 0 means only regular indexed content.

Return values
Result

execPHashListQuery()

Returns a query which selects the search-word from the word/rel tables.

protected execPHashListQuery(string $wordSel, string $additionalWhereClause) : Result
Parameters
$wordSel : string

WHERE clause selecting the word from phash

$additionalWhereClause : string

Additional AND clause in the end of the query.

Return values
Result

freeIndexUidWhere()

Where-clause for free index-uid value.

protected freeIndexUidWhere(int $freeIndexUid) : string
Parameters
$freeIndexUid : int

Free Index UID value to limit search to.

Return values
string

WHERE SQL clause part.

getDescendingSortOrderFlag()

Returns "DESC" or "" depending on the settings of the incoming highest/lowest result order (piVars['desc'])

protected getDescendingSortOrderFlag([bool $inverse = false ]) : string
Parameters
$inverse : bool = false

If TRUE, inverse the order which is defined by piVars['desc']

Return values
string

" DESC" or formerly known as tx_indexedsearch_pi->isDescending

getPhashList()

Returns a COMPLETE list of phash-integers matching the search-result composed of the search-words in the $searchWords array.

protected getPhashList(array<string|int, mixed> $searchWords) : string

The list of phash integers are unsorted and should be used for subsequent selection of index_phash records for display of the result.

Parameters
$searchWords : array<string|int, mixed>

Search word array

Return values
string

List of integers

getResultRows_SQLpointer()

Gets a SQL result pointer to traverse for the search records.

protected getResultRows_SQLpointer(array<string|int, mixed> $searchWords, int $freeIndexUid) : Result|false
Parameters
$searchWords : array<string|int, mixed>

Search words

$freeIndexUid : int

Pointer to which indexing configuration you want to search in. -1 means no filtering. 0 means only regular indexed content.

Return values
Result|false

getResultRows_SQLpointerMysqlFulltext()

Gets a SQL result pointer to traverse for the search records.

protected getResultRows_SQLpointerMysqlFulltext(array<string|int, mixed> $searchWordsArray, int $freeIndexUid) : Result|false

mysql fulltext specific version triggered by ext_conf_template setting 'useMysqlFulltext'

Parameters
$searchWordsArray : array<string|int, mixed>

Search words

$freeIndexUid : int

Pointer to which indexing configuration you want to search in. -1 means no filtering. 0 means only regular indexed content.

Return values
Result|false

getSearchRootPageIdList()

A list of integer which should be root-pages to search from

protected getSearchRootPageIdList() : array<string|int, int>
Return values
array<string|int, int>

getSearchString()

Returns a search string for use with MySQL FULLTEXT query

protected getSearchString(array<string|int, mixed> $searchWordArray) : array<string|int, mixed>

mysql fulltext specific helper method

Parameters
$searchWordArray : array<string|int, mixed>

Search word array

Return values
array<string|int, mixed>

Search string

languageWhere()

Returns AND statement for selection of language

protected languageWhere() : string
Return values
string

AND statement for selection of language

mediaTypeWhere()

Returns AND statement for selection of media type

protected mediaTypeWhere() : string
Return values
string

AND statement for selection of media type

multiplePagesType()

Returns if an item type is a multipage item type

protected multiplePagesType(string $itemType) : bool
Parameters
$itemType : string

Item type

Return values
bool

TRUE if multipage capable

searchDistinct()

Search for one distinct word

protected searchDistinct(string $sWord) : Result
Parameters
$sWord : string

the search word

Return values
Result

searchSentence()

Search for a sentence

protected searchSentence(string $sWord) : Result
Parameters
$sWord : string

the search word

Return values
Result

searchWord()

Search for a word

protected searchWord(string $sWord, LikeWildcard $likeWildcard) : Result
Parameters
$sWord : string

the search word

$likeWildcard : LikeWildcard
Return values
Result

sectionTableWhere()

Returns AND statement for selection of section in database. (rootlevel 0-2 + page_id)

protected sectionTableWhere() : string
Return values
string

AND clause for selection of section in database.


        
On this page

Search results