Page 2 of 3

Re: [1.5.1.3] New 1.5.x search design causes new problems

Posted: Sat Feb 11, 2012 5:08 am
by Qphoria
Renato Frota wrote:I'm surprised with this...

comparing the file attached by Qphoria with the default OC 1.5.1.3 file, I found this twice in default file (lines 80-82 and 444-446):

Code: Select all

					foreach ($words as $word) {
						$implode[] = "LCASE(pt.tag) LIKE '%" . $this->db->escape(utf8_strtolower($data['filter_tag'])) . "%' AND pt.language_id = '" . (int)$this->config->get('config_language_id') . "'";
					}
what is $data['filter_tag'] is doing there? where's $word extracted by foreach()?

in the Qphoria version, I found:

Code: Select all

				foreach ($words as $word) {
					$implode[] = "LCASE(pt.tag) LIKE '%" . $this->db->escape(utf8_strtolower($word)) . "%' AND pt.language_id = '" . (int)$this->config->get('config_language_id') . "'";
				}
which makes a lot more sense with the $word in the middle of it!

Did I miss a previous fix of this file?!
no, as I said there was a bug I fixed in my research, that was the bug fix.

Re: [1.5.1.3] New 1.5.x search design causes new problems

Posted: Sat Feb 11, 2012 5:09 am
by Qphoria
marcelwoo wrote:I have tried the fix on my store but it does not seem to work, lots lots of irrelevant items are still shown.
I have also tried searching"Migs Payment Integration" on your store and obviously the fix does not work.
Link here:
http://opencartguru.com/index.php?route ... ntegration

Gosh, searching really needs improvement!

PS: I just made a vQmod for this fix. You guys can give it a shot and offer feedbacks on this fix:) Report back here whether it works or not!
search_improve.xml
You are right.. something still not right when searching more than 2 words. I don't have "payment" set on the tag so that is why is doesn't show. The code currently does AND for each search term, but really needs to combine separately because it is doing:
"Migs" AND "payment" AND "integration"

The mod was renamed to "Migs Gateway Integration"
So the word "payment" isn't found anymore. and since I don't have the tag "payment" it just doesn't find it.

So a way to try all combinations of keywords is needed.
Migs
Migs AND payment
Migs AND integration
Payment AND integration

but then it starts getting a bit unruly
So my fix only works right if you have tags complimenting the other words. Overall it dropped it from 4 pages of results to 2 pages, but if I had all my tags right.. it would still find a ton.

A proper fulltext search is what is needed to put it to rest.

Re: [1.5.1.3] New 1.5.x search design causes new problems

Posted: Sat Feb 11, 2012 11:48 am
by marcelwoo
Will Daniel or others in the official development team handle this searching problem in the near future? I think maybe you guys can have a look at how other carts works on searching algorithm. Not need to be same with other cart systems but borrowing good ideas is not a bad idea;)

Re: [1.5.1.3] New 1.5.x search design causes new problems

Posted: Sat Feb 11, 2012 11:56 am
by Qphoria
I am the other half of the developing team and i am working on this issue. As i said this mod was first stab but fulltext is the proper way. Search "mysql Fulltext" for more info

Re: [1.5.1.3] New 1.5.x search design causes new problems

Posted: Sat Feb 11, 2012 11:13 pm
by marcelwoo
awesome! hopefully it is not too long before this bug is fixed.

Re: [1.5.1.3] New 1.5.x search design causes new problems

Posted: Fri Mar 02, 2012 3:21 am
by myerswb
Do we have an update on this fix yet?

Re: [1.5.1.3] New 1.5.x search design causes new problems

Posted: Fri Mar 02, 2012 3:34 am
by Qphoria
I can tell you it won't be in 1.5.2
It is top priority for 1.5.3 and hopefully can be patched in to 1.5.2 when its ready, but won't be holding up the release of 1.5.2

Re: [1.5.1.3] New 1.5.x search design causes new problems

Posted: Fri Mar 02, 2012 3:41 am
by DragonJ
Just to post a quick follow-up on this, I've found another issue (sorry if it's already been brought to attention).

First off, I will confirm that 3-word searches return erratic results.

What I've also found is that when including a 2-letter word in the search, the results are also erratic and incomplete. Something like "07 Toyota Fuse" will return irrelevant results in addition to lots of "non-existant $0.00" results.

If the developers are interested, send me a PM and I'll provide a link to an example.

Re: [1.5.1.3] New 1.5.x search design causes new problems

Posted: Fri Mar 02, 2012 3:49 am
by Qphoria
It's probably best to require 3 or more letters for search

Re: [1.5.1.3] New 1.5.x search design causes new problems

Posted: Fri Mar 02, 2012 4:30 am
by DragonJ
Unfortunately, a lot of my products involve 2-letter words -- not by my choice. These are what the manufacturers have named these parts and therefore those are the words that people use when searching for them. :(

Re: [1.5.1.3] New 1.5.x search design causes new problems

Posted: Wed Apr 04, 2012 2:26 am
by myerswb
Any news on this or do I have to 'buy' another extension which may not work?

Re: [1.5.1.3] New 1.5.x search design causes new problems

Posted: Thu May 03, 2012 5:14 am
by pgp
Thank you for posting this fix. My results were returning items which weren't related but now has gone down to handful of related items. However 1 little issue.

My shop has printer cartridges, so lets say someone is searching for "HP 1200" this could be in product name or product description. Right now my search look only in product name and not in description so unless I tick look in product description it doesn't show any results. Any idea how I can fix this?

Thanks.

Re: [1.5.1.3] New 1.5.x search design causes new problems

Posted: Thu May 03, 2012 7:19 am
by DragonJ
Does the same problem happen if you search only for "1200"?

Re: [1.5.1.3] New 1.5.x search design causes new problems

Posted: Thu May 03, 2012 4:17 pm
by pgp
Hi Dragonj,

Yes same happens if i search for 1200. I think it because I don't have a product name calles HP 1200 or 1200. But have HP 1200 in product description. However if i tick search product description then it returns results with HP and also 1200, so could be another printer which has Ricoh 1200 for an example.

Any idea how this could be improved?

Thanks.

Re: [1.5.1.3] New 1.5.x search design causes new problems

Posted: Fri May 04, 2012 12:39 am
by storm-cloud
Qphoria wrote:I've attached the default 1.5.1.3 catalog model file with all changes
Drop it into catalog/model/catalog folder and replace the existing product.php file
Thank you Q!

I have actually posted this in the bug thread not too long ago because for some reason when I searched for this issue previously, this thread did not show up (kind of ironic!).

Anyway, your changes are a definite improvement. A couple searches revealed products in a not so relative order but on the whole there is a substantial improvement with far less irrelevant results.

Re: [1.5.1.3] New 1.5.x search design causes new problems

Posted: Fri May 04, 2012 5:28 pm
by pgp
Any one here can help me? :( kinda stuck without a solution.

Re: [1.5.1.3] New 1.5.x search design causes new problems

Posted: Fri May 04, 2012 9:01 pm
by Qphoria

Re: [1.5.1.3] New 1.5.x search design causes new problems

Posted: Sat May 05, 2012 7:18 am
by pgp
Thank you, no other free solution i guess? :(

Re: [1.5.1.3] New 1.5.x search design causes new problems

Posted: Sun May 06, 2012 3:57 pm
by pgp
Just wondering if below is possible to do?

Currently my search is returning correct search results based on product names with modified settings mentioned in this thread. Is it possible to extend that to look under product description the same way?

Re: [1.5.1.3] New 1.5.x search design causes new problems

Posted: Wed Jun 13, 2012 10:09 pm
by SDSkisDan
I hope I'm not breaking any rules by necro'ing this thread, but after the release of 1.5.3.1 it doesn't appear these fixes have gotten into the code. I manually updated the code as described and my search is still returning some crazy irrelevant results. Has improving the base Opencart search become a commercial endeavor only? I've tried a single keyword, two keywords, and three keywords in search and I basically will get my entire catalog in search results unless I enter in a distinct model or sku number. Is there anything else I can try?