Page 1 of 1

Model search

Posted: Thu Oct 28, 2010 3:40 pm
by fishthetiger
Hi there, as a relative novice to "development" who has dipped his toe into php, I was really happy when i stumbled across opencart. I felt like all my Xmas's came all at one. Good work guys, this platform definitely needs more recognition.

Just a quickie from me, I am currently developing a store which sells Heating Spares. These spares are mainly identified as a string of numbers as a model number. When I search a specific part number e.g. 3428, the results displays all products containing the "3428" string like, 5634284 and 342887443. This is great but is there a way that I can display the exact match first in the list of results?

It would be much appreciated if you could help, many thanks

@fishthetiger

opencart v 1.4.9.1
Clean install

Thanks again for your time.

Re: Model search

Posted: Mon Nov 01, 2010 3:05 pm
by fishthetiger
Hi there opencart community. As i'm not very confident with my php skills and really don't want to mess up a functioning store, I was wondering if anyone knows how to modify the search facility? Is there a way to have your search results display the exact match first in the list? Is this easy to do? Any help would be much appreciated.

Many thanks

Fishthetiger

v1.4.9.1

Re: Model search

Posted: Mon Nov 01, 2010 4:08 pm
by justinv
Hi Fishthetiger,

it's a good question. The search facility currently does not return results based on any sort of relevancy. The default order of results is the order in which they went into your database, basically.

Perhaps the easiest thing to do in your situation would be to create a pre-search that checks if there is an exact match on model number, and if so return only one result.

Let me know if that's a solution you'd consider. Otherwise you're welcome to wait for other (better) ideas!

Re: Model search

Posted: Mon Nov 01, 2010 8:31 pm
by Qphoria
I'd like to add more search options like the main stream search engines have.. like
"quotes" to only find exact matches
- (minus) to exclude items
etc

But at this time they are not in effect

Re: Model search

Posted: Tue Nov 02, 2010 1:28 pm
by justinv
It seems to me the search is doomed until it returns results based on relevance. Quotes and minuses are surely just workarounds to the fact that relevance isn't factored in?