The basic search takes keywords and then runs a search which aims to produce results ranked in order of relevance. For performance, the results and manipulation are done within the database, so Kartris itself receives back a ready-sorted list of search results to display.

The stored procedure responsible is spKartrisDB_Search. It is fairly complex due to the manipulation of results it does. But the basic principle is that for any search phrase (multiple words) entered, results containing the exact phrase are scored highest. Those containing all or most of the words (though not necessarily together as an exact phrase) will come next, and those containing fewer of the words will come lower. Also, the presence of the search term or words in certain fields such as product name, will score higher than for other fields. There is also a special routine to search version codes (SKUs). Once each result is scored, a temporary table is used to sort them, highest scoring first. This methodology allows keyword-relevance-sorted results even where full-text search is not available.

Powered by tomeCMS