Help - Search - Members - Calendar
Full Version: GoogleCube ~ The road to riches.. well. Better Search Results
CubeCart Forums > General > General Discussion
akumanz
Well for about a week now I've been working on trying to improve the search system in cubecart (v2 but nothing much new in v3)

For the non techies this post won't be of much value. But for those who are, I'd like some comments / feedback (if you have any knowledge in the field)

I've been working on implementing a full text search system. The amount of problems I've incurred have been vast.

My initial goal was to end up with a search system that incorporated the following ideas.
  1. Search through ProductCode / Title / Description Field
  2. In relation to Title / Description, implement a ranking system whereby matches of a term in Title, would result in a product being listed on the results page higher than one with matches in Description
  3. Would search product code without any full text, just a simple like match
Dilemnas I've faced
  1. Mysql full text indexes don't handle words less 4 chars (by default) so a search for CPU with match against would turn up nothing. fulltext indexing as aforementioned, disregards words of less than 4 chars, so to CPU would not be indexed
  2. Dashes were recognized as Operators when they were sometimes just part of a product name/code ~ double quoted term to resolve. As with the earlier problem, as a result the word CPU-DRIVE would return nothing even if there was a product titled: CPU-DRIVE simply because CPU would be split from Drive when the table was indexed & discarded.
The Result so far

CODE
Select *,
MATCH(title) AGAINST('+"SearchTerm"*' IN BOOLEAN MODE)*1.7+
MATCH(description) AGAINST('+"SearchTerm"*' IN BOOLEAN MODE)*0.3
AS score FROM cubecartstore_inventory
WHERE MATCH(title,description) AGAINST('+"SearchTerm"*' IN BOOLEAN MODE)
order by score desc LIMIT 0, 25


So as you can see fulltext doesn't seem to be a fully working solution & I wouldn't recommend simply throwing this code into your website unless you're willing to test it thoroughly & see if it fits the search terms commonly used in your site. As I've found it doesn't work for many used @ mine.

So the search continues for and improved search system for cubecart. I will post more information as I come across it / new methods I try as I try'em. Would like to hear any thoughts from others also!

thanks
Brivtech
Because this is about development of a third party modification, it would be better discussed amongst other developers over at cubecart.org.

Seems like a good idea though.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.