im trying to query a smarter search result, i checked online about Leveshtein and similiar_text but i believe Leveshtein algorithm is the best optionm how could i implement in my query the algorithm of LEvenshtein? I cant find any good resource on magento or even using this function on the attributeSelect, here is my initial code.
function queryBuy($string){
$items = Mage::getResourceModel('catalog/product_collection')
->addAttributeToSelect('name')
->addFieldToFilter(array(
array('attribute'=>'name','like'=> "%".$string."%"),
));
Should i make in Raw SQL? Does magento have any method available where i could use it?
2
Answers
try it like this
you can also check this answer
You can change any part of collection query with
Example