problem with multisearch

12 posts by 4 authors in: Forums > CMS Builder
Last Post: February 23, 2011   (RSS)

Re: [efi-revivo] problem with multisearch

By Dave - December 17, 2009

Hi efi-revivo,

So is the problem that when you search you are not getting the expected results?

When I search for "b" I get a result:
http://www.eilatnight.co.il/multiSearch.php?q=b

But this one does not give a result:
http://www.eilatnight.co.il/multiSearch.php?q=%D7%A0

Can you add this option and let me know what the output is:
$searchOptions['debugSql'] = "1";

You didn't change the character set on your database did you? (You would know if you did).
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] problem with multisearch

Hi dave,

my character set on database is unicode

this is the output
SELECT SQL_CALC_FOUND_ROWS * FROM (
SELECT 'design' as `tablename`, num, `title` as `_title`, `small` as `_summary`, '' as `field1`, '' as `field2`, '' as `field3`, '' as `field4`, '' as `field5`, '' as `field6`, '' as `field7`, '' as `field8`, '' as `field9`, '' as `field10`, CONCAT_WS('\t', `title`, `content`, `small`, `city`, `adress`) as _content FROM `cms_design`
) as combinedTable
WHERE (`_content` LIKE '%אפי�%')
AND (`_content` LIKE '%ט%')
LIMIT 10 OFFSET 0

Re: [efi-revivo] problem with multisearch

By Dave - December 17, 2009

Hmm, I'll have to research this more.

Can you send me CMS and FTP login details to dave@interactivetools.com. Note: Email, don't post login details to the forum.

Thanks!
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] problem with multisearch

ok

Re: [Dave] problem with multisearch

thanks dave it works great new :-)

Re: [efi-revivo] problem with multisearch

By hordak - February 16, 2011 - edited: February 16, 2011

Okay, so what did you do? I am experiencing the same problem. The only fields I can display are the _title & _summary fields. It looks like there's up to 10 fields available.

Re: [hordak] problem with multisearch

By Jason - February 17, 2011

Hi,

Could you please give some background on the kind of problem you're experiencing? If you can attach your .php code and give provide a URL example, that would be helpful.

thanks
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] problem with multisearch

By hordak - February 17, 2011

Sure,
I can't get the Multi Search code to echo the desired fields:
- Department;
- Phone;
- Fax;
- Email;
- URL;

I am only getting Department & Phone

the code so far looks like this....

<!-- STEP1: Load Record List (Paste this above other steps) -->
<?php
require_once "/home/centra24/public_html/cmsAdmin/lib/viewer_functions.php";
$searchOptions = array();
$searchOptions['keywords'] = @$FORM['q'];
$searchOptions['perPage'] = "10";
$searchOptions['debugSql'] = "0";

$searchTables = array();

$searchTables['sv_campus_directory'] = array(
'viewerUrl' => 'multiSearch.php',
'titleField' => 'department',
'summaryField' => 'phone',
'searchFields' => array('department','phone','fax'),
);

list($searchRows, $searchDetails) = searchMultipleTables($searchTables, $searchOptions);
?>
<!-- /STEP1: Load Record List -->

<h1>Search Viewer</h1>

<form method="GET" action="<?php echo $_SERVER['PHP_SELF']; ?>" >
<input type="text" name="q" value="<?php echo htmlspecialchars(@$FORM['q']); ?>" size="50">
<input type="submit" name="" value="Search"><br/><br/>

<table border=0 cellpadding=2 cellspacing=0 width=100%>
<tr>
<td bgcolor="#EEEEEE"><font size=2 class="maintext">Search results for <b><?php echo htmlspecialchars(@$FORM['q']); ?></b></font></td>
<td bgcolor="#EEEEEE" align="right"><font size=2 class="maintext">Results
<b><?php echo htmlspecialchars(@$searchDetails['pageResultsStart']); ?></b> to
<b><?php echo htmlspecialchars(@$searchDetails['pageResultsEnd']); ?></b> of
<b><?php echo htmlspecialchars(@$searchDetails['totalRecords']); ?></b>.</font></td>
</tr>
</table><br/>

<!-- show errors -->
<?php if ($searchDetails['invalidPageNum']): ?>
Results page '<?php echo $searchDetails['page']?>' not found, <a href="<?php echo $searchDetails['firstPageLink'] ?>">start over &gt;&gt;</a>.<br/>
<?php elseif ($searchOptions['keywords'] && $searchDetails['noRecordsFound']): ?>
No records matched search query!<br/><br/>
<?php elseif ($searchOptions['keywords'] == ""): ?>
Enter a keyword to search.<br/><br/>
<?php endif ?>

<!-- STEP2: Display Record List -->
<?php foreach ($searchRows as $record): ?>
<strong><?php echo $record['_title'] ?></strong><br/>
<?php if ($record['_summary']): ?>
<?php echo $record['_summary'] ?><br/>
<?php else: ?>
No description available for page.<br/>
<?php endif ?>

<a href="<?php echo $record['_link'] ?>" style="color: #008000"><?php echo $record['fax'] ?></a><br/><br/>

<?php endforeach ?>
<!-- /STEP2: Display Record List -->




<!-- STEP3: Display Page Links (Paste anywhere below "Load Record List") -->
<?php if ($searchDetails['prevPage']): ?>
<a href="<?php echo $searchDetails['prevPageLink'] ?>">&lt;&lt; prev</a>
<?php else: ?>
&lt;&lt; prev
<?php endif ?>

- page <?php echo $searchDetails['page'] ?> of <?php echo $searchDetails['totalPages'] ?> -

<?php if ($searchDetails['nextPage']): ?>
<a href="<?php echo $searchDetails['nextPageLink'] ?>">next &gt;&gt;</a>
<?php else: ?>
next &gt;&gt;
<?php endif ?>
<!-- /STEP3: Display Page Links -->

</form>


And my example is here....

http://www.centralstate.edu/services/contact/_includes/multiSearch.php

Re: [hordak] problem with multisearch

By Jason - February 17, 2011

Hi,

The multi search doesn't return all fields from all the tables being searched, so you can't output all of those fields using it.

I do notice in your code that you are only searching 1 table. In that case, you wouldn't want to use multi search as it is only for search multiple tables. You can use a regular getRecords query and then then output any fields you want.

For some searching options, try here:
http://www.interactivetools.com/docs/cmsbuilder/viewer_search.html

Hope this helps
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/