protected function _getItemsData()
{
$attribute = $this->getAttributeModel();
$this->_requestVar = $attribute->getAttributeCode();
/** @var \Magento\CatalogSearch\Model\ResourceModel\Fulltext\Collection $productCollection */
$productCollection = $this->getLayer()->getProductCollection();
$facets = $productCollection->getFacetedData($this->getFilterField());
$minValue = false;
$maxValue = false;
$data = [];
if (count($facets) > 1) {
foreach ($facets as $key => $aggregation) {
$count = $aggregation['count'];
$data[] = ['label' => $key, 'value' => $key, 'count' => $count];
if ($minValue === false || $minValue > $key) {
$minValue = $key;
}
if ($maxValue === false || $maxValue < $key) {
$maxValue = $key;
}
}
$this->setMinValue($minValue);
$this->setMaxValue($maxValue);
}
return $data;
}