private function addIndexedAttribute(&$productIndexData, $attribute)
    {
        if (!isset($productIndexData['indexed_attributes'])) {
            $productIndexData['indexed_attributes'] = [];
        }

        // Data can be missing for this attribute (Eg : due to null value being escaped).
        if (isset($productIndexData[$attribute->getAttributeCode()])) {
            $productIndexData['indexed_attributes'][] = $attribute->getAttributeCode();
        }
    }