protected function getTotalItems(Query $rqlQuery)
    {
        $rqlQuery->setLimit(new LimitNode(ReadInterface::LIMIT_INFINITY));
        $aggregateCountFunction = new AggregateFunctionNode('count', $this->dataStore->getIdentifier());

        $rqlQuery->setSelect(new SelectNode([$aggregateCountFunction]));
        $aggregateCount = $this->dataStore->query($rqlQuery);

        return current($aggregateCount)["$aggregateCountFunction"];
    }