45 private $aggregationBuilder;
50 private $temporaryStorageFactory;
63 AggregationBuilder $aggregationBuilder,
69 $this->aggregationBuilder = $aggregationBuilder;
70 $this->temporaryStorageFactory = $temporaryStorageFactory;
80 $temporaryStorage = $this->temporaryStorageFactory->create();
81 $table = $temporaryStorage->storeDocumentsFromSelect(
$query);
83 $documents = $this->getDocuments(
$table);
85 $aggregations = $this->aggregationBuilder->build(
$request,
$table, $documents);
87 'documents' => $documents,
88 'aggregations' => $aggregations,
90 return $this->responseFactory->create(
$response);
113 private function getConnection()
115 return $this->resource->getConnection();
query(RequestInterface $request)
__construct(Mapper $mapper, ResponseFactory $responseFactory, ResourceConnection $resource, AggregationBuilder $aggregationBuilder, TemporaryStorageFactory $temporaryStorageFactory)