{"id":201,"date":"2015-03-09T05:15:40","date_gmt":"2015-03-09T05:15:40","guid":{"rendered":"http:\/\/angelwings.net\/blog\/?p=201"},"modified":"2015-03-09T05:15:40","modified_gmt":"2015-03-09T05:15:40","slug":"prestashop-allow-wildcard-search","status":"publish","type":"post","link":"https:\/\/angelwings.net\/blog\/prestashop-allow-wildcard-search\/","title":{"rendered":"Prestashop: Allow wildcard search"},"content":{"rendered":"<p>Source: https:\/\/www.prestashop.com\/forums\/topic\/280306-native-prestashop-search-module-issuessolved-casesimprovementsother\/<br \/>\nThe search index indexes on individual words and as it is now, wants you to give a search word from the beginning of the word.<\/p>\n<p>To fix this, we need to edit the file Classes\/Search.php<\/p>\n<pre>to fix this, change the code a little like this: (find the lines in the code above and add the % three times:\n\n...\n? ' \\'%'.pSQL(Tools::substr($word, 1, PS_SEARCH_MAX_WORD_LENGTH)).'%\\''\n: '\\'%'.pSQL(Tools::substr($word, 0, PS_SEARCH_MAX_WORD_LENGTH)).'%\\''\n);\n\nif ($word[0] != '-')\n $score_array[] = 'sw.word LIKE \\'%'.pSQL(Tools::substr($word, 0, PS_SEARCH_MAX_WORD_LENGTH)).'%\\'';\n...<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Source: https:\/\/www.prestashop.com\/forums\/topic\/280306-native-prestashop-search-module-issuessolved-casesimprovementsother\/ The search index indexes on individual words and as it is now, wants you to give a search word from the beginning of the word. To fix this, we need to edit the file Classes\/Search.php to fix this, change the code a little like this: (find the lines in the code above and [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[103,105],"class_list":["post-201","post","type-post","status-publish","format-standard","hentry","category-ecommerce","tag-prestashop","tag-prestashop-1-6"],"_links":{"self":[{"href":"https:\/\/angelwings.net\/blog\/wp-json\/wp\/v2\/posts\/201","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/angelwings.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/angelwings.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/angelwings.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/angelwings.net\/blog\/wp-json\/wp\/v2\/comments?post=201"}],"version-history":[{"count":0,"href":"https:\/\/angelwings.net\/blog\/wp-json\/wp\/v2\/posts\/201\/revisions"}],"wp:attachment":[{"href":"https:\/\/angelwings.net\/blog\/wp-json\/wp\/v2\/media?parent=201"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/angelwings.net\/blog\/wp-json\/wp\/v2\/categories?post=201"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/angelwings.net\/blog\/wp-json\/wp\/v2\/tags?post=201"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}