本文整理汇总了PHP中repository::getSearchService方法的典型用法代码示例。如果您正苦于以下问题:PHP repository::getSearchService方法的具体用法?PHP repository::getSearchService怎么用?PHP repository::getSearchService使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类repository
的用法示例。
在下文中一共展示了repository::getSearchService方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getServiceByCode
public function getServiceByCode($code)
{
$criteria = array(new Criterion\ContentTypeIdentifier(array('service_link')), new Criterion\Visibility(Criterion\Visibility::VISIBLE), new Criterion\Field('code', Criterion\Operator::EQ, $code));
$query = new Query();
$query->filter = new Criterion\LogicalAnd($criteria);
$searchResult = $this->repository->getSearchService()->findContent($query);
if (isset($searchResult->searchHits)) {
return $searchResult->searchHits;
} else {
return array();
}
}
示例2: getLocationSearchResult
function getLocationSearchResult( array $criteria, array $sortClause = array(), $limit = null, $offset = null )
{
$query = new LocationQuery();
$query->filter = new Criterion\LogicalAnd( $criteria );
if( $sortClause )
{
$query->sortClauses = $sortClause;
}
if($limit){
$query->limit = $limit;
}
if($offset){
$query->offset = $offset;
}
$searchResult = $this->repository->getSearchService()->findLocations( $query );
return $this->extractObjectsFromSearchResult( $searchResult );
}