Jump to content

[Resolved] Search facility - results to show singular and/or plural


sailing123

Recommended Posts

Hi

Looking at the search facility, found 2 interesting threads but I cannot deduct from reading these, whether any of the recommendations will resolve the issue of providing search results for singular and/or plural. At the moment, if I do not use the two words in my product description, ie socks and sock, the search results will only show the product listing that has the exact word in the description and miss the others.

S.

 

Link to comment
Share on other sites

I use a combination of both. The title would be plural with the description containing singular.

Even common mis spellings, for instance 'Holesaw' in the title, but 'Hole saw' in the description.

Whilst 'Hole saw' does catch a lot of rubbish, it does include the holesaw section.

Link to comment
Share on other sites

Here's the query template:

UPDATE tablename SET tablefield = replace(tablefield,"findstring","replacestring");

So to fix cat to add cats in the seo_meta_keywords:

UPDATE CubeCart_inventory SET seo_meta_keywords = replace(seo_meta_keywords,",cat,",cat,cats,");

I use the before and after commas to keep from messing up a word that might have cat in the spelling, like caterpillar or catch, for example.

I try to add potential misspellings for brands like FAO Scharz by using  http://www.watchcount.com/misspelled.php

 

Link to comment
Share on other sites

We have about 4500 products, so for obvious reasons, I can't edit every single item.

However, I do often look at products and decide if I ought to impliment some sort of mis spelling somewhere.

 

eg: Holesaw https://www.beal.org.uk/index.php?search[keywords]=holesaw&_a=category

hole saw https://www.beal.org.uk/index.php?search[keywords]=hole+saw&_a=category

I find that adding something a little differently in the description to the title works.

In fact, since writing this, I've found another one, which I'll impliment now.

If you now look at the following product, you'll spot that it has a number of spelling varioations for cabletie.

Cable Ties, Cableties, Cabletie and Cable Tie

https://www.beal.org.uk/electrical-products/cable-ties-bag-quantities-/cable-ties-100mm-x-2-5mm-black.html

 

Link to comment
Share on other sites

1 hour ago, Dirty Butter said:

Here's the query template:

UPDATE tablename SET tablefield = replace(tablefield,"findstring","replacestring");

So to fix cat to add cats in the seo_meta_keywords:

UPDATE CubeCart_inventory SET seo_meta_keywords = replace(seo_meta_keywords,",cat,",cat,cats,");

I use the before and after commas to keep from messing up a word that might have cat in the spelling, like caterpillar or catch, for example.

I try to add potential misspellings for brands like FAO Scharz by using  http://www.watchcount.com/misspelled.php

 

Hi Dirty Butter,

Sorry you lost me here. These queries, you mean by going into the phpadmin and work into the database tables, right ?

You then go into the inventory table, seo meta keywords column and amend each product line as required, am I correct ?

I do not have a table called TABLENAME, strange ?

S.

 

Link to comment
Share on other sites

Lets assume that you wish to update the description in the inventory table, then the query would go like this:

 

UPDATE `CubeCart_inventory`

SET `description` = replace(description, 'old phrase', 'new phrase')

 

DB's script is updating the meta keyworks section in the inventory table.

UPDATE `CubeCart_inventory`

SET ` seo_meta_keywords ` = replace(seo_meta_keywords,",cat,",cat,cats,");

 

She uses a number of words in the meta description section and then has a custom search script which includes meta keywords in it's search results.

The beauty of this is that potentially, all those mis spelled words are invisible to the end user.

Allegedly, keywords is no longer used in SEO, so in theory, should have no effect on the SEO score ???

Sorry, I ought to add, in PHPAdmin

Link to comment
Share on other sites

Sorry for not being clear with my directions. Yes in the phpMyAdmin Query.

This is a template that can be used with any table

UPDATE tablename SET tablefield = replace(tablefield,"findstring","replacestring");

I specifically use it with the seo_meta_keywords, because my customer search uses that field to search by. It doesn't matter how weird messy the keywords look, as the customer never sees any of it. That way I can keep the description and title worded decently.

For instance:

Quote

Eden,plush,lovy,lovey,lovie,soft,stuffed,yellow,elephant,elephants,musical,windup,You Are My Sunshine,head moves,turns,waggle,sunshine,pink,blue,white,tail,braid,pom pom,pompom,flannel,nose,trunk,braided,vintage

 

Link to comment
Share on other sites

Thanks everyone. After looking closely at the code amendments which date back, a lot has since changed. As I am using the latest version, V6.1.5, I realised that actually not much needed amending, especially for using the redundant Seo Meta Keywords function to fill with mis-spellings, singular, plural, etc.

I had to make only 2 changes:

FIND:

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

REPLACE WITH:

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

FIND:

$like = " AND (I.name ".$like_keyword." '".$regexp."' OR I.description ".$like_keyword." '".$regexp."' OR I.product_code ".$like_keyword." '".$regexp."')";

REPLACE WITH:

$like = " AND (I.name ".$like_keyword." '".$regexp."' OR I.description ".$like_keyword." '".$regexp."' OR I.product_code ".$like_keyword." '".$regexp."' OR I.seo_meta_keywords ".$like_keyword." '".$regexp."')";

Just tested with 2 products and worked just fine :-)

Link to comment
Share on other sites

There is a PHP script that you can run which will populate the meta keywords based on whats already in the description.

Whilst it won't help with the mis spellings, it would assist with at least populating the meta keywords fields with something, which you could potentailly work on using the replace script above.

https://www.cubecart.com/extensions/other/automatically-generate-meta-description-keyword

This will of course assist with SEO as it will also populate the meta description.

Win Win.

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.

×
×
  • Create New...