The Search handler retrieves sets of of Content objects, based on a
set of criteria.
Methods
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
|
-
|
Deletes a location from the index.
|
public deleteLocation(mixed $locationId, mixed $contentId) : mixed
|
Parameters
Name |
Type |
Default value |
Description |
$locationId
|
mixed
|
-
|
-
|
$contentId
|
mixed
|
-
|
-
|
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
Finds locations for the given $query.
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
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
Indexes a content object.
|
public indexContent(Content $content) : mixed
|
Parameters
Name |
Type |
Default value |
Description |
$content
|
Content
|
-
|
-
|
Indexes a Location in the index storage.
|
public indexLocation(Location $location) : mixed
|
Parameters
Name |
Type |
Default value |
Description |
$location
|
Location
|
-
|
-
|
Purges all contents from the index.
|
public purgeIndex() : mixed
|
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
|
-
|