lucalg Posted April 11, 2014 Share Posted April 11, 2014 Hallo, i'm working from 2 weeks with presta 1.6 coming from older versions. I think is good but i got a problem. I'm preparing a site to sell toner and inkjet cartridges. I index all the products and i got no error. I make an example to explain what's happens: i got a product that hasi in description "TONER CARTRIDGE FOR HP 1010 - OEM CODE Q2612A" if i search for 1010 i find it if i search for q2612a i find it if i search for 2612 no result It works in "like" mode but it seems that it wants a complete word. This is a big problem becaouse I can't be sure about the customer will search for. Can anybody help? Tnx Luca Link to comment Share on other sites More sharing options...
stottycabanas Posted April 11, 2014 Share Posted April 11, 2014 The search in prestashop takes the search terms you enter and tries to match with whole words or words that begin with the search term. In your example, it will find no words beginning with 2612. Cheers, Dave Link to comment Share on other sites More sharing options...
lucalg Posted April 12, 2014 Author Share Posted April 12, 2014 Hallo Dave, Thank you for you answer. I understand what you say but i need to solve this problem. Is there anybody solved this issue? Tnx Luca Link to comment Share on other sites More sharing options...
NemoPS Posted April 12, 2014 Share Posted April 12, 2014 Yes, you can edit the find() method of the search.php class, lines 207, 208 ? ' \''.pSQL(Tools::substr($word, 1, PS_SEARCH_MAX_WORD_LENGTH)).'%\'' : '\''.pSQL(Tools::substr($word, 0, PS_SEARCH_MAX_WORD_LENGTH)).'%\'' CHange it to ? ' \'%'.pSQL(Tools::substr($word, 1, PS_SEARCH_MAX_WORD_LENGTH)).'%\'' : '\'%'.pSQL(Tools::substr($word, 0, PS_SEARCH_MAX_WORD_LENGTH)).'%\'' Please note that your search might become slower 1 Link to comment Share on other sites More sharing options...
lucalg Posted April 14, 2014 Author Share Posted April 14, 2014 Good morning Nemo1. Thank you very much for the support. Your modify has fixed succesfully my problem. The searching is not slow and it search for he minimum detail. Thank you again, Luca Link to comment Share on other sites More sharing options...
mushino Posted April 27, 2014 Share Posted April 27, 2014 Thanks also from me Nemo1. Link to comment Share on other sites More sharing options...
danr87 Posted May 9, 2014 Share Posted May 9, 2014 Thanks. Worked for me too. I have about 500 products, and the search works fast with this modification. In my case, the problem was that i would search for : Nokia X6 or nokia x7 or anything with an X, and would not come up at all. Now it works. Link to comment Share on other sites More sharing options...
leecharles Posted May 10, 2014 Share Posted May 10, 2014 Hi Guys this would be useful for me where can I find the file? Regards, Lee Link to comment Share on other sites More sharing options...
[email protected]. Posted May 10, 2014 Share Posted May 10, 2014 Hi, I hope someone can help please, I am using 1.4.4.1 the search function is not working at all, can anyone help please. Alex Link to comment Share on other sites More sharing options...
NemoPS Posted May 12, 2014 Share Posted May 12, 2014 Hi, I hope someone can help please, I am using 1.4.4.1 the search function is not working at all, can anyone help please. Alex You should probably open a new topic and specify type of issues you're having Link to comment Share on other sites More sharing options...
[email protected]. Posted May 16, 2014 Share Posted May 16, 2014 I am sorry I can't even find where to open a topic.. ? Link to comment Share on other sites More sharing options...
NemoPS Posted May 17, 2014 Share Posted May 17, 2014 From a forum subsection, where you see threads, in the top right you have "Start a new topic" Link to comment Share on other sites More sharing options...
hkao Posted May 19, 2014 Share Posted May 19, 2014 Hi, I am using Prestashop 1.5.3.1 with multi store, the product search works, the only thing I like to see is: how can I get the searched product on the sub store that owns it? For example, I search a product on the main store, it does find the product, but the page still stays on the main store in stead it should go to the sub store that owns this product. Can somebody help? Thanks in advanced. Link to comment Share on other sites More sharing options...
NemoPS Posted May 20, 2014 Share Posted May 20, 2014 What do you exactly mean by substore? Link to comment Share on other sites More sharing options...
Lorellas Posted May 20, 2014 Share Posted May 20, 2014 Nemo1 Hello, I'm sorry to bother you, but where do I find the file to edit as you described, I have not figured out where to find it?? Thank you very much. Link to comment Share on other sites More sharing options...
NemoPS Posted May 20, 2014 Share Posted May 20, 2014 Search.php, inside classes/ Link to comment Share on other sites More sharing options...
Lorellas Posted May 20, 2014 Share Posted May 20, 2014 1 Hello Nemo, I found the files that you tell me, manon difference I see from what you've posted, compared to what I have?? Link to comment Share on other sites More sharing options...
hkao Posted May 20, 2014 Share Posted May 20, 2014 What do you exactly mean by substore? Hi, Nemo1 Thank for your interests in response, my main store is (for example) www.mystore.com, and other "substore" is www.mystore.com/store1/. when I search (on the www.mystore.com) the product which is belonged to the store1, yes, I can find it, but the search result sits on the www.mystore.com page. I am wondering is there a way that the search result can be on the www.mystore.com/store1. So people can actually know which store has this product. Link to comment Share on other sites More sharing options...
NemoPS Posted May 21, 2014 Share Posted May 21, 2014 1 Hello Nemo, I found the files that you tell me, manon difference I see from what you've posted, compared to what I have?? THose are the lines, correct. They are different, notice the % symbols preceding words in my snippet Hi, Nemo1 Thank for your interests in response, my main store is (for example) www.mystore.com, and other "substore" is www.mystore.com/store1/. when I search (on the www.mystore.com) the product which is belonged to the store1, yes, I can find it, but the search result sits on the www.mystore.com page. I am wondering is there a way that the search result can be on the www.mystore.com/store1. So people can actually know which store has this product. Ah no, that's normal, you cannot achieve that with the default search Link to comment Share on other sites More sharing options...
nutxlago Posted September 3, 2014 Share Posted September 3, 2014 Hi, Nemo1, I have an issue with PS 1.6.0.9 version. Ajax search box on top is not working. I have made the changes someone proposed on other threads for a previous 1.5.5 version: enabling/disabling search in top menu, activating/deactivating ajax search block. But nothing changes. Result is always the same: 0 records found. Could you or someone else help me with this issue. I am not the only one with this problem (http://www.prestashop.com/forums/topic/355185-problem-with-the-search-box/?view=findpost&p=1785303) Link to comment Share on other sites More sharing options...
trevorgilligan Posted February 11, 2015 Share Posted February 11, 2015 thanks for reply @nemo1 . is there any way to search the description text as well as the title. i.e. title "ProductA" . desc has "blah blah sports blah blah". search term "i like sports" to show "ProductA"? thank you Link to comment Share on other sites More sharing options...
trevorgilligan Posted February 11, 2015 Share Posted February 11, 2015 so i think what im looking for is to search for more than 1 word. and for any of those words to be present in product or description. search "product" works fine but "product ireland " or "dublin product" doesnt return any results.... can i set this and to have "OR" or || set somewhere in PS Code? Link to comment Share on other sites More sharing options...
NemoPS Posted February 13, 2015 Share Posted February 13, 2015 Well yes, it should search in the description as well if it has weight in the preferences > search setting (bottom) You can try this, in search.php, find() method$eligible_products = array_intersect($eligible_products, $eligible_products2);Set it to array_merge, but notice search results will be more loose 1 Link to comment Share on other sites More sharing options...
trevorgilligan Posted February 13, 2015 Share Posted February 13, 2015 hi thanks nemo, with this code, will i be able to search "abc productName xyz" and search will work? have a nice weekend. Link to comment Share on other sites More sharing options...
NemoPS Posted February 14, 2015 Share Posted February 14, 2015 Probably, you should try it out as I didn't 1 Link to comment Share on other sites More sharing options...
mareksmareks Posted February 15, 2015 Share Posted February 15, 2015 Hello. We have little issue with search too. We have Latest 1.6.11 version. WE try to find "H-8" and it finds nothing when we have product named "Bāra krēsls H-8" and reference code is also set to "H-8" If we change reference code to "H8" then search can find it. So probably there is some issue with symbol "-". But it would be very important to have it with symbol "-". Tried solutions mentioned above but did not work. Here is product - mebelestev.lv/lv/bara-kresli/bara-kresls-h-8.html And here is search result - http://mebelestev.lv/lv/meklet?controller=search&orderby=position&orderway=desc&search_query=h-8&submit_search= Link to comment Share on other sites More sharing options...
NemoPS Posted February 16, 2015 Share Posted February 16, 2015 Yes, the dash problem has been affecting prestashop since earlier version. I must admit I tried a bunch of solutions but couldn't find a proper one but modifying the sanitize() method of the search class, should be this line $string = ltrim(preg_replace('/([^ ])-/', '$1 ', ' '.$string)); I can't recall what I exactly did though, at the moment 1 Link to comment Share on other sites More sharing options...
mareksmareks Posted February 16, 2015 Share Posted February 16, 2015 If you renember, please let me know! 1 Link to comment Share on other sites More sharing options...
Recommended Posts