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

Public Member Functions | Public Attributes | List of all members
eZ\Publish\API\Repository\SearchService Interface Reference

Search service. More...

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

## Public Member Functions
| 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...

## Public Attributes
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 16 of file API/Repository/SearchService.php.

## Member Function Documentation

## ◆ findContent()

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

Finds content objects for the given query.

Exceptions

Implemented in eZ\Publish\Core\SignalSlot\SearchService, eZ\Publish\Core\Repository\SiteAccessAware\SearchService, and eZ\Publish\Core\Repository\SearchService.

## ◆ findContentInfo()

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

Finds contentInfo objects for the given query.

This method works just like findContent, however does not load the full Content Objects. This means it can be more efficient for use cases where you don't need the full Content. Also including use cases where content will be loaded by separate code, like an ESI based sub requests that takes content ID as input.

Since
  5.4.5

Exceptions

Implemented in eZ\Publish\Core\SignalSlot\SearchService, eZ\Publish\Core\Repository\SiteAccessAware\SearchService, and eZ\Publish\Core\Repository\SearchService.

## ◆ findLocations()

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

Finds Locations for the given query.

Exceptions

Implemented in eZ\Publish\Core\SignalSlot\SearchService, eZ\Publish\Core\Repository\SiteAccessAware\SearchService, and eZ\Publish\Core\Repository\SearchService.

## ◆ findSingle()

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

Performs a query for a single content object.

Exceptions

Implemented in eZ\Publish\Core\SignalSlot\SearchService, eZ\Publish\Core\Repository\SiteAccessAware\SearchService, and eZ\Publish\Core\Repository\SearchService.

## ◆ suggest()

eZ\Publish\API\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 |

Implemented in eZ\Publish\Core\SignalSlot\SearchService, eZ\Publish\Core\Repository\SiteAccessAware\SearchService, and eZ\Publish\Core\Repository\SearchService.

## ◆ supports()

eZ\Publish\API\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

Implemented in eZ\Publish\Core\SignalSlot\SearchService, eZ\Publish\Core\Repository\SiteAccessAware\SearchService, and eZ\Publish\Core\Repository\SearchService.

## Member Data Documentation

## ◆ CAPABILITY_ADVANCED_FULLTEXT

const eZ\Publish\API\Repository\SearchService::CAPABILITY_ADVANCED_FULLTEXT = 64

Capability flag for advanced fulltext feature for use with {.

See also
  ::supports()}.

Advance full text is a feature making to possible by current engine to parse advance full text expressions.

Since
  6.12 (constant added in 6.7.6 and up)

See also
  \eZ\Publish\API\Repository\Values\Content\Query\Criterion\FullText

Definition at line 104 of file API/Repository/SearchService.php.

## ◆ CAPABILITY_CUSTOM_FIELDS

const eZ\Publish\API\Repository\SearchService::CAPABILITY_CUSTOM_FIELDS = 4

Capability flag for custom fields feature for use with {.

See also
  ::supports()}.

Custom fields is the capability for search engines to 1. allow you to extend the search index via plugins to generate custom fields, like a different representation (format, ...) of an existing field or similar. And 2. allow you on some search criteria to specify this custom field to rather query on that instead of the default field generated by the system.

Since
  6.12 (constant added in 6.7.6 and up)

Definition at line 53 of file API/Repository/SearchService.php.

## ◆ CAPABILITY_FACETS

const eZ\Publish\API\Repository\SearchService::CAPABILITY_FACETS = 2

Capability flag for facets feature for use with {.

See also
  ::supports()}.

Faceted search: https://en.wikipedia.org/wiki/Faceted_search

Note: Even if search engine tells you this is supported, beware:

- It might not support all facets, by design it will only return facets for facet builders the search engine supports.
- Some of the faceting features are still work in progress in API and won't be further matured before in 7 .x releases

Since
  6.12 (constant added in 6.7.6 and up)

Definition at line 41 of file API/Repository/SearchService.php.

## ◆ CAPABILITY_HIGHLIGHT

const eZ\Publish\API\Repository\SearchService::CAPABILITY_HIGHLIGHT = 16

Capability flag for highlight feature for use with {.

See also
  ::supports()}.

Highlight in search refers to extracting relevant text from the search index that matches the search result, typically returning a chunk of text of a predefined size with matching text highlighted.

WARNING: This feature is considered experimental given it is not completely designed yet in terms of how it should interact with hits within rich content of either eZ or custom field types. it is also unclear how it should hint what part of the highlight is matched.

Maybe it should rather give just matched text and hint of which field (several: one with best score) was matched and leave it to field type to render result with that info taking into account. But for now it is designed as simple string field, so should be string with for instance `<mark>` around matched text.

Since
  6.12 (constant added in 6.7.6 and up)

Definition at line 84 of file API/Repository/SearchService.php.

## ◆ CAPABILITY_SCORING

const eZ\Publish\API\Repository\SearchService::CAPABILITY_SCORING = 1

Capability flag for scoring feature for use with {.

See also
  ::supports()}.

Scoring, a search feature telling you how well one search hit scores compared to other items in the search result. When this is supported you can expect search engine to populate SearchHit->score and SearchResult->maxScore properties as well as sort by this if no sort clauses are specified.

Since
  6.12 (constant added in 6.7.6 and up)

Definition at line 27 of file API/Repository/SearchService.php.

## ◆ CAPABILITY_SPELLCHECK

const eZ\Publish\API\Repository\SearchService::CAPABILITY_SPELLCHECK = 8

Capability flag for spellcheck feature for use with {.

See also
  ::supports()}.

Spell check within search capabilities refers to ability to suggest better wordings in fulltext search string.

WARNING: This feature is considered experimental given it is not completely designed yet in terms of how it should interact with FullText criterion (singular) which is the most relevant here. Also given how FullText can be part of a more complex criteria it might imply a need to more strictly define where users are supposed to place FullText vs other criteria.

Since
  6.12 (constant added in 6.7.6 and up)

Definition at line 66 of file API/Repository/SearchService.php.

## ◆ CAPABILITY_SUGGEST

const eZ\Publish\API\Repository\SearchService::CAPABILITY_SUGGEST = 32

Capability flag for suggest feature for use with {.

See also
  ::supports()}.

WARNING: This feature is considered experimental given it is not completely clear what it is supposed to do. Feature might be deprecated in the future.

Since
  6.12 (constant added in 6.7.6 and up)

Definition at line 94 of file API/Repository/SearchService.php.

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

- API/Repository/SearchService.php

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