Class

eZ\Publish\Core\SignalSlot\SearchService

class SearchService implements SearchService

SearchService class.

Methods

__construct(SearchService $service, SignalDispatcher $signalDispatcher)

Constructor.

SearchResult findContent(Query $query, array $languageFilter = array(), bool $filterOnUserPermissions = true)

Finds content objects for the given query.

SearchResult findContentInfo(Query $query, array $languageFilter = array(), bool $filterOnUserPermissions = true)

Finds contentInfo objects for the given query.

Content findSingle(Criterion $filter, array $languageFilter = array(), bool $filterOnUserPermissions = true)

Performs a query for a single content object.

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

Suggests a list of values for the given prefix.

SearchResult findLocations(LocationQuery $query, array $languageFilter = array(), bool $filterOnUserPermissions = true)

Finds Locations for the given query.

bool supports(int $capabilityFlag)

Query for supported capability of currently configured search engine.

Details

at line 44
public __construct(SearchService $service, SignalDispatcher $signalDispatcher)

Constructor.

Construct service object from aggregated service and signal dispatcher

Parameters

SearchService $service
SignalDispatcher $signalDispatcher

at line 62
public SearchResult findContent(Query $query, array $languageFilter = array(), bool $filterOnUserPermissions = true)

Finds content objects for the given query.

Parameters

Query $query
array $languageFilter Configuration for specifying prioritized languages query will be performed on. Currently supported: array("languages" => array(,..)).
bool $filterOnUserPermissions if true only the objects which the user is allowed to read are returned.

Return Value

SearchResult

Exceptions

InvalidArgumentException if query is not valid

at line 83
public SearchResult findContentInfo(Query $query, array $languageFilter = array(), bool $filterOnUserPermissions = true)

Finds contentInfo objects for the given query.

Parameters

Query $query
array $languageFilter
  • a map of filters for the returned fields. Currently supports: array("languages" => array(,..), "useAlwaysAvailable" => bool) useAlwaysAvailable defaults to true to avoid exceptions on missing translations.
bool $filterOnUserPermissions if true (default) only the objects which is the user allowed to read are returned.

Return Value

SearchResult

Exceptions

InvalidArgumentException if query is not valid

See also

SearchServiceInterface::findContentInfo()

at line 102
public Content findSingle(Criterion $filter, array $languageFilter = array(), bool $filterOnUserPermissions = true)

Performs a query for a single content object.

Parameters

Criterion $filter
array $languageFilter Configuration for specifying prioritized languages query will be performed on. Currently supported: array("languages" => array(,..)).
bool $filterOnUserPermissions if true only the objects which is the user allowed to read are returned.

Return Value

Content

Exceptions

NotFoundException if the object was not found by the query or due to permissions
InvalidArgumentException if criterion is not valid
InvalidArgumentException if there is more than than one result matching the criterions

at line 115
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 133
public SearchResult findLocations(LocationQuery $query, array $languageFilter = array(), bool $filterOnUserPermissions = true)

Finds Locations for the given query.

Parameters

LocationQuery $query
array $languageFilter Configuration for specifying prioritized languages query will be performed on. Currently supports: array("languages" => array(,..), "useAlwaysAvailable" => bool) useAlwaysAvailable defaults to true to avoid exceptions on missing translations
bool $filterOnUserPermissions if true only the objects which is the user allowed to read are returned.

Return Value

SearchResult

Exceptions

InvalidArgumentException if query is not valid

at line 138
public bool supports(int $capabilityFlag)

Query for supported capability of currently configured search engine.

Will return false if search engine does not implement {see eZ\Publish\SPI\Search\Capable}.

Parameters

int $capabilityFlag One of CAPABILITY_* constants.

Return Value

bool