protected function getFilterArray(array $request)
{
$filterArray = parent::getFilterArray($request);
$attributeCodes = $this->eavConfig->getEntityAttributeCodes(\Magento\Catalog\Model\Product::ENTITY);
foreach ($request as $code => $value) {
if (in_array($code, $attributeCodes)) {
$attribute = $this->eavConfig->getAttribute(\Magento\Catalog\Model\Product::ENTITY, $code);
if (isset($filterArray[$code]) && !is_array($filterArray[$code])) {
$filterArray[$code] = [$filterArray[$code]];
}
if ($attribute->getId() && $this->canReplaceImageWithSwatch($attribute)) {
$filterArray[$code][] = $this->getOptionIds($attribute, $value);
}
}
}
return $filterArray;
}