/**
  *
  * @param Mage_CatalogSearch_Model_Mysql4_Advanced_Collection $collection
  * @param Mage_Catalog_Model_Resource_Eav_Attribute $attribute
  * @param string|array $value
  *
  * @return bool
  */
 public function addIndexableAttributeModifiedFilter($collection, $attribute, $value)
 {
     if ($attribute->getIndexType() == 'decimal') {
         $table = $this->getTable('catalog/product_index_eav_decimal');
     } else {
         $table = $this->getTable('catalog/product_index_eav');
     }
     $tableAlias = 'ast_' . $attribute->getAttributeCode();
     $storeId = Mage::app()->getStore()->getId();
     $select = $collection->getSelect();
     if (is_array($value)) {
         if (isset($value['from']) && isset($value['to'])) {
             if (empty($value['from']) && empty($value['to'])) {
                 return false;
             }
         }
     }
     $select->distinct(true);
     $select->join(array($tableAlias => $table), "e.entity_id={$tableAlias}.entity_id AND {$tableAlias}.attribute_id={$attribute->getAttributeId()}" . " AND {$tableAlias}.store_id={$storeId}", array());
     if (is_array($value) && (isset($value['from']) || isset($value['to']))) {
         if (isset($value['from']) && !empty($value['from'])) {
             $select->where("{$tableAlias}.`value` >= ?", $value['from']);
         }
         if (isset($value['to']) && !empty($value['to'])) {
             $select->where("{$tableAlias}.`value` <= ?", $value['to']);
         }
         return true;
     }
     $select->where("{$tableAlias}.`value` IN(?)", $value);
     return true;
 }