PHP Class eZ\Publish\Core\Search\Legacy\Content\Handler

The basic idea of this class is to do the following: 1) The find methods retrieve a recursive set of filters, which define which content objects to retrieve from the database. Those may be combined using boolean operators. 2) This recursive criterion definition is visited into a query, which limits the content retrieved from the database. We might not be able to create sensible queries from all criterion definitions. 3) The query might be possible to optimize (remove empty statements), reduce singular and and or constructs… 4) Additionally we might need a post-query filtering step, which filters content objects based on criteria, which could not be converted in to database statements.
Inheritance: implements eZ\Publish\SPI\Search\Handler
Afficher le fichier Open project: ezsystems/ezpublish-kernel Class Usage Examples

Protected Properties

Свойство Type Description
$contentMapper eZ\Publish\Core\Persistence\Legacy\Content\Mapper Content mapper.
$gateway Gateway Content locator gateway.
$indexerGateway eZ\Publish\Core\Search\Legacy\Content\WordIndexer\Gateway Word indexer gateway.
$languageHandler eZ\Publish\SPI\Persistence\Content\Language\Handler Language handler.
$locationGateway eZ\Publish\Core\Search\Legacy\Content\Location\Gateway Location locator gateway.
$locationMapper eZ\Publish\Core\Persistence\Legacy\Content\Location\Mapper Location locationMapper.
$mapper eZ\Publish\Core\Search\Legacy\Content\Mapper\FullTextMapper FullText mapper.

Méthodes publiques

Méthode Description
__construct ( Gateway $gateway, Gateway $locationGateway, Gateway $indexerGateway, Mapper $contentMapper, Mapper $locationMapper, eZ\Publish\SPI\Persistence\Content\Language\Handler $languageHandler, FullTextMapper $mapper ) Creates a new content handler.
bulkIndex ( array $contentList, callable $errorCallback ) Bulk index list of content objects.
commit ( boolean $flush = false ) Commits the data to the index, making it available for search.
deleteContent ( integer $contentId, integer | null $versionId = null ) Deletes a content object from the index.
deleteLocation ( mixed $locationId, mixed $contentId ) Deletes a location from the index.
findContent ( eZ\Publish\API\Repository\Values\Content\Query $query, array $languageFilter = [] ) : eZ\Publish\API\Repository\Values\Content\Search\SearchResult Finds content objects for the given query.
findLocations ( eZ\Publish\API\Repository\Values\Content\LocationQuery $query, array $languageFilter = [] )
findSingle ( eZ\Publish\API\Repository\Values\Content\Query\Criterion $filter, array $languageFilter = [] ) : eZ\Publish\SPI\Persistence\Content\ContentInfo Performs a query for a single content object.
indexContent ( eZ\Publish\SPI\Persistence\Content $content ) Indexes a content object.
indexLocation ( eZ\Publish\SPI\Persistence\Content\Location $location )
purgeIndex ( ) Purges all contents from the index.
suggest ( string $prefix, string[] $fieldPaths = [], integer $limit = 10, eZ\Publish\API\Repository\Values\Content\Query\Criterion $filter = null ) Suggests a list of values for the given prefix.

Méthodes protégées

Méthode Description
extractMatchedLanguage ( $languageMask, $mainLanguageId, $languageSettings )

Method Details

__construct() public méthode

Creates a new content handler.
public __construct ( Gateway $gateway, Gateway $locationGateway, Gateway $indexerGateway, Mapper $contentMapper, Mapper $locationMapper, eZ\Publish\SPI\Persistence\Content\Language\Handler $languageHandler, FullTextMapper $mapper )
$gateway Gateway
$locationGateway eZ\Publish\Core\Search\Legacy\Content\Location\Gateway
$indexerGateway eZ\Publish\Core\Search\Legacy\Content\WordIndexer\Gateway
$contentMapper eZ\Publish\Core\Persistence\Legacy\Content\Mapper
$locationMapper eZ\Publish\Core\Persistence\Legacy\Content\Location\Mapper
$languageHandler eZ\Publish\SPI\Persistence\Content\Language\Handler
$mapper eZ\Publish\Core\Search\Legacy\Content\Mapper\FullTextMapper

bulkIndex() public méthode

Bulk index list of content objects.
public bulkIndex ( array $contentList, callable $errorCallback )
$contentList array
$errorCallback callable (Content $content, NotFoundException $e)

commit() public méthode

Commits the data to the index, making it available for search.
public commit ( boolean $flush = false )
$flush boolean

deleteContent() public méthode

Deletes a content object from the index.
public deleteContent ( integer $contentId, integer | null $versionId = null )
$contentId integer
$versionId integer | null

deleteLocation() public méthode

Deletes a location from the index.
public deleteLocation ( mixed $locationId, mixed $contentId )
$locationId mixed
$contentId mixed

extractMatchedLanguage() protected méthode

protected extractMatchedLanguage ( $languageMask, $mainLanguageId, $languageSettings )

findContent() public méthode

Finds content objects for the given query.
public findContent ( eZ\Publish\API\Repository\Values\Content\Query $query, array $languageFilter = [] ) : eZ\Publish\API\Repository\Values\Content\Search\SearchResult
$query eZ\Publish\API\Repository\Values\Content\Query
$languageFilter array - a map of language related filters specifying languages query will be performed on. Also used to define which field languages are loaded for the returned content. Currently supports: array("languages" => array(,..), "useAlwaysAvailable" => bool) useAlwaysAvailable defaults to true to avoid exceptions on missing translations
Résultat eZ\Publish\API\Repository\Values\Content\Search\SearchResult

findLocations() public méthode

See also: eZ\Publish\SPI\Search\Handler::findLocations
public findLocations ( eZ\Publish\API\Repository\Values\Content\LocationQuery $query, array $languageFilter = [] )
$query eZ\Publish\API\Repository\Values\Content\LocationQuery
$languageFilter array

findSingle() public méthode

Performs a query for a single content object.
public findSingle ( eZ\Publish\API\Repository\Values\Content\Query\Criterion $filter, array $languageFilter = [] ) : eZ\Publish\SPI\Persistence\Content\ContentInfo
$filter eZ\Publish\API\Repository\Values\Content\Query\Criterion
$languageFilter array - a map of language related filters specifying languages query will be performed on. Also used to define which field languages are loaded for the returned content. Currently supports: array("languages" => array(,..), "useAlwaysAvailable" => bool) useAlwaysAvailable defaults to true to avoid exceptions on missing translations
Résultat eZ\Publish\SPI\Persistence\Content\ContentInfo

indexContent() public méthode

Indexes a content object.
public indexContent ( eZ\Publish\SPI\Persistence\Content $content )
$content eZ\Publish\SPI\Persistence\Content

indexLocation() public méthode

public indexLocation ( eZ\Publish\SPI\Persistence\Content\Location $location )
$location eZ\Publish\SPI\Persistence\Content\Location

purgeIndex() public méthode

Purges all contents from the index.
public purgeIndex ( )

suggest() public méthode

Suggests a list of values for the given prefix.
public suggest ( string $prefix, string[] $fieldPaths = [], integer $limit = 10, eZ\Publish\API\Repository\Values\Content\Query\Criterion $filter = null )
$prefix string
$fieldPaths string[]
$limit integer
$filter eZ\Publish\API\Repository\Values\Content\Query\Criterion

Property Details

$contentMapper protected_oe property

Content mapper.
protected Mapper,eZ\Publish\Core\Persistence\Legacy\Content $contentMapper
Résultat eZ\Publish\Core\Persistence\Legacy\Content\Mapper

$gateway protected_oe property

Content locator gateway.
protected Gateway,eZ\Publish\Core\Search\Legacy\Content $gateway
Résultat Gateway

$indexerGateway protected_oe property

Word indexer gateway.
protected Gateway,eZ\Publish\Core\Search\Legacy\Content\WordIndexer $indexerGateway
Résultat eZ\Publish\Core\Search\Legacy\Content\WordIndexer\Gateway

$languageHandler protected_oe property

Language handler.
protected Handler,eZ\Publish\SPI\Persistence\Content\Language $languageHandler
Résultat eZ\Publish\SPI\Persistence\Content\Language\Handler

$locationGateway protected_oe property

Location locator gateway.
protected Gateway,eZ\Publish\Core\Search\Legacy\Content\Location $locationGateway
Résultat eZ\Publish\Core\Search\Legacy\Content\Location\Gateway

$locationMapper protected_oe property

Location locationMapper.
protected Mapper,eZ\Publish\Core\Persistence\Legacy\Content\Location $locationMapper
Résultat eZ\Publish\Core\Persistence\Legacy\Content\Location\Mapper

$mapper protected_oe property

FullText mapper.
protected FullTextMapper,eZ\Publish\Core\Search\Legacy\Content\Mapper $mapper
Résultat eZ\Publish\Core\Search\Legacy\Content\Mapper\FullTextMapper