private function getField(ContainerConfigurationInterface $containerConfiguration, OptimizerInterface $optimizer)
    {
        $attributeCode = $optimizer->getConfig('attribute_code');

        try {
            $attribute = $this->getAttribute($attributeCode);
            $field     = $this->mappingHelper->getFilterField($attribute);
        } catch (\Magento\Framework\Exception\NoSuchEntityException $exception) {
            try {
                $field = $containerConfiguration->getMapping()->getField($attributeCode);
                $field = $field->getName();
            } catch (\LogicException $exception) {
                $field = $attributeCode;
            }
        }

        return $field;
    }