I'm trying to override the Catalog Search functionality of Magento so that it searches using 'AND' rather than 'OR' for search terms.
The 'correct' way to do this, that is update proof, is to create my own module. So this is what I've done. Unfortunately, this isn't working. The updated method is not being called.
Here's the config file section :
<global> <models> <catalogsearch> <rewrite> <fulltext>MyNameSpace_MyModule_Model_CatalogSearch_Fulltext</fulltext> </rewrite> </catalogsearch> </models> </global> The method I'm trying to override is Mage_CatalogSearch_Model_Fulltext, and I'm actually doing an 'extend' - eg,
class MyNameSpace_MyModule_Model_CatalogSearch_Fulltext extends Mage_CatalogSearch_Model_Fulltext { public function prepareResult($object, $queryText, $query) { die("It works..."); } } I had read somewhere that there's no point doing this 'overriding' if the class you're actually trying to override is never called with a particular class 'creator' method? If this is true, this may explain why my new class method is never used?
So in that case, how to override this method? Am I doing the right thing here?