Skip to content

Commit

Permalink
Fixed search service
Browse files Browse the repository at this point in the history
  • Loading branch information
Viburnum committed Jun 22, 2016
1 parent 36141ab commit e350bef
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Services/SearchService.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ protected function searchOrm(Query $query, EntityManager $em) {
$facetQb->addSelect('COUNT(doc.id) as resultCount');
$facetQb->addGroupBy('field.fieldName');
$facetQb->addGroupBy('field.fieldValue');
$facetQb->orderBy('resultCount', 'DESC');

$facetSet = new FacetSetAdapter();
foreach($facetQb->getQuery()->getScalarResult() as $facetResult) {
Expand All @@ -176,6 +177,7 @@ protected function searchOrm(Query $query, EntityManager $em) {
$facetQb->select('doc.entityClass');
$facetQb->addSelect('COUNT(doc.id) as resultCount');
$facetQb->addGroupBy('doc.entityClass');
$facetQb->orderBy('resultCount', 'DESC');

foreach($facetQb->getQuery()->getScalarResult() as $facetResult) {
$facetSet->addFacetValue('type', $facetResult['entityClass'], $facetResult['resultCount']);
Expand Down

0 comments on commit e350bef

Please sign in to comment.