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

Inheritance: implements eZ\Publish\SPI\Search\Content\Handler
Show file Open project: ezsystems/ezpublish-kernel Class Usage Examples

Protected Properties

Property Type Description
$contentDocumentTypeIdentifier string Identifier of Content document type in the search backend.
$extractor Extractor Search result extractor.
$gateway Gateway
$locationDocumentTypeIdentifier string Identifier of Location document type in the search backend.
$locationGateway Gateway
$mapper eZ\Publish\Core\Search\Elasticsearch\Content\MapperInterface

Public Methods

Method Description
__construct ( Gateway $gateway, Gateway $locationGateway, eZ\Publish\Core\Search\Elasticsearch\Content\MapperInterface $mapper, Extractor $extractor, $contentDocumentTypeIdentifier, $locationDocumentTypeIdentifier )
bulkIndexContent ( array $contentObjects ) Indexes several content objects.
bulkIndexLocations ( array $locations ) Indexes several Locations.
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 = [] ) : eZ\Publish\API\Repository\Values\Content\Search\SearchResult Finds Locations for the given $query.
findSingle ( eZ\Publish\API\Repository\Values\Content\Query\Criterion $filter, array $languageFilter = [] ) : eZ\Publish\SPI\Persistence\Content Performs a query for a single content object.
flush ( )
indexContent ( eZ\Publish\SPI\Persistence\Content $content ) Indexes a content object.
indexLocation ( eZ\Publish\SPI\Persistence\Content\Location $location ) Indexes a Location in the index storage.
purgeIndex ( ) Purges all contents from the index.
setCommit ( boolean $commit ) Set if index/delete actions should commit or if several actions is to be expected.
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.

Method Details

__construct() public method

public __construct ( Gateway $gateway, Gateway $locationGateway, eZ\Publish\Core\Search\Elasticsearch\Content\MapperInterface $mapper, Extractor $extractor, $contentDocumentTypeIdentifier, $locationDocumentTypeIdentifier )
$gateway Gateway
$locationGateway Gateway
$mapper eZ\Publish\Core\Search\Elasticsearch\Content\MapperInterface
$extractor Extractor

bulkIndexContent() public method

Indexes several content objects.
public bulkIndexContent ( array $contentObjects )
$contentObjects array

bulkIndexLocations() public method

Indexes several Locations.
public bulkIndexLocations ( array $locations )
$locations array

deleteContent() public method

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

deleteLocation() public method

Deletes a location from the index.
public deleteLocation ( mixed $locationId, mixed $contentId )
$locationId mixed
$contentId mixed @todo Make use of this, or remove if not needed.

findContent() public method

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
return eZ\Publish\API\Repository\Values\Content\Search\SearchResult

findLocations() public method

Finds Locations for the given $query.
public findLocations ( eZ\Publish\API\Repository\Values\Content\LocationQuery $query, array $languageFilter = [] ) : eZ\Publish\API\Repository\Values\Content\Search\SearchResult
$query eZ\Publish\API\Repository\Values\Content\LocationQuery
$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
return eZ\Publish\API\Repository\Values\Content\Search\SearchResult

findSingle() public method

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
$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
return eZ\Publish\SPI\Persistence\Content

flush() public method

public flush ( )

indexContent() public method

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

indexLocation() public method

Indexes a Location in the index storage.
public indexLocation ( eZ\Publish\SPI\Persistence\Content\Location $location )
$location eZ\Publish\SPI\Persistence\Content\Location

purgeIndex() public method

Purges all contents from the index.
public purgeIndex ( )

setCommit() public method

This should be set to false before group of actions and true before the last one
public setCommit ( boolean $commit )
$commit boolean

suggest() public method

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

$contentDocumentTypeIdentifier protected property

Identifier of Content document type in the search backend.
protected string $contentDocumentTypeIdentifier
return string

$extractor protected property

Search result extractor.
protected Extractor,eZ\Publish\Core\Search\Elasticsearch\Content $extractor
return Extractor

$gateway protected property

protected Gateway,eZ\Publish\Core\Search\Elasticsearch\Content $gateway
return Gateway

$locationDocumentTypeIdentifier protected property

Identifier of Location document type in the search backend.
protected string $locationDocumentTypeIdentifier
return string

$locationGateway protected property

protected Gateway,eZ\Publish\Core\Search\Elasticsearch\Content $locationGateway
return Gateway

$mapper protected property

protected MapperInterface,eZ\Publish\Core\Search\Elasticsearch\Content $mapper
return eZ\Publish\Core\Search\Elasticsearch\Content\MapperInterface