/** * Returns attribute type for indexation. * * @param Mage_Catalog_Model_Resource_Eav_Attribute $attribute Attribute * * @return string */ protected function _getAttributeType($attribute) { $type = 'string'; if ($attribute->getBackendType() == 'int' || $attribute->getFrontendClass() == 'validate-digits') { $type = 'integer'; } elseif ($attribute->getBackendType() == 'decimal') { $type = 'double'; } elseif ($attribute->getSourceModel() == 'eav/entity_attribute_source_boolean') { $type = 'boolean'; } elseif ($attribute->getBackendType() == 'datetime') { $type = 'date'; } elseif ($attribute->usesSource() && $attribute->getSourceModel() === null) { $type = 'integer'; } else { if ($attribute->usesSource()) { $type = 'string'; } } return $type; }