magento search except word

1.DB add field 'except' - 'catalogsearch_query'
2.app\code\core\Mage\Adminhtml\Block\Catalog\Search\Edit\Form.php add field
// feng
$fieldset->addField('except', 'text', array(
	'name'  => 'except',
	'label' => Mage::helper('catalog')->__('Except'),
	'title' => Mage::helper('catalog')->__('Except'),
	'note'  => Mage::helper('catalog')->__('Except.'),
));
3.model
app\code\core\Mage\CatalogSearch\Model\Resource\Fulltext.php
public function prepareResult($object, $queryText, $query)
{
	...
	// feng
	if($query->getExcept()){
		$likeCond .= ' and s.data_index not like"%'.$query->getExcept().'%")';
	}else{
		$likeCond .= ')';
	}
	...
}

你可能感兴趣的:(magento search except word)