About The Multisearch.php

6 posts by 3 authors in: Forums > CMS Builder
Last Post: May 18, 2017   (RSS)

By Damon - April 10, 2017

Hi Tom,

There is no fuzzy logic searching but you can get same results by entering keyword variations to each record.

What you could do is:
1. create a textbox or textfield in that section editor for search variation keywords.
2. add in the possible variations that users may search for:  abc-123, abc123 etc
3. the last step is to add the keywords field name to the 'searchFields' array.

Try this out and let me know if you have any questions.


Damon Edis - interactivetools.com

Hire me! Save time by getting our experts to help with your project.

By Tom - April 12, 2017

Thanks a lot Damon

By Tom - May 15, 2017 - edited: May 15, 2017


Sorry for trouble again.

I have created a field named ref_no1

And I intend to update the ref_no1 from ref_no

For example

In ref_no


Then in ref_no1


I know how to do it in php

echo preg_replace('/^([A-Za-z]+)([0-9]+)$/i', '$1-$2', $listingsRecord['ref_no']);

However I really don't know how to do it in mysql console to update the ref_no1 column.

Please advice.

Thanks a lot

By Dave - May 18, 2017

Hey Tom, 

As an alternate approach, if dashes aren't needed and you're always searching for ref_no values what about just removing dashes from the keyword the user searches for?  So if they search for ABC-123 or ABC123 or -ABC123- it all searches for ABC123?

$searchOptions['keywords'] = str_replace('-', '', @$_REQUEST['q']); // remove dashes

Hope that helps.

Dave Edis - Senior Developer

By Tom - May 18, 2017

Thanks a lot for your great help Dave.