Jump to content

Search tuning


SergeiG
 Share

Recommended Posts

Hello!

Right now a quick search on my site (CC615) works in 'exact' mode:

I have several goods with the word 'Tales' in a title and several goods with 'tales' in a title. When I search for 'Tales' I receive only goods with 'Tales', search 'tales' gives results with 'tales'. When I search 'tale' or 'Tale', I receive results with 'Tales' and 'tales'.

However, I would like to receive results with 'Tales' and 'tales' in any kind of search ('Tales'/'tales'/'tale').

How can I switch search engine to 'like' mode?

P.S. I merged #1520, replace a piece of code according to Dirty Butter and bsmither comments from /topic/52298-resolved-a-space-messed-up-a-search/ .

Also I changed catalogue.class.php - replace fulltext on RLIKE in the line #1571  - 

public function searchCatalogue($search_data = null, $page = 1, $per_page = 10, $search_mode = 'fulltext')

But it makes results worse - I received results only for 'Tales' or 'tales' words, but not for 'tale'.

P.P.S. Unfortunately, I'm not a developer, so I can miss something obvious :-(

 

Link to comment
Share on other sites

To review, LIKE will find the given consecutive string of letters anywhere being searched. RLIKE will find that whole word. The search will not find anything less than the given consecutive string of letters.

So, tales is what is given, and these might be in the results: sportales, tales, or talespinner. But not anything less such as barkstale.

Link to comment
Share on other sites

14 minutes ago, bsmither said:

To review, LIKE will find the given consecutive string of letters anywhere being searched. RLIKE will find that whole word. The search will not find anything less than the given consecutive string of letters.

So, tales is what is given, and these might be in the results: sportales, tales, or talespinner. But not anything less such as barkstale.

Thank you for clarification. Actually, I'm more interested in switching search to non case-sensitive mode -  I want to receive same results 'Tales and tales' for search 'tales' or 'Tales'. Could it be possible?

Link to comment
Share on other sites

I think that is suppose to be how it happens.

Please verify: examine the schema of your database. For the CubeCart_inventory table, learn what the Collation for the table is set to. For a collation of "utf8_unicode_ci", the ci means "case insensitive" and should find any combination of the term's letters in upper or lower case.

With later versions of MySQL, you can override the table setting and set individual columns to a specific collation.

 

Link to comment
Share on other sites

19 hours ago, bsmither said:

I think that is suppose to be how it happens.

Please verify: examine the schema of your database. For the CubeCart_inventory table, learn what the Collation for the table is set to. For a collation of "utf8_unicode_ci", the ci means "case insensitive" and should find any combination of the term's letters in upper or lower case.

With later versions of MySQL, you can override the table setting and set individual columns to a specific collation.

 

Sorry, I found that my explanation of the problem is wrong! I missed very important condition.

I have case sensitivity issues with search on Russian. On English everything works fine ('tale'/'Tale' requests give the 'Tale'+'tale' result).

I checked the Collation - it is "utf8_unicode_ci"

Link to comment
Share on other sites

Collation is considered to be the subject of discussion in the context of properly sorting results. But in sorting, one needs to compare one letter against another. So, in comparing, one can also apply this to finding legitimate associations given certain rules.

The task here is finding both letter cases when either is specified when the rule says to accept letter-case associations.

The letter-case associations is called "case mappings". Unicode provides for that. http://www.unicode.org/versions/Unicode4.0.0/ch05.pdf#G21180

Here is an interesting discussion: http://stackoverflow.com/questions/297703/how-do-you-set-strings-to-uppercase-lowercase-in-unicode

Which prompts the question: does the implementation of Unicode by MySQL respect case mappings? Everything I read says, yes.

I have no direct experience with this, but I can experiment.

Link to comment
Share on other sites

22 hours ago, bsmither said:

Collation is considered to be the subject of discussion in the context of properly sorting results. But in sorting, one needs to compare one letter against another. So, in comparing, one can also apply this to finding legitimate associations given certain rules.

The task here is finding both letter cases when either is specified when the rule says to accept letter-case associations.

The letter-case associations is called "case mappings". Unicode provides for that. http://www.unicode.org/versions/Unicode4.0.0/ch05.pdf#G21180

Here is an interesting discussion: http://stackoverflow.com/questions/297703/how-do-you-set-strings-to-uppercase-lowercase-in-unicode

Which prompts the question: does the implementation of Unicode by MySQL respect case mappings? Everything I read says, yes.

I have no direct experience with this, but I can experiment.

I checked collation tables of "utf8_unicode_ci" for Russian and found that it has to work fine for my situation...

P.S. Could you be so kind to clarify me following. Does search function searches in 'title' and 'description' fields or only in the 'title'?

Edited by SergeiG
Link to comment
Share on other sites

An unmodified search function will look in 'name', 'product_code', and 'description' for search terms. The search will also filter for manufacturer, price (retail, sale, and customer group prices), and stock_level. Enhancements can be made via plugins and code snippets.

Link to comment
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.   Paste as plain text instead

  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.

 Share

×
×
  • Create New...