By Default, Magento sorts your search return in ascending order. Unsurprisingly, it also returns by relevance of search. Sounds great, right? Well, it led to a problem on my site.
As you can see, I have good control of each searchable attribute, so the problem lies in “Capacity”. As you can see it is a input text box.
When user attempts to put in “24″, for example, the default search order will return items with “124″ in front of all the other items with “24″, which is not really what the user wants. As shown below…
After about three days of searching, trying different things like looking for ways to search “exact phrase” with no avail. I found a surprisingly simple solution from Stack Overflow:
“In your template, in the /catalogserach/form.phtml file, Within the
<form id="searh_form" ... >
<input type="hidden" name="order" value="relevance"> <input type="hidden" name="dir" value="desc">
This sorts the search results in descending order, which in my case sort the “24″ in front of “124″.