Interface

eZ\Publish\SPI\Search\Handler

interface Handler

The Search handler retrieves sets of of Content objects, based on a set of criteria.

Methods

SearchResult findContent(Query $query, array $languageFilter = array())

Finds content objects for the given query.

ContentInfo findSingle(Criterion $filter, array $languageFilter = array())

Performs a query for a single content object.

SearchResult findLocations(LocationQuery $query, array $languageFilter = array())

Finds locations for the given $query.

suggest(string $prefix, string[] $fieldPaths = array(), int $limit = 10, Criterion $filter = null)

Suggests a list of values for the given prefix.

indexContent(Content $content)

Indexes a content object.

deleteContent(int $contentId, int|null $versionId = null)

Deletes a content object from the index.

indexLocation(Location $location)

Indexes a Location in the index storage.

deleteLocation(mixed $locationId, mixed $contentId)

Deletes a location from the index.

purgeIndex()

Purges all contents from the index.

Details

at line 36
public SearchResult findContent(Query $query, array $languageFilter = array())

Finds content objects for the given query.

Parameters

Query $query
array $languageFilter
  • 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 Value

SearchResult With ContentInfo as SearchHit->valueObject

Exceptions

InvalidArgumentException if Query criterion is not applicable to its target

at line 53
public ContentInfo findSingle(Criterion $filter, array $languageFilter = array())

Performs a query for a single content object.

Parameters

Criterion $filter
array $languageFilter
  • 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 Value

ContentInfo

Exceptions

NotFoundException if the object was not found by the query or due to permissions
InvalidArgumentException if Criterion is not applicable to its target
InvalidArgumentException if there is more than than one result matching the criterions

at line 66
public SearchResult findLocations(LocationQuery $query, array $languageFilter = array())

Finds locations for the given $query.

Parameters

LocationQuery $query
array $languageFilter
  • 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 Value

SearchResult With Location as SearchHit->valueObject

at line 76
public suggest(string $prefix, string[] $fieldPaths = array(), int $limit = 10, Criterion $filter = null)

Suggests a list of values for the given prefix.

Parameters

string $prefix
string[] $fieldPaths
int $limit
Criterion $filter

at line 83
public indexContent(Content $content)

Indexes a content object.

Parameters

Content $content

at line 91
public deleteContent(int $contentId, int|null $versionId = null)

Deletes a content object from the index.

Parameters

int $contentId
int|null $versionId

at line 98
public indexLocation(Location $location)

Indexes a Location in the index storage.

Parameters

Location $location

at line 106
public deleteLocation(mixed $locationId, mixed $contentId)

Deletes a location from the index.

Parameters

mixed $locationId
mixed $contentId

at line 111
public purgeIndex()

Purges all contents from the index.