Page 1 of 1

Search function only works with exact match

Posted: Sun Apr 01, 2018 4:37 am
by cdamianou
Hi

I was wondering if anyone can help. I have realised that the search function only works with an exact match. Is there a way for the search to work irrespective of the word has a capital letter or not?

Thank you in advance.

Re: Search function only works with exact match

Posted: Sun Apr 01, 2018 4:42 am
by straightlight
No OC version posted.

Re: Search function only works with exact match

Posted: Sun Apr 01, 2018 4:49 am
by thekrotek
By default search in OC in indeed limited. There're plenty search related extensions, which expand functionality. I'd suggest you to find the one that suits you, especially if you're not into coding.

Re: Search function only works with exact match

Posted: Tue Apr 03, 2018 9:41 pm
by Johnathan
A default OpenCart installation is not case-sensitive for searching, so you must have some mod that changes that. Here's an example on my demo store (which won't have any extensions running) that shows it works with capital letters or lowercase letters:

http://demo.getclearthinking.com/index. ... search=mac

http://demo.getclearthinking.com/index. ... search=Mac

I'd suggest you start looking through mods you've installed, and disable any that you think might be affecting this. If you really can't figure it out, you could get Smart Search, which I can guarantee uses case-insensitive searching, or you could hire someone to take a look at the issue for you.

Re: Search function only works with exact match

Posted: Tue Apr 03, 2018 10:04 pm
by straightlight
The only location for product search that would be case-sensitive would be the product description field compared to other fields that may be lookup in the database since the LCASE function (lower case) is not being used with the default installation of OC. All other fields, so far, seem to use this function which would, then, be correct stating that the case-sensitive search does not matter at this point.

Re: Search function only works with exact match

Posted: Tue Apr 03, 2018 10:47 pm
by Johnathan
straightlight wrote:
Tue Apr 03, 2018 10:04 pm
The only location for product search that would be case-sensitive would be the product description field compared to other fields that may be lookup in the database since the LCASE function (lower case) is not being used with the default installation of OC. All other fields, so far, seem to use this function which would, then, be correct stating that the case-sensitive search does not matter at this point.

The searches still work because of the database collation (utf8_general_ci, where ci = case-insensitive). For example, see this search for a word in the product description, which is only capitalized, but still shows the right products:

http://demo.getclearthinking.com/index. ... ption=true

Re: Search function only works with exact match

Posted: Tue Apr 03, 2018 11:59 pm
by straightlight
True. CI does mean insensitive case. Then, the addressed issue cannot be about case-sensitive search unless the OP's database is not using the utf8_general_ci with his OC's database.