PHP Class eZSearchEngine

Mostra file Open project: ezsystems/ezpublish-legacy Class Usage Examples

Public Properties

Property Type Description
$CreatedTempTablesNames
$TempTablesCount

Public Methods

Method Description
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

Protected Methods

Method Description
removeAllQuotes ( string $text ) : string Remove single and double quotes, including UTF-8 variations
removeDuplicatedSpaces ( string $text ) : string Remove duplicated spaces

Method Details

addObject() public method

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
return boolean True if the operation succeed.

buildPhraseSqlQueryPart() public method

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

buildSearchPartArray() public method

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

buildSearchPartArrayForPhrases() public method

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

buildSearchPartArrayForWords() public method

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

buildSortSQL() public method

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

buildSqlPartForWord() public method

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

buildTempTablesForFullTextSearch() public method

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

buildWordIDArray() public method

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

callMethod() public method

public callMethod ( $methodName, $parameterArray )

cleanup() public method

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

commit() public method

Commit the changes to the search engine
public commit ( )

constructMethodName() public method

public constructMethodName ( $searchTypeData )

createTemporaryTable() public method

public createTemporaryTable ( $searchPartText )

eZSearchEngine() public method

public eZSearchEngine ( )

fetchTotalObjectCount() public method

getPhrases() public method

public getPhrases ( $searchText )

getSavedTempTableName() public method

\see saveCreatedTempTableName()
public getSavedTempTableName ( $index )

getSavedTempTablesList() public method

\see saveCreatedTempTableName()

indexWords() public method

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

isSearchPartIncomplete() public method

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

needCommit() public method

public needCommit ( )

needRemoveWithUpdate() public method

normalizeText() public method

*! 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 method

public prepareWordIDArrays ( $searchText )

prepareWordIDArraysForPattern() public method

public prepareWordIDArraysForPattern ( $searchText )

removeAllQuotes() protected static method

Remove single and double quotes, including UTF-8 variations
protected static removeAllQuotes ( string $text ) : string
$text string
return string

removeDuplicatedSpaces() protected static method

Remove duplicated spaces
protected static removeDuplicatedSpaces ( string $text ) : string
$text string
return string

removeObject() public method

Removes object $contentObject from the search database.
Deprecation: 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
return boolean True if the operation succeed.

removeObjectById() public method

Removes a content object by Id from the search database.
Since: 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
return boolean True if the operation succeed.

saveCreatedTempTableName() public method

*! 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 method

public searchAttributeByIdentifier ( $searchParams )

searchAttributeByIdentifierRange() public method

public searchAttributeByIdentifierRange ( $searchParams )

searchAttributeByRange() public method

public searchAttributeByRange ( $searchParams )

searchAttributeFulltext() public method

public searchAttributeFulltext ( $searchParams )

searchAttributeInteger() public method

public searchAttributeInteger ( $searchParams )

searchAttributeIntegers() public method

public searchAttributeIntegers ( $searchParams )

searchAttributeIntegersByIdentifier() public method

public searchAttributeIntegersByIdentifier ( $searchParams )

searchAttributePatternText() public method

public searchAttributePatternText ( $searchParams )

splitString() public method

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

supportedSearchTypes() public method

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

updateObjectsSection() public method

Update the section in the search engine
See also: eZSearch::updateObjectsSection()
public updateObjectsSection ( array $objectIDs, integer $sectionID ) : void
$objectIDs array
$sectionID integer
return void

Property Details

$CreatedTempTablesNames public_oe property

public $CreatedTempTablesNames

$TempTablesCount public_oe property

public $TempTablesCount