MultiSearch

50 posts by 11 authors in: Forums > CMS Builder
Last Post: August 14, 2012   (RSS)

By jposwald - May 8, 2008

Dave,

I downloaded the multiSearch.php file.

How can I make a search box to all pages and the results being displayed in Search.php? Is that possible? Also, is there an option to put in the code which sections will be searched?

Best Regards, Juan.

Re: [jposwald] MultiSearch

By Dave - May 8, 2008

Hi Juan,

You can add a search box to all your pages with some code like this:

<form method="GET" action="/path/to/your/search.php">
<input type="text" name="q" value="" size="50">
<input type="submit" name="" value="Search"><br/><br/>
</form>


And you can edit multiSearch.php (or search.php if you renamed it that) and add section with a block of code like this:

$searchTables['quotes'] = array(
'viewerUrl' => 'quotesPage.php',
'titleField' => 'name',
'summaryField' => 'quote',
'searchFields' => array('name','pullQuote','quote'),
);


You'll see a few of those in there. Just erase the ones you don't want and add one for each section you want to search.

This is a new feature so it's a little code heavy. In future we'll likely add some menus to automatically generate a multi section search engine.

Hope that helps!
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] MultiSearch

By jposwald - May 14, 2008

Great!, I have a doubt, can I highlight entered search box keyword in search results?

Re: [jposwald] MultiSearch

By Dave - May 14, 2008

No, it doesn't highlight the keyword in the search results. And it only shows the summary field content, not little snippets of text from all the fields that match (like google does).
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] MultiSearch

By jposwald - May 14, 2008

:( let's add it to next features of CMS!

Re: [Dave] MultiSearch

By jposwald - May 22, 2008

Dave I have a problem with my Search page.

I'm testing it putting keywords that are in tables but it tells me "no results has found"

http://www.worldwidetrainings.com/Search.php

Meaby there is a little error, but I think I did it right because after to put all arrays it worked (when I had only 2 arrays to search)

I attached you Search.php

Thank you for your help, Juan.
Attachments:

search.php 34K

Re: [einslistir] MultiSearch

By jposwald - May 22, 2008

Thank you, drop down menu are CSS, dynamic.

I hope Dave have the answer for my request.

Best Regards, Juan.

Re: [jposwald] MultiSearch

By Dave - May 22, 2008

Hi Juan,

It looks like the top search box is working but not the middle one. I think that's because in the search.php it's looking for a field named "q" and the top field is named "q" but the second one is named "q2". Can you rename the second one to "q" as well?

Here's a working link:
http://www.worldwidetrainings.com/Search.php?q=training

Hope that helps!
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] MultiSearch

By jposwald - May 23, 2008

It only Search in footer_ array, could be because is there a limit to search arrays?