Update RawPaginatorAdapter.php
This commit is contained in:
parent
4c4e9ffe36
commit
f9ce1dcd4e
|
@ -36,6 +36,11 @@ class RawPaginatorAdapter implements PaginatorAdapterInterface
|
|||
* @var array for the facets
|
||||
*/
|
||||
private $facets;
|
||||
|
||||
/**
|
||||
* @var array for the aggregations
|
||||
*/
|
||||
private $aggregations
|
||||
|
||||
/**
|
||||
* @see PaginatorAdapterInterface::__construct
|
||||
|
@ -82,6 +87,7 @@ class RawPaginatorAdapter implements PaginatorAdapterInterface
|
|||
$resultSet = $this->searchable->search($query, $this->options);
|
||||
$this->totalHits = $resultSet->getTotalHits();
|
||||
$this->facets = $resultSet->getFacets();
|
||||
$this->aggregations = $resultSet->getAggregations();
|
||||
return $resultSet;
|
||||
}
|
||||
|
||||
|
@ -126,4 +132,28 @@ class RawPaginatorAdapter implements PaginatorAdapterInterface
|
|||
|
||||
return $this->facets;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns Aggregations
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function getAggregations() {
|
||||
if (!isset($this->aggregations)) {
|
||||
$this->aggregations = $this->searchable->search($this->query)->getAggregations();
|
||||
}
|
||||
|
||||
return $this->aggregations;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the Query
|
||||
*
|
||||
* @return Query the search query
|
||||
*/
|
||||
public function getQuery()
|
||||
{
|
||||
return $this->query;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue