Copied!

Handler

Handler.php : 19

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

Methods

publicdeleteContent()

Handler.php : 89

Deletes a content object from the index.

public deleteContent(int $contentId[, int|null $versionId = null ]) : mixed

Parameters

Name Type Default value Description
$contentId int - -
$versionId int|null null -

publicdeleteLocation()

Handler.php : 104

Deletes a location from the index.

public deleteLocation(mixed $locationId, mixed $contentId) : mixed

Parameters

Name Type Default value Description
$locationId mixed - -
$contentId mixed - -

publicfindContent()

Handler.php : 34

Finds content objects for the given query.

public findContent(Query $query[, array<string|int, mixed> $languageFilter = [] ]) : SearchResult

Parameters

Name Type Default value Description
$query Query - -
$languageFilter array<string|int, mixed> []

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 values

SearchResult

With ContentInfo as SearchHit->valueObject

Tags
Throws
InvalidArgumentException

if Query criterion is not applicable to its target

publicfindLocations()

Handler.php : 64

Finds locations for the given $query.

public findLocations(LocationQuery $query[, array<string|int, mixed> $languageFilter = [] ]) : SearchResult

Parameters

Name Type Default value Description
$query LocationQuery - -
$languageFilter array<string|int, mixed> []

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 values

SearchResult

With Location as SearchHit->valueObject

publicfindSingle()

Handler.php : 51

Performs a query for a single content object.

public findSingle(Criterion $filter[, array<string|int, mixed> $languageFilter = [] ]) : ContentInfo

Parameters

Name Type Default value Description
$filter Criterion - -
$languageFilter array<string|int, mixed> []

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 values

ContentInfo

Tags
Throws
NotFoundException

if the object was not found by the query or due to permissions

Throws
InvalidArgumentException

if Criterion is not applicable to its target

Throws
InvalidArgumentException

if there is more than than one result matching the criterions

publicindexContent()

Handler.php : 81

Indexes a content object.

public indexContent(Content $content) : mixed

Parameters

Name Type Default value Description
$content Content - -

publicindexLocation()

Handler.php : 96

Indexes a Location in the index storage.

public indexLocation(Location $location) : mixed

Parameters

Name Type Default value Description
$location Location - -

publicpurgeIndex()

Handler.php : 109

Purges all contents from the index.

public purgeIndex() : mixed

publicsuggest()

Handler.php : 74

Suggests a list of values for the given prefix.

public suggest(string $prefix[, array<string|int, string> $fieldPaths = [] ][, int $limit = 10 ][, Criterion|null $filter = null ]) : mixed

Parameters

Name Type Default value Description
$prefix string - -
$fieldPaths array<string|int, string> [] -
$limit int 10 -
$filter Criterion|null null -