PHP Class eZ\Publish\Core\Search\Legacy\Content\WordIndexer\Gateway\DoctrineDatabase

Inheritance: extends eZ\Publish\Core\Search\Legacy\Content\WordIndexer\Gateway
Show file Open project: ezsystems/ezpublish-kernel

Protected Properties

Property Type Description
$dbHandler eZ\Publish\Core\Persistence\Database\DatabaseHandler Database handler.
$fullTextSearchConfiguration array Full text search configuration options.
$searchIndex eZ\Publish\Core\Search\Legacy\Content\WordIndexer\Repository\SearchIndex Need this for queries on ezsearch* tables
$transformationProcessor eZ\Publish\Core\Persistence\TransformationProcessor Need this for being able to transform text to searchable value
$typeHandler eZ\Publish\SPI\Persistence\Content\Type\Handler Need this for being able to pick fields that are searchable.

Public Methods

Method Description
__construct ( eZ\Publish\Core\Persistence\Database\DatabaseHandler $dbHandler, eZ\Publish\SPI\Persistence\Content\Type\Handler $typeHandler, TransformationProcessor $transformationProcessor, SearchIndex $searchIndex, array $fullTextSearchConfiguration ) Construct from handler handler.
bulkIndex ( array $fullTextBulkData ) Indexes an array of FullTextData objects.
index ( FullTextData $fullTextData ) Index search engine full text data corresponding to content object field values.
purgeIndex ( ) Remove entire search index.
remove ( mixed $contentId, mixed | null $versionId = null ) : boolean Remove whole content or a specific version from index.

Private Methods

Method Description
buildWordIDArray ( array $indexArrayOnlyWords ) : array Build WordIDArray and update ezsearch_word table.
indexWords ( FullTextData $fullTextData, array $indexArray, array $wordIDArray, integer $placement ) : integer Index wordIndex.

Method Details

__construct() public method

Construct from handler handler.
public __construct ( eZ\Publish\Core\Persistence\Database\DatabaseHandler $dbHandler, eZ\Publish\SPI\Persistence\Content\Type\Handler $typeHandler, TransformationProcessor $transformationProcessor, SearchIndex $searchIndex, array $fullTextSearchConfiguration )
$dbHandler eZ\Publish\Core\Persistence\Database\DatabaseHandler
$typeHandler eZ\Publish\SPI\Persistence\Content\Type\Handler
$transformationProcessor eZ\Publish\Core\Persistence\TransformationProcessor
$searchIndex eZ\Publish\Core\Search\Legacy\Content\WordIndexer\Repository\SearchIndex
$fullTextSearchConfiguration array

bulkIndex() public method

Note: on large amounts of data make sure to iterate with several calls to this function with a limited set of FullTextData objects. Amount you have memory for depends on server, size of FullTextData objects & PHP version.
public bulkIndex ( array $fullTextBulkData )
$fullTextBulkData array

index() public method

Ported from the legacy code
See also: https://github.com/ezsystems/ezpublish-legacy/blob/master/kernel/search/plugins/ezsearchengine/ezsearchengine.php#L45
public index ( FullTextData $fullTextData )
$fullTextData eZ\Publish\Core\Search\Legacy\Content\FullTextData

purgeIndex() public method

Remove entire search index.
public purgeIndex ( )

remove() public method

Ported from the legacy code
See also: https://github.com/ezsystems/ezpublish-legacy/blob/master/kernel/search/plugins/ezsearchengine/ezsearchengine.php#L386
public remove ( mixed $contentId, mixed | null $versionId = null ) : boolean
$contentId mixed
$versionId mixed | null
return boolean

Property Details

$dbHandler protected property

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

$fullTextSearchConfiguration protected property

Full text search configuration options.
protected array $fullTextSearchConfiguration
return array

$searchIndex protected property

Need this for queries on ezsearch* tables
protected SearchIndex,eZ\Publish\Core\Search\Legacy\Content\WordIndexer\Repository $searchIndex
return eZ\Publish\Core\Search\Legacy\Content\WordIndexer\Repository\SearchIndex

$transformationProcessor protected property

Need this for being able to transform text to searchable value
protected TransformationProcessor,eZ\Publish\Core\Persistence $transformationProcessor
return eZ\Publish\Core\Persistence\TransformationProcessor

$typeHandler protected property

Need this for being able to pick fields that are searchable.
protected Handler,eZ\Publish\SPI\Persistence\Content\Type $typeHandler
return eZ\Publish\SPI\Persistence\Content\Type\Handler