PHP Класс eZSearchEngine

Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$CreatedTempTablesNames
$TempTablesCount

Открытые методы

Метод Описание
addObject ( eZContentObject $contentObject, boolean $commit = true ) : boolean Adds object $contentObject to the search database.
buildPhraseSqlQueryPart ( $phraseIDArray, $identifier = false ) *! \private \return Returns an sql query part for a phrase
buildSearchPartArray ( $phraseTextArray, $nonPhraseText, $wordIDHash, $wildIDArray, $identifier = false )
buildSearchPartArrayForPhrases ( $phraseTextArray, $wordIDHash, $identifier = false )
buildSearchPartArrayForWords ( $nonPhraseText, $wordIDHash, $wildIDArray, $identifier = false )
buildSortSQL ( $sortArray ) *! \private \return an array of ORDER BY SQL
buildSqlPartForWord ( $wordID, $identifier = false ) *! \private \return Returns an sql query part for one word
buildTempTablesForFullTextSearch ( $searchPartsArray, $generalFilterList = [] )
buildWordIDArray ( $indexArrayOnlyWords ) *! \private
callMethod ( $methodName, $parameterArray )
cleanup ( ) *! Will remove all search words and object/word relations.
commit ( ) Commit the changes to the search engine
constructMethodName ( $searchTypeData )
createTemporaryTable ( $searchPartText )
eZSearchEngine ( )
fetchTotalObjectCount ( )
getPhrases ( $searchText )
getSavedTempTableName ( $index ) *! \return Given table name from the list of saved temporary tables names by its index.
getSavedTempTablesList ( ) *! \return List of saved temporary tables names.
indexWords ( $contentObject, $indexArray, $wordIDArray, $placement ) *! \private
isSearchPartIncomplete ( $part ) *! \return true if the search part is incomplete.
needCommit ( )
needRemoveWithUpdate ( )
normalizeText ( $text, $isMetaData = false ) *! Normalizes the text \a $text so that it is easily parsable \param $isMetaData If \c true then it expects the text to be meta data from objects, if not it is the search text and needs special handling.
prepareWordIDArrays ( $searchText )
prepareWordIDArraysForPattern ( $searchText )
removeObject ( eZContentObject $contentObject, boolean $commit = null ) : boolean Removes object $contentObject from the search database.
removeObjectById ( integer $contentObjectId, boolean $commit = null ) : boolean Removes a content object by Id from the search database.
saveCreatedTempTableName ( $index, $tableName ) *! Saves name of a temporary that has just been created, for us to know its name when it's time to drop the table.
search ( $searchText, $params = [], $searchTypes = [] ) *! Runs a query to the search engine.
searchAttributeByIdentifier ( $searchParams )
searchAttributeByIdentifierRange ( $searchParams )
searchAttributeByRange ( $searchParams )
searchAttributeFulltext ( $searchParams )
searchAttributeInteger ( $searchParams )
searchAttributeIntegers ( $searchParams )
searchAttributeIntegersByIdentifier ( $searchParams )
searchAttributePatternText ( $searchParams )
splitString ( $text ) *! \private \return Returns an array of words created from the input string.
supportedSearchTypes ( ) *! \static \return Returns an array describing the supported search types in thie search engine.
updateObjectsSection ( array $objectIDs, integer $sectionID ) : void Update the section in the search engine

Защищенные методы

Метод Описание
removeAllQuotes ( string $text ) : string Remove single and double quotes, including UTF-8 variations
removeDuplicatedSpaces ( string $text ) : string Remove duplicated spaces

Описание методов

addObject() публичный Метод

Adds object $contentObject to the search database.
public addObject ( eZContentObject $contentObject, boolean $commit = true ) : boolean
$contentObject eZContentObject Object to add to search engine
$commit boolean Whether to commit after adding the object
Результат boolean True if the operation succeed.

buildPhraseSqlQueryPart() публичный Метод

*! \private \return Returns an sql query part for a phrase
public buildPhraseSqlQueryPart ( $phraseIDArray, $identifier = false )

buildSearchPartArray() публичный Метод

public buildSearchPartArray ( $phraseTextArray, $nonPhraseText, $wordIDHash, $wildIDArray, $identifier = false )

buildSearchPartArrayForPhrases() публичный Метод

public buildSearchPartArrayForPhrases ( $phraseTextArray, $wordIDHash, $identifier = false )

buildSearchPartArrayForWords() публичный Метод

public buildSearchPartArrayForWords ( $nonPhraseText, $wordIDHash, $wildIDArray, $identifier = false )

buildSortSQL() публичный Метод

*! \private \return an array of ORDER BY SQL
public buildSortSQL ( $sortArray )

buildSqlPartForWord() публичный Метод

*! \private \return Returns an sql query part for one word
public buildSqlPartForWord ( $wordID, $identifier = false )

buildTempTablesForFullTextSearch() публичный Метод

public buildTempTablesForFullTextSearch ( $searchPartsArray, $generalFilterList = [] )

buildWordIDArray() публичный Метод

Build WordIDArray and update ezsearch_word table \params words for object to add \return wordIDArray
public buildWordIDArray ( $indexArrayOnlyWords )

callMethod() публичный Метод

public callMethod ( $methodName, $parameterArray )

cleanup() публичный Метод

*! Will remove all search words and object/word relations.
public cleanup ( )

commit() публичный Метод

Commit the changes to the search engine
public commit ( )

constructMethodName() публичный Метод

public constructMethodName ( $searchTypeData )

createTemporaryTable() публичный Метод

public createTemporaryTable ( $searchPartText )

eZSearchEngine() публичный Метод

public eZSearchEngine ( )

fetchTotalObjectCount() публичный Метод

getPhrases() публичный Метод

public getPhrases ( $searchText )

getSavedTempTableName() публичный Метод

\see saveCreatedTempTableName()
public getSavedTempTableName ( $index )

getSavedTempTablesList() публичный Метод

\see saveCreatedTempTableName()

indexWords() публичный Метод

\param contentObject \param indexArray \param wordIDArray \param placement \return last placement Index wordIndex
public indexWords ( $contentObject, $indexArray, $wordIDArray, $placement )

isSearchPartIncomplete() публичный Метод

*! \return true if the search part is incomplete.
public isSearchPartIncomplete ( $part )

needCommit() публичный Метод

public needCommit ( )

needRemoveWithUpdate() публичный Метод

normalizeText() публичный Метод

*! Normalizes the text \a $text so that it is easily parsable \param $isMetaData If \c true then it expects the text to be meta data from objects, if not it is the search text and needs special handling.
public normalizeText ( $text, $isMetaData = false )

prepareWordIDArrays() публичный Метод

public prepareWordIDArrays ( $searchText )

prepareWordIDArraysForPattern() публичный Метод

public prepareWordIDArraysForPattern ( $searchText )

removeAllQuotes() защищенный статический Метод

Remove single and double quotes, including UTF-8 variations
protected static removeAllQuotes ( string $text ) : string
$text string
Результат string

removeDuplicatedSpaces() защищенный статический Метод

Remove duplicated spaces
protected static removeDuplicatedSpaces ( string $text ) : string
$text string
Результат string

removeObject() публичный Метод

Removes object $contentObject from the search database.
Устаревший: Since 5.0, use removeObjectById()
public removeObject ( eZContentObject $contentObject, boolean $commit = null ) : boolean
$contentObject eZContentObject the content object to remove
$commit boolean Whether to commit after removing the object
Результат boolean True if the operation succeed.

removeObjectById() публичный Метод

Removes a content object by Id from the search database.
С версии: 5.0
public removeObjectById ( integer $contentObjectId, boolean $commit = null ) : boolean
$contentObjectId integer The content object to remove by id
$commit boolean Whether to commit after removing the object
Результат boolean True if the operation succeed.

saveCreatedTempTableName() публичный Метод

*! Saves name of a temporary that has just been created, for us to know its name when it's time to drop the table.
public saveCreatedTempTableName ( $index, $tableName )

searchAttributeByIdentifier() публичный Метод

public searchAttributeByIdentifier ( $searchParams )

searchAttributeByIdentifierRange() публичный Метод

public searchAttributeByIdentifierRange ( $searchParams )

searchAttributeByRange() публичный Метод

public searchAttributeByRange ( $searchParams )

searchAttributeFulltext() публичный Метод

public searchAttributeFulltext ( $searchParams )

searchAttributeInteger() публичный Метод

public searchAttributeInteger ( $searchParams )

searchAttributeIntegers() публичный Метод

public searchAttributeIntegers ( $searchParams )

searchAttributeIntegersByIdentifier() публичный Метод

public searchAttributeIntegersByIdentifier ( $searchParams )

searchAttributePatternText() публичный Метод

public searchAttributePatternText ( $searchParams )

splitString() публичный Метод

*! \private \return Returns an array of words created from the input string.
public splitString ( $text )

supportedSearchTypes() публичный Метод

\note It has been renamed. In eZ Publish 3.4 and older it was (wrongly) named suportedSearchTypes().

updateObjectsSection() публичный Метод

Update the section in the search engine
См. также: eZSearch::updateObjectsSection()
public updateObjectsSection ( array $objectIDs, integer $sectionID ) : void
$objectIDs array
$sectionID integer
Результат void

Описание свойств

$CreatedTempTablesNames публичное свойство

public $CreatedTempTablesNames

$TempTablesCount публичное свойство

public $TempTablesCount