MultiSearch
50 posts by 11 authors in: Forums > CMS Builder
Last Post: August 14, 2012 (RSS)
By jposwald - May 8, 2008
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
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!
interactivetools.com
Re: [Dave] MultiSearch
By jposwald - May 14, 2008
Re: [jposwald] MultiSearch
By Dave - May 14, 2008
interactivetools.com
Re: [Dave] MultiSearch
By jposwald - May 22, 2008
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.
Re: [jposwald] MultiSearch
By einslistir - May 22, 2008
Sorry, I just ask you this, and not have a solution to your problem, but I am not a programmer...
Re: [einslistir] MultiSearch
By jposwald - May 22, 2008
I hope Dave have the answer for my request.
Best Regards, Juan.
Re: [jposwald] MultiSearch
By Dave - May 22, 2008
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!
interactivetools.com
Re: [Dave] MultiSearch
By jposwald - May 23, 2008