Jump to content

Edit History

hakeryk2

hakeryk2

Hello devs and users,

I was strugling with this really bad behavior of Prestashop search engine when ie: you were searching for "wooden chair" and You end up with result of products that contains "wooden" and "chair" as well. Which sucks ass.

This was driving my crazy so I end up with this override for Search.php in Prestashop 1.6 - didn't tested this on 1.7. This piece of code checks whether product that You searched for contains both or more words in search index (like tags, featuers not only the name) that You actually searched. Now I can die peacefully because when somone was searching for ie: Black chair he end up with bunch of black wardrobes, chairs, sofas etc.

To get this working please use at least product name, features, categories, tags and combinations in Preferences -> Search.

To install this just put this file in override/classes/ and after this remove class_index.php file in cache folder.

I hope You find it usefull. I was working on this for 6 hours because I had to understand how prestashop search engine works and had to do this as efficient and performative as I can so any tip will be appreciated. It works faster for me then previous one. Try it for yourself :)

Search.php

hakeryk2

hakeryk2

Hello devs and users,

I was strugling with this really bad behavior of Prestashop search engine when ie: you were searching for "wooden chair" and You end up with result of products that contains "wooden" and "chair" as well. Which sucks ass.

This was driving my crazy so I end up with this override for Search.php in Prestashop 1.6 - didn't tested this on 1.7. This piece of code checks whether product that You searched for contains both or more words in search index (like tags, featuers not only the name) that You actually searched. Now I can die peacefully because when somone was searching for ie: Black chair he end up with bunch of black wardrobes, chairs, sofas etc.

To get this working please use at least product name, features, categories, tags and combinations in Preferences -> Search.

To install this just put this file in override/classes/ and after this remove class_index.php file in cache folder.

I hope You find it usefull. I was working on this for 6 hours because I had to understand how prestashop search engine works and had to do this as efficient and performative as I can so any tip will be appreciated. It works faster for me then previous one. Try it for yourself :)

Search.php

hakeryk2

hakeryk2

Hello devs and users,

I was strugling with this really bad behavior of Prestashop search engine when ie: you were searching for "wooden chair" and You end up with result of products that contains "wooden" and "chair" as well. Which sucks ass.

This was driving my crazy so I end up with this override for Search.php in Prestashop 1.6 - didn't tested this on 1.7. This piece of code checks whether product that You searched for contains both or more words in search index (like tags, featuers not only the name) that You actually searched. Now I can die peacefully because when somone was searching for ie: Black chair he end up with bunch of black wardrobes, chairs, sofas etc.

To get this working please use at least product name, features, categories, tags and combinations in Preferences -> Search.

To install this just put this file in override/classes/ and after this remove class_index.php file in cache folder.

I hope You find it usefull. I was working on this for 6 hours because I had to understand how prestashop search engine works and had to do this as efficient and performative as I can so any tip will be appreciated. It works faster for me then previous one. Try it for yourself :)

 

 

 

 

 

Search.php

×
×
  • Create New...