/**
  * Retrieve the field name for an attributes.
  *
  * @param Mage_Eav_Model_Attribute $attribute    Attribute we want the value for.
  * @param string                   $languageCode Language code
  *
  * @return string
  */
 protected function _getAttributeFieldName($attribute, $languageCode)
 {
     $mapping = $this->getMappingProperties()['properties'];
     $fieldName = $attribute->getAttributeCode();
     if (!isset($mapping[$fieldName])) {
         $fieldName = $fieldName . '_' . $languageCode;
     }
     if (!isset($mapping[$fieldName])) {
         $fieldName = false;
     }
     return $fieldName;
 }
 /**
  * Indicates if an attribute is used into a search type.
  *
  * @param Mage_Eav_Model_Attribute $attribute  Attribute we want the value for.
  * @param string                   $searchType Search type
  *
  * @return boolean
  */
 protected function _isAttributeUsedForSearchType($attribute, $searchType)
 {
     $isSearchable = $attribute->getIsSearchable() || $attribute->getAttributeCode() == 'name';
     if (in_array($searchType, array(self::SEARCH_TYPE_FUZZY, self::SEARCH_TYPE_PHONETIC))) {
         $isSearchable = $isSearchable && (bool) $attribute->getIsFuzzinessEnabled();
     } else {
         if ($searchType == self::SEARCH_TYPE_AUTOCOMPLETE) {
             $isSearchable = $isSearchable && (bool) $attribute->getIsUsedInAutocomplete();
         }
     }
     return $isSearchable;
 }