I have a requirement where if any integer is there in Magento quick search string, then do a search looking for product SKU and custom attributes. But if there are no integers in the search string, then search looking in product Name and Description.
Let's say the query string has 12345
in it, then I would want to do a LIKE search in the product attributes SKU and few other custom attributes. But if there is no integer in the query string, then I would want to do a FULLTEXT search in the product Name and Description only. Makes sense?
I have looked into CatalogSearch/Model/Resource/Fulltext.php -> prepareResult()
but can't figure out how to filter results based on query string. Also, the quick search is using catalogsearch/result
model to search, whereas here we may need to look into catalog/product
?
I am lost, any help would be greatly appreciated!