Jump to content
mustang80

Prestashop 1.7.2.4 search results issue

Recommended Posts

I use Prestashop 1.7.2.4. When searching for certain words, it produces a lot of results, even when searching for exact phrases and product sentences, it produces hundreds of unnecessary results (version 1.7.1.2 did not have this problem). To bypass a problem I changed the class /Search.php with old version. at the same time does not show the product category in the search box as it was in version 1.7.1.2 ... .. For snippets I will upload photos

 

https://hoptuning.bg

presta.png

presta2.png

  • Like 1

Share this post


Link to post
Share on other sites

I don't like that search module either. It searches in many columns from product and category tables. This produces a lot of results. In addition, PS shows first the category in the results list, the searched word being often not present in the list, giving the impression that the search is wrong. Now, we're used to Google search which is incredibly clever in guessing what we meant...

When I have time, I plan to write my own search module. I let you know ;).

  • Like 1

Share this post


Link to post
Share on other sites

Hi Mustang80,

We are also on PS 1.7.2.4 and had the same problem. 


With help of  tips at https://www.prestashop.com/forums/topic/597944-search-two-or-more-words/?tab=comments#comment-2631092

we modified the file classes/seach.php.  This solved the problem in our site. Seach is getting exact results now.

Attached the modified search.php file.  Rename the file to search.php and upload to your server.

Best regards,

Peter

PS-1.7.2-modified-for-or_Search.php

  • Like 8
  • Thanks 1

Share this post


Link to post
Share on other sites
On 2018/1/13 at 10:10 PM, peter-D said:

Hi Mustang80,

We are also on PS 1.7.2.4 and had the same problem. 


With help of  tips at https://www.prestashop.com/forums/topic/597944-search-two-or-more-words/?tab=comments#comment-2631092

we modified the file classes/seach.php.  This solved the problem in our site. Seach is getting exact results now.

Attached the modified search.php file.  Rename the file to search.php and upload to your server.

Best regards,

Peter

PS-1.7.2-modified-for-or_Search.php

it's working for me, i use 1.7.2.2, Tks brother.

Share this post


Link to post
Share on other sites
On 1/13/2018 at 6:10 AM, peter-D said:

Hi Mustang80,

We are also on PS 1.7.2.4 and had the same problem. 


With help of  tips at https://www.prestashop.com/forums/topic/597944-search-two-or-more-words/?tab=comments#comment-2631092

we modified the file classes/seach.php.  This solved the problem in our site. Seach is getting exact results now.

Attached the modified search.php file.  Rename the file to search.php and upload to your server.

Best regards,

Peter

PS-1.7.2-modified-for-or_Search.php

 

This is a great help! Thank you so much!

Share this post


Link to post
Share on other sites
On 27/8/2018 at 10:55 AM, BonPresta said:

 

 

On 25/9/2018 at 3:47 PM, cswebsolution said:

!

 

On 28/12/2017 at 10:04 AM, Pierre_d said:

I don't like that search module either. It searches in many columns from product and category tables. This produces a lot of results. In addition, PS shows first the category in the results list, the searched word being often not present in the list, giving the impression that the search is wrong. Now, we're used to Google search which is incredibly clever in guessing what we meant...

When I have time, I plan to write my own search module. I let you know ;).

 

I hope that you develope a module search ad hoc. How you use Google search in Prestashop?

Share this post


Link to post
Share on other sites

Hi dear, the search of ps 1.7.4 is still as bad as you find in 1.7.3,1.7.2 , completely unusable. Your search.php can work on 1.7.4? The goal is simply to use a AND LOGIC instead OR in the query result. 

 

If you have server when can install package you must consider install elastich searche module. I use that and it work GREAT. 

 

I've found another trick to tune up 1.7.4 search. The big problem on the defaul class is that it use an OR operator,so you get lot of result but also you get higher rank on products that has duplicated word in their field. Using or instead and your result don't match the query you are searching. If you try to find "Z H" you will have a higher result for entry with

"Z Z Z"

than one with 

"Z H A"

 

And this is Creasy. To mitigate this function we have installed a module "auto keyword generator" and we configure it for generate tags from short desc. The module REMOVE duplicate entry and we teach search to use title and tags instead short desc . In title is hard to find duplicated words, instead in short desc it can happen frequently. 

 

 

Share this post


Link to post
Share on other sites

Hi Guys! I was searching for solutions around the web but there is nothing helpfull. This topic seems to be the only solution in the internet but sadly file to download no exist...

Can anyone who already downloaded file share it again here? 

Would be gratefull for any answear!

Cheers

Share this post


Link to post
Share on other sites
Posted (edited)

Prestashop is the bad think i've ever seen.

 

Try the attached one or think over a wonderful doofinder integration. 

 

If you need help we can setup elastich search or doofinder plugin for you. thanks

classes.rar

 

Replace the 1.7.2 / 1.7.3 / 1.7.4 with the 1.7.1

Edited by Matteo (see edit history)

Share this post


Link to post
Share on other sites

Thanks, I tried both files but nothing changed. Also tried to use search from prestashop 1.6 but it also no work for me.

My problem is that if I have items like: move sensor, sound sensor, temperature sensor, humidity sensor

and Im searching: "move sensor"

presta shows:

1) humidity sensor,

2) temperature sensor,

3) move sensor 

phrase "move sensor" is at the very end.

It will be best if it shows only items with both words"move" and "sensor" in product name, or even showing all stuff with words "sensor" and "move" would be ok but only items with both words will be on the very top of search list...

 

Maybe there is solutions with chamge operators AND and OR is search query? I looked in to the code but there is nothing clear to me ;)

 

 

 

Share this post


Link to post
Share on other sites
On 1/13/2018 at 2:10 PM, peter-D said:

Hi Mustang80,

We are also on PS 1.7.2.4 and had the same problem. 


With help of  tips at https://www.prestashop.com/forums/topic/597944-search-two-or-more-words/?tab=comments#comment-2631092

we modified the file classes/seach.php.  This solved the problem in our site. Seach is getting exact results now.

Attached the modified search.php file.  Rename the file to search.php and upload to your server.

Best regards,

Peter

PS-1.7.2-modified-for-or_Search.php

Thank you very much for your help. I was just hitting the limit to switch to another CMS because of this problem. If you are in Bulgaria or visit us at some point, you just earned a several pints of beer!

  • Like 1

Share this post


Link to post
Share on other sites

Thank you peter-D!
Made suitable for override.
Insert Attachment to: override/classes/Search.php
tested on 1.7.5

Search.php

Share this post


Link to post
Share on other sites
Posted (edited)
On 2/25/2019 at 8:50 AM, T74 said:

Thank you peter-D!
Made suitable for override.
Insert Attachment to: override/classes/Search.php
tested on 1.7.5

Search.php

1.7.5.1 Not working, can You Fix it?

RM7Ei9.jpg

Edited by Inkton (see edit history)

Share this post


Link to post
Share on other sites

Hi Inkton,

We are also on Prestashop 1.7.5.1 and search is working perfect.
Based on Bolean seach AND function, will find products which have all the words visitor did add in the search field. i.e. "love" AND "hate" AND "relation". 

Further in admin  under 'settings/search'  you can adjust the weight (value) you put into search (title, discription, tags) and also
search "in a word" or not
and search for exact  word end.

Select and test what gives the best results.
On our site, we found best result with setting :  "search in the word" =  off and "seach for exact end " on.

You can see how it works on our site, visit www.derks-wielersport.nl.
Search for "ketting" 142 hits).
Then seach for "ketting" and " 11" (35 hits),
Then search for "ketting" and '11" and "KMC" (17 hits),



Greetz,

Peter

Share this post


Link to post
Share on other sites
15 minutes ago, peter4661 said:

Hi Inkton,

We are also on Prestashop 1.7.5.1 and search is working perfect.
Based on Bolean seach AND function, will find products which have all the words visitor did add in the search field. i.e. "love" AND "hate" AND "relation". 

Further in admin  under 'settings/search'  you can adjust the weight (value) you put into search (title, discription, tags) and also
search "in a word" or not
and search for exact  word end.

Select and test what gives the best results.
On our site, we found best result with setting :  "search in the word" =  off and "seach for exact end " on.

You can see how it works on our site, visit www.derks-wielersport.nl.
Search for "ketting" 142 hits).
Then seach for "ketting" and " 11" (35 hits),
Then search for "ketting" and '11" and "KMC" (17 hits),



Greetz,

Peter

It's not about whether it works or not just what I'm showing. I joined screen. What I would not typed shows me something like that

Share this post


Link to post
Share on other sites

I attached the working file from our site. "search-PHP modified".

You need to rename the file to search.php.
 

Make sure to clear all your cache file after installation of the new search file and re-index ( admin : settings/search )

 

Search_PHP modified.php

Share this post


Link to post
Share on other sites
42 minutes ago, peter4661 said:

I attached the working file from our site. "search-PHP modified".

You need to rename the file to search.php.
 

Make sure to clear all your cache file after installation of the new search file and re-index ( admin : settings/search )

 

Search_PHP modified.php

Ok, now he does not make any mistakes. I have not rebuilt the index before. But I have a question, why can not I find some things? For example, I have a product with the title "Byzantine table from teak wood". I would like to start displaying this subject to me after entering "Byz", but it does not work until I type in the whole word. I have so many objects and for now I do everything manually adding aliases, but this is not a solution. Does anyone know why this is so?

https://shekina.eu/en/

Share this post


Link to post
Share on other sites

For getting search results while you type,  disable setting "search for exact end" , under settings/seach. 

See if this gives you the desired results in combination with "search in word" (on/off)

Share this post


Link to post
Share on other sites
8 minutes ago, peter4661 said:

For getting search results while you type,  disable setting "search for exact end" , under settings/seach. 

See if this gives you the desired results in combination with "search in word" (on/off)

Finally, thank you, it was so easy. Life saver.

Share this post


Link to post
Share on other sites
On 14/3/2019 at 13:43, peter4661 said:

Ho allegato il file di lavoro dal nostro sito. "search-PHP modified".

È necessario rinominare il file in search.php.
 

Assicurati di cancellare tutto il tuo file di cache dopo l'installazione del nuovo file di ricerca e reindicizzare (admin: settings / search)

 

Search_PHP modified.php

Buongiorno,

utilizzo la versione 1.7.4.4. Sul nostro sito i clienti hanno prezzi diversi a seconda del gruppo a cui appartengono. Chi non è loggato non visualizza alcun prezzo, se, però, effettua una ricerca inserendo una descrizione o un codice escono i risultati con anche l'indicazione del prezzo. Come posso risolvere il problema? Allego screenshot. Grazie in anticipo, Andrea

Schermata_2019-03-19_alle_10_40_44.png

Share this post


Link to post
Share on other sites

Hi, thanks for the solutions. I am close to solve it with the Search_PHP modified.php in PS 1.7.4.4 but I have found an error when I search 2 words or only one of them. Because I got bad results. Example: I search AEROCHARGE and I get 9 products with the name HUMMEL AEROCHARGE but when I search HUMMEL AEROCHARGE....I get only 3 product with the name HUMMEL AEROCHARGE. Must show the same 9 products.

Any help?

thanks

Share this post


Link to post
Share on other sites
Posted (edited)

Hello! I've put this to work, but if I search with dashes like NPE-5AC-500-ISO, this is one of my products, it doesn't find anything, but if I search for Svr Std 2016, this is a difrente product it works very well.

Edit: I'm usig presta 1.7.5

Edit2: I found out if I search PBE*5AC*500*ISO or PBE 5AC 500 ISO, or PBE.5AC.500.ISO it will find the PBE-5AC-500-ISO, can this be fixed?

Can you help fix the search with dahses please??

Edited by kalu (see edit history)

Share this post


Link to post
Share on other sites

Hi Kalu, if you add the string “NPE-5ac-500-iso” in product / option/ tags, search will find this item. Please also check the weight given to tags under  shopsettings/search.

Share this post


Link to post
Share on other sites
Posted (edited)

Hello Peter, I've got the tags in all the products, and it still doesn't work, without the modified search.php, the product was found, but with dashes but lots of other products were found to, with this new search.php it works fine, finding the right products, except when using Dashes "-"

 

I Don't know what happende but suddnly it started to work :)

Edited by kalu (see edit history)

Share this post


Link to post
Share on other sites

Hi!

I have the same problem as above. Unfortunatelly links are not valid any more. Are there any chances to upoload files once again ?

Thanks

Share this post


Link to post
Share on other sites

I have v.1.7.5.2 and search still doesnt work ok - after re-indexing and cleaning cache

I have an issue when I use the "-" character

When I do the following search, it shows me 9 options, but only shound show me 1 https://nsm.cl/store/busqueda?controller=search&s=hp+14-n+tecl

and is because the way the "-" is considered by the program is wrong

Does any one have an idea on how to fix this?   

Share this post


Link to post
Share on other sites
Posted (edited)
On 3/14/2019 at 2:41 PM, peter4661 said:

For getting search results while you typefilezilla uc browser rufus ,  disable setting "search for exact end" , under settings/seach. 

See if this gives you the desired results in combination with "search in word" (on/off)

I don't like that search module either. It searches in many columns from product and category tables. This produces a lot of results. In addition, PS shows first the category in the results list, the searched word being often not present in the list, giving the impression that the search is wrong. Now, we're used to Google search which is incredibly clever in guessing what we meant...

Edited by andiyatsi (see edit history)

Share this post


Link to post
Share on other sites
Posted (edited)

Kalu did you solve the issue with the dash symbol "-"?

I made some test and found that the dash "-" is considered as a space in the ps1.7.5 search module

so that is the modification we must found , where does the search consider the dash "-" as a space

 

Edited by nsm (see edit history)

Share this post


Link to post
Share on other sites
On 1/14/2018 at 1:10 AM, peter-D said:

Hi Mustang80,

We are also on PS 1.7.2.4 and had the same problem. 


With help of  tips at https://www.prestashop.com/forums/topic/597944-search-two-or-more-words/?tab=comments#comment-2631092

we modified the file classes/seach.php.  This solved the problem in our site. Seach is getting exact results now.

Attached the modified search.php file.  Rename the file to search.php and upload to your server.

Best regards,

Peter

PS-1.7.2-modified-for-or_Search.php

I used search.php in ps1.7.6 and it's worjing well for me

Share this post


Link to post
Share on other sites

Thanks but it seems to do nothing more, like the usual file 😢,

i replaced the search.php in www/classes/

i emptyd the cache, and rebuild the index.

 

Nothing change, when i search a reference like "demo_6" it will list all the demo refs !

Share this post


Link to post
Share on other sites

make sure you are using the correct setup in search index page 

Share this post


Link to post
Share on other sites
On 8/29/2019 at 12:46 AM, mir-aus said:

make sure you are using the correct setup in search index page 

can you share your search setup?  may it can help us to solve the dash issue

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More