Search

5 posts by 3 authors in: Forums > CMS Builder
Last Post: December 28, 2012   (RSS)

Hello,

I'd like to know if it's possible to have a search form that can return results for "widget" if "widgets" is typed (and vice versa).

I am finding that people are often searching using a plural word and currently no search results are being returned. However, if users search using the singular word then results are displayed.

I would be grateful for any guidance people can offer.

Thank you,
Greg

Hi Gregs,

Unless I've missed something, using the example you gave, if "widget" is entered,  the search code will return any title that contains the word "widget", so it will return records with things like xwidget and widgets and abcwidgetxyz in the title.

However, if "widgets" is entered as the search term, none of the above will be returned because none of them contains the word "widgets" (plural), which is only answers half of the question.

I saw suggestions for implementing the "like" function with wildcards, but I'm not sure how to do that and think it would cause other issues.

Not all words are pluralized by adding an (s) to the end of them ( party, parties) and simple words like "car" or "cars" might generate many unwanted results that contain the words car or cars.

There might have to be grammatical rules about lengths and ending S letters to sort things out, but even then, not all queries would necessarily be returned as desired.

Just my thoughts...

Best,

Jerry Kornbluth

The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

Hi guys,

Thanks for your messages!

I now see that the problem is not with the search keyword function that I am using. The problem is because there is no mention of "widgets" in my `cms_listings` table, which is the table being searched. All listings are simply labelled as "widget 100" or "widget 200".

"widgets" is however used as a category name, which is stored in a different table and I would like to be able to return all results from the "widgets" category or simply a link to the "widgets" category.

So I guess my next question is how can I have one search textfield that can return results from multiple tables... is that possible? Or is there a workaround you can suggest?

Thanks again,

Greg

Hi Greg,

Do  a search on the forum for multisearch

Jerry Kornbluth

The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php