Exponential 5.x Kernel 7.5.40 Exponential New Stack (Symfony-based) Kernel — PHP Class Reference

Loading.php
Go to the documentation of this file.
1 <?php
2
7 namespace eZ\Publish\Core\Search\Elasticsearch\Content\Extractor;
8
9 use eZ\Publish\Core\Search\Elasticsearch\Content\Extractor;
10 use eZ\Publish\SPI\Persistence\Content\Handler as ContentHandler;
11 use eZ\Publish\SPI\Persistence\Content\Location\Handler as LocationHandler;
12 use eZ\Publish\Core\Search\Elasticsearch\Content\FacetBuilderVisitor;
13 use RuntimeException;
14
19 class Loading extends Extractor
20 {
26 protected $contentHandler;
27
33 protected $locationHandler;
34
35 public function __construct(
36 ContentHandler $contentHandler,
37 LocationHandler $locationHandler,
38 FacetBuilderVisitor $facetBuilderVisitor
39 ) {
40 $this->contentHandler = $contentHandler;
41 $this->locationHandler = $locationHandler;
42
43 parent::__construct($facetBuilderVisitor);
44 }
45
53 public function extractHit($hit)
54 {
55 if ($hit->_type === 'content') {
56 return $this->contentHandler->loadContentInfo($hit->_id);
57 }
58
59 if ($hit->_type === 'location') {
60 return $this->locationHandler->load($hit->_id);
61 }
62
63 throw new RuntimeException(
64 "Could not extract: document of type '{$hit->_type}' is not handled."
65 );
66 }
67 }
eZ\Publish\Core\Search\Elasticsearch\Content\Extractor\Loading
The Loading Extractor extracts the value object from the Elasticsearch search hit data by loading it ...
Definition: Loading.php:20
eZ\Publish\Core\Search\Elasticsearch\Content\Extractor\Loading\$locationHandler
$locationHandler
Definition: Loading.php:33
eZ\Publish\Core\Search\Elasticsearch\Content\Extractor\Loading\extractHit
extractHit($hit)
Definition: Loading.php:53
eZ\Publish\Core\Search\Elasticsearch\Content\Extractor\Loading\$contentHandler
$contentHandler
Definition: Loading.php:26
eZ\Publish\Core\Search\Elasticsearch\Content\Extractor\Loading\__construct
__construct(ContentHandler $contentHandler, LocationHandler $locationHandler, FacetBuilderVisitor $facetBuilderVisitor)
Definition: Loading.php:35
eZ\Publish\Core\Search\Elasticsearch\Content\Extractor
Abstract implementation of Search Extractor, which extracts search result from the data returned by E...
Definition: Extractor.php:19
eZ\Publish\Core\Search\Elasticsearch\Content\Extractor\$facetBuilderVisitor
$facetBuilderVisitor
Definition: Extractor.php:25
eZ\Publish\Core\Search\Elasticsearch\Content\FacetBuilderVisitor
Visits the facet builder tree into a hash representation of Elasticsearch aggregations.
Definition: FacetBuilderVisitor.php:17
eZ\Publish\SPI\Persistence\Content\Handler
The Content Handler interface defines content operations on the storage engine.
Definition: SPI/Persistence/Content/Handler.php:20
eZ\Publish\SPI\Persistence\Content\Location\Handler
The Location Handler interface defines operations on Location elements in the storage engine.
Definition: SPI/Persistence/Content/Location/Handler.php:15
eZ\Publish\Core\Search\Elasticsearch\Content\Extractor
Definition: Loading.php:7
eZ\Publish\Core\Search\Elasticsearch\Content\FacetBuilderVisitor
Definition: Search/Elasticsearch/Content/FacetBuilderVisitor/Aggregate.php:7
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.