[1.5.1.3] New 1.5.x search design causes new problems
Posted: Fri Dec 23, 2011 10:00 pm
Back in 1.4.x, the search was limited and only matched exact order of words.
if you typed: "Big Red Truck"
it would not find: "Big Truck"
Now in 1.5.x, the search keywords are exploded and searched individually
if you typed: "Big Red Truck"
it would find all products with: "Big"
it would find all products with: "Red"
it would find all products with: "Truck"
Which is extremely dangerous as you can get results for "Big Car" and "Red Hat" and "Red Apples"... all non-truck related.
So user "loveoscommerce" skyped me with this search problem he was having and I confirm the issue.
To demonstrate the issue, I will use my own site, as it comes into play when you have a lot of products with common title words. In this case we will use my "MIGS" extension.
As you can see here:
http://opencartguru.com/migs
The title of the product is:
MIGS Gateway integration for OpenCart
But if you try to search that exact title on my site (1.5.1.3) you will notice something...
It returns almost a hundred results, and the "MIGS" result doesn't come until page 7!
The problem is because of the new way that keywords are exploded and then searched individually, It is searching:
"integration" and "opencart" and "gateway" which all my products have in the title. But the actual "migs" one is not getting priority.
This is a problem. We need to adjust it to make the less commonly found match be the priority or some other way of filtering.
Perhaps if there is an exact match, then only return that.
Or
If there is no exact match, explode the keywords and search individually until a match is found, then stop. This way the first result would have been for "Migs" ..if that had results, then return just those. If there was no results then continue
to the next word "Integration".. if that had results, just return those, otherwise continue. etc
But as you can see from my "Big Red Truck" example, that wouldn't work
So I think giving priority to the least common match is the necessary solution. Or some way of combining the 3 words first before searching them individually.
e.g.
Big Red Truck should be searched as a phrase initially:
Big Red Truck
Big Truck Red
Red Truck Big
Truck Big Red
Truck Red Big
Big Truck
Big Red
Red Truck
Red Big
Then if no results are found, explode them into
Big, Red, and Truck separately, giving priority at this point, to the least commonly found word.
if you typed: "Big Red Truck"
it would not find: "Big Truck"
Now in 1.5.x, the search keywords are exploded and searched individually
if you typed: "Big Red Truck"
it would find all products with: "Big"
it would find all products with: "Red"
it would find all products with: "Truck"
Which is extremely dangerous as you can get results for "Big Car" and "Red Hat" and "Red Apples"... all non-truck related.
So user "loveoscommerce" skyped me with this search problem he was having and I confirm the issue.
To demonstrate the issue, I will use my own site, as it comes into play when you have a lot of products with common title words. In this case we will use my "MIGS" extension.
As you can see here:
http://opencartguru.com/migs
The title of the product is:
MIGS Gateway integration for OpenCart
But if you try to search that exact title on my site (1.5.1.3) you will notice something...
It returns almost a hundred results, and the "MIGS" result doesn't come until page 7!
The problem is because of the new way that keywords are exploded and then searched individually, It is searching:
"integration" and "opencart" and "gateway" which all my products have in the title. But the actual "migs" one is not getting priority.
This is a problem. We need to adjust it to make the less commonly found match be the priority or some other way of filtering.
Perhaps if there is an exact match, then only return that.
Or
If there is no exact match, explode the keywords and search individually until a match is found, then stop. This way the first result would have been for "Migs" ..if that had results, then return just those. If there was no results then continue
to the next word "Integration".. if that had results, just return those, otherwise continue. etc
But as you can see from my "Big Red Truck" example, that wouldn't work
So I think giving priority to the least common match is the necessary solution. Or some way of combining the 3 words first before searching them individually.
e.g.
Big Red Truck should be searched as a phrase initially:
Big Red Truck
Big Truck Red
Red Truck Big
Truck Big Red
Truck Red Big
Big Truck
Big Red
Red Truck
Red Big
Then if no results are found, explode them into
Big, Red, and Truck separately, giving priority at this point, to the least commonly found word.