PHP Class eZ\Publish\Core\Search\Legacy\Content\WordIndexer\Repository\SearchIndex

Show file Open project: ezsystems/ezpublish-kernel Class Usage Examples

Protected Properties

Property Type Description
$dbHandler eZ\Publish\Core\Persistence\Database\DatabaseHandler Database handler.

Public Methods

Method Description
__construct ( eZ\Publish\Core\Persistence\Database\DatabaseHandler $dbHandler ) SearchIndex constructor.
addObjectWordLink ( $wordId, $contentId, $frequency, $placement, $nextWordId, $prevWordId, $contentTypeId, $fieldTypeId, $published, $sectionId, $identifier, $integerValue ) Link word with specific content object (legacy db table: ezsearch_object_word_link).
addWords ( array $words ) Insert new words (legacy db table: ezsearch_word).
decrementWordObjectCount ( array $wordId ) Decrease the object count of the given words by one.
deleteObjectWordsLink ( $contentId ) Delete relation between a word and a content object.
deleteWordsWithoutObjects ( ) Delete words not related to any content object.
getContentObjectWords ( $contentId ) : array Get all words related to the content object (legacy db table: ezsearch_object_word_link).
getWords ( array $words ) : array Fetch already indexed words from database (legacy db table: ezsearch_word).
incrementWordObjectCount ( array $wordId ) Increase the object count of the given words by one.
purge ( ) Remove entire search index.

Private Methods

Method Description
setContentObjectWordsSelectQuery ( eZ\Publish\Core\Persistence\Database\SelectQuery $query ) Set query selecting word ids for content object (method was extracted to be reusable).
updateWordObjectCount ( array $wordId, array $columns ) Update object count for words (legacy db table: ezsearch_word).

Method Details

__construct() public method

SearchIndex constructor.
public __construct ( eZ\Publish\Core\Persistence\Database\DatabaseHandler $dbHandler )
$dbHandler eZ\Publish\Core\Persistence\Database\DatabaseHandler

addWords() public method

Insert new words (legacy db table: ezsearch_word).
public addWords ( array $words )
$words array

decrementWordObjectCount() public method

Decrease the object count of the given words by one.
public decrementWordObjectCount ( array $wordId )
$wordId array

deleteWordsWithoutObjects() public method

Delete words not related to any content object.

getContentObjectWords() public method

Get all words related to the content object (legacy db table: ezsearch_object_word_link).
public getContentObjectWords ( $contentId ) : array
$contentId
return array

getWords() public method

Fetch already indexed words from database (legacy db table: ezsearch_word).
public getWords ( array $words ) : array
$words array
return array

incrementWordObjectCount() public method

Increase the object count of the given words by one.
public incrementWordObjectCount ( array $wordId )
$wordId array

purge() public method

Remove entire search index.
public purge ( )

Property Details

$dbHandler protected property

Database handler.
protected DatabaseHandler,eZ\Publish\Core\Persistence\Database $dbHandler
return eZ\Publish\Core\Persistence\Database\DatabaseHandler