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

Core/Search/Elasticsearch/Content/CriterionVisitor/CustomField.php
Go to the documentation of this file.
1 <?php
2
7 namespace eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitor;
8
9 use eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitorDispatcher as Dispatcher;
10 use eZ\Publish\API\Repository\Values\Content\Query\Criterion;
11
15 abstract class CustomField extends FieldFilterBase
16 {
24 abstract protected function getCondition(Criterion $criterion);
25
37 public function visitQuery(Criterion $criterion, Dispatcher $dispatcher, array $languageFilter)
38 {
39 $query = [
40 'bool' => [
41 'should' => $this->getCondition($criterion),
42 'minimum_should_match' => 1,
43 ],
44 ];
45
46 $fieldFilter = $this->getFieldFilter($languageFilter);
47
48 if ($fieldFilter === null) {
49 $query = [
50 'nested' => [
51 'path' => 'fields_doc',
52 'query' => $query,
53 ],
54 ];
55 } else {
56 $query = [
57 'nested' => [
58 'path' => 'fields_doc',
59 'query' => [
60 'filtered' => [
61 'query' => $query,
62 'filter' => $fieldFilter,
63 ],
64 ],
65 ],
66 ];
67 }
68
69 return $query;
70 }
71 }
eZ\Publish\API\Repository\Values\Content\Query\Criterion\CustomField
The Field Criterion class.
Definition: API/Repository/Values/Content/Query/Criterion/CustomField.php:18
eZ\Publish\API\Repository\Values\Content\Query\Criterion
Definition: API/Repository/Values/Content/Query/Criterion.php:15
eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitorDispatcher
Dispatches Criterion objects to a visitor depending on the query context.
Definition: CriterionVisitorDispatcher.php:19
eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitor\CustomField\visitQuery
visitQuery(Criterion $criterion, Dispatcher $dispatcher, array $languageFilter)
Map field value to a proper Elasticsearch query representation.
Definition: Core/Search/Elasticsearch/Content/CriterionVisitor/CustomField.php:37
eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitor\CustomField\getCondition
getCondition(Criterion $criterion)
Returns nested condition common for filter and query contexts.
eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitor\FieldFilterBase
Abstract criterion visitor implementation, providing field filters condition for criteria that requir...
Definition: FieldFilterBase.php:16
eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitor\FieldFilterBase\getFieldFilter
getFieldFilter(array $languageFilter)
Returns filter condition for the given $languageFilter.
Definition: FieldFilterBase.php:27
eZ\Publish\API\Repository\Values\Content\Query\Criterion
Definition: API/Repository/Values/Content/Query/Criterion/Ancestor.php:7
eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitor
Definition: CriterionVisitor/ContentIdIn.php:7
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.