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

Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
eZ\Publish\Core\Repository\SearchService Class Reference

Search service. More...

Inheritance diagram for eZ\Publish\Core\Repository\SearchService:

## Public Member Functions
| __construct (RepositoryInterface $repository, Handler $searchHandler, Helper\DomainMapper $domainMapper, PermissionCriterionResolver $permissionCriterionResolver, BackgroundIndexer $backgroundIndexer, array $settings=[])
| Setups service with reference to repository object that created it & corresponding handler. More...
| findContent (Query $query, array $languageFilter=[], $filterOnUserPermissions=true)
| Finds content objects for the given query. More...
| findContentInfo (Query $query, array $languageFilter=[], $filterOnUserPermissions=true)
| Finds contentInfo objects for the given query. More...
| findSingle (Criterion $filter, array $languageFilter=[], $filterOnUserPermissions=true)
| Performs a query for a single content object. More...
| suggest ($prefix, $fieldPaths=[], $limit=10, Criterion $filter=null)
| Suggests a list of values for the given prefix. More...
| findLocations (LocationQuery $query, array $languageFilter=[], $filterOnUserPermissions=true)
| Finds Locations for the given query. More...
| supports ($capabilityFlag)
| Query for supported capability of currently configured search engine. More...

## Protected Member Functions
| internalFindContentInfo (Query $query, array $languageFilter=[], $filterOnUserPermissions=true)
| Finds SPI content info objects for the given query. More...
| validateContentCriteria (array $criteria, $argumentName)
| Checks that $criteria does not contain Location criterions. More...
| validateContentSortClauses (Query $query)
| Checks that $query does not contain Location sort clauses. More...
| addPermissionsCriterion (Criterion &$criterion)
| Adds content, read Permission criteria if needed and return false if no access at all. More...

## Protected Attributes
| $repository
| $searchHandler
| $settings
| $domainMapper
| $permissionCriterionResolver
| $backgroundIndexer

## Additional Inherited Members
Public Attributes inherited from eZ\Publish\API\Repository\SearchService
const | CAPABILITY_SCORING = 1
| Capability flag for scoring feature for use with {. More...
const | CAPABILITY_FACETS = 2
| Capability flag for facets feature for use with {. More...
const | CAPABILITY_CUSTOM_FIELDS = 4
| Capability flag for custom fields feature for use with {. More...
const | CAPABILITY_SPELLCHECK = 8
| Capability flag for spellcheck feature for use with {. More...
const | CAPABILITY_HIGHLIGHT = 16
| Capability flag for highlight feature for use with {. More...
const | CAPABILITY_SUGGEST = 32
| Capability flag for suggest feature for use with {. More...
const | CAPABILITY_ADVANCED_FULLTEXT = 64
| Capability flag for advanced fulltext feature for use with {. More...

## Detailed Description

Search service.

Definition at line 30 of file Core/Repository/SearchService.php.

## Constructor & Destructor Documentation

## ◆ __construct()

eZ\Publish\Core\Repository\SearchService::__construct | ( | RepositoryInterface | $repository,
|  | Handler | $searchHandler,
|  | Helper\DomainMapper | $domainMapper,
|  | PermissionCriterionResolver | $permissionCriterionResolver,
|  | BackgroundIndexer | $backgroundIndexer,
|  | array | $settings = `[]`
| ) |  |

Setups service with reference to repository object that created it & corresponding handler.

Parameters

  \eZ\Publish\API\Repository\Repository | $repository |
  \eZ\Publish\SPI\Search\Handler | $searchHandler |
  \eZ\Publish\Core\Repository\Helper\DomainMapper | $domainMapper |
  \eZ\Publish\API\Repository\PermissionCriterionResolver | $permissionCriterionResolver |
  \eZ\Publish\Core\Search\Common\BackgroundIndexer | $backgroundIndexer |
  array | $settings |

Definition at line 60 of file Core/Repository/SearchService.php.

References eZ\Publish\Core\Repository\SearchService\$backgroundIndexer, eZ\Publish\Core\Repository\SearchService\$domainMapper, eZ\Publish\Core\Repository\SearchService\$permissionCriterionResolver, eZ\Publish\Core\Repository\SearchService\$repository, eZ\Publish\Core\Repository\SearchService\$searchHandler, and eZ\Publish\Core\Repository\SearchService\$settings.

## Member Function Documentation

## ◆ addPermissionsCriterion()

eZ\Publish\Core\Repository\SearchService::addPermissionsCriterion | ( | Criterion & | $criterion | ) |
| protected

Adds content, read Permission criteria if needed and return false if no access at all.

@uses \eZ\Publish\API\Repository\PermissionCriterionResolver::getPermissionsCriterion()

Parameters

  \eZ\Publish\API\Repository\Values\Content\Query\Criterion | $criterion |

Returns
  bool|\eZ\Publish\API\Repository\Values\Content\Query\Criterion

Definition at line 320 of file Core/Repository/SearchService.php.

Referenced by eZ\Publish\Core\Repository\SearchService\findLocations(), eZ\Publish\Core\Repository\SearchService\findSingle(), and eZ\Publish\Core\Repository\SearchService\internalFindContentInfo().

## ◆ findContent()

eZ\Publish\Core\Repository\SearchService::findContent | ( | Query | $query,
|  | array | $languageFilter = `[]`,
|  |  | $filterOnUserPermissions = `true`
| ) |  |

Finds content objects for the given query.

Exceptions

Implements eZ\Publish\API\Repository\SearchService.

Definition at line 92 of file Core/Repository/SearchService.php.

References eZ\Publish\Core\Repository\SearchService\internalFindContentInfo().

## ◆ findContentInfo()

eZ\Publish\Core\Repository\SearchService::findContentInfo | ( | Query | $query,
|  | array | $languageFilter = `[]`,
|  |  | $filterOnUserPermissions = `true`
| ) |  |

Finds contentInfo objects for the given query.

See also
  SearchServiceInterface::findContentInfo()

Since
  5.4.5

Exceptions

Implements eZ\Publish\API\Repository\SearchService.

Definition at line 119 of file Core/Repository/SearchService.php.

References eZ\Publish\Core\Repository\SearchService\internalFindContentInfo().

## ◆ findLocations()

eZ\Publish\Core\Repository\SearchService::findLocations | ( | LocationQuery | $query,
|  | array | $languageFilter = `[]`,
|  |  | $filterOnUserPermissions = `true`
| ) |  |

Finds Locations for the given query.

Exceptions

Implements eZ\Publish\API\Repository\SearchService.

Definition at line 276 of file Core/Repository/SearchService.php.

References eZ\Publish\Core\Repository\SearchService\addPermissionsCriterion().

## ◆ findSingle()

eZ\Publish\Core\Repository\SearchService::findSingle | ( | Criterion | $filter,
|  | array | $languageFilter = `[]`,
|  |  | $filterOnUserPermissions = `true`
| ) |  |

Performs a query for a single content object.

Exceptions

Implements eZ\Publish\API\Repository\SearchService.

Definition at line 232 of file Core/Repository/SearchService.php.

References eZ\Publish\Core\Repository\SearchService\addPermissionsCriterion(), and eZ\Publish\Core\Repository\SearchService\validateContentCriteria().

## ◆ internalFindContentInfo()

eZ\Publish\Core\Repository\SearchService::internalFindContentInfo | ( | Query | $query,
|  | array | $languageFilter = `[]`,
|  |  | $filterOnUserPermissions = `true`
| ) |  |
| protected

Finds SPI content info objects for the given query.

Internal for use by findContent and findContentInfo.

Exceptions

Definition at line 146 of file Core/Repository/SearchService.php.

References eZ\Publish\Core\Repository\SearchService\addPermissionsCriterion(), eZ\Publish\Core\Repository\SearchService\validateContentCriteria(), and eZ\Publish\Core\Repository\SearchService\validateContentSortClauses().

Referenced by eZ\Publish\Core\Repository\SearchService\findContent(), and eZ\Publish\Core\Repository\SearchService\findContentInfo().

## ◆ suggest()

eZ\Publish\Core\Repository\SearchService::suggest | ( |  | $prefix,
|  |  | $fieldPaths = `[]`,
|  |  | $limit = `10`,
|  | Criterion | $filter = `null`
| ) |  |

Suggests a list of values for the given prefix.

Parameters

  string | $prefix |
  string[] | $fieldPaths |
  int | $limit |
  \eZ\Publish\API\Repository\Values\Content\Query\Criterion | $filter |

Implements eZ\Publish\API\Repository\SearchService.

Definition at line 259 of file Core/Repository/SearchService.php.

## ◆ supports()

eZ\Publish\Core\Repository\SearchService::supports | ( |  | $capabilityFlag | ) |

Query for supported capability of currently configured search engine.

Will return false if search engine does not implement {

See also
  eZ\Publish\SPI\Search\Capable}.

Since
  6.12

Parameters

  int | $capabilityFlag | One of CAPABILITY_* constants.

Returns
  bool

Implements eZ\Publish\API\Repository\SearchService.

Definition at line 342 of file Core/Repository/SearchService.php.

## ◆ validateContentCriteria()

eZ\Publish\Core\Repository\SearchService::validateContentCriteria | ( | array | $criteria,
|  |  | $argumentName
| ) |  |
| protected

Checks that $criteria does not contain Location criterions.

Exceptions

Definition at line 186 of file Core/Repository/SearchService.php.

Referenced by eZ\Publish\Core\Repository\SearchService\findSingle(), and eZ\Publish\Core\Repository\SearchService\internalFindContentInfo().

## ◆ validateContentSortClauses()

eZ\Publish\Core\Repository\SearchService::validateContentSortClauses | ( | Query | $query | ) |
| protected

Checks that $query does not contain Location sort clauses.

Exceptions

Definition at line 208 of file Core/Repository/SearchService.php.

Referenced by eZ\Publish\Core\Repository\SearchService\internalFindContentInfo().

## Member Data Documentation

## ◆ $backgroundIndexer

eZ\Publish\Core\Repository\SearchService::$backgroundIndexer
| protected

Definition at line 48 of file Core/Repository/SearchService.php.

Referenced by eZ\Publish\Core\Repository\SearchService\__construct().

## ◆ $domainMapper

eZ\Publish\Core\Repository\SearchService::$domainMapper
| protected

Definition at line 42 of file Core/Repository/SearchService.php.

Referenced by eZ\Publish\Core\Repository\SearchService\__construct().

## ◆ $permissionCriterionResolver

eZ\Publish\Core\Repository\SearchService::$permissionCriterionResolver
| protected

Definition at line 45 of file Core/Repository/SearchService.php.

Referenced by eZ\Publish\Core\Repository\SearchService\__construct().

## ◆ $repository

eZ\Publish\Core\Repository\SearchService::$repository
| protected

Definition at line 33 of file Core/Repository/SearchService.php.

Referenced by eZ\Publish\Core\Repository\SearchService\__construct().

## ◆ $searchHandler

eZ\Publish\Core\Repository\SearchService::$searchHandler
| protected

Definition at line 36 of file Core/Repository/SearchService.php.

Referenced by eZ\Publish\Core\Repository\SearchService\__construct().

## ◆ $settings

eZ\Publish\Core\Repository\SearchService::$settings
| protected

Definition at line 39 of file Core/Repository/SearchService.php.

Referenced by eZ\Publish\Core\Repository\SearchService\__construct().

The documentation for this class was generated from the following file:

- Core/Repository/SearchService.php

Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.