But is it possible to "merge" the search?With the version 1.8.1 it is possible to search in several tables (modx or owntable) BUT the limitation are the followings:
I want to search in two or more tables (owntable and the modx-tables) at the same time
case ’maxigallery’:The maxigallery as a joined table has a "join" key (= gal_id) used to do the link with the "main" key (= id) of the main table (site_content).
$this->joined[] = array(
’tb_name’ => $this->getShortTableName(’maxigallery’),
’tb_alias’ => ’gal’,
’id’ => ’id’,
’main’ => ’id’,
’join’ => ’gal_id’,
’searchable’ => array(’title’,’descr’),
’displayed’ => array(’title’,’descr’,’filename’),
’concat_separator’ => ’, ’,
’filters’ => array()
);
I want to search in two or more tablesare these tables joined or not ?
<?php
function catalog(& $main,& $joined, $listIDs){
$main = array(
’tb_name’ => "ext_products",
’tb_alias’ => ’catalias’,
’id’ => ’id’,
’searcheable’ => array(’name’,’description’),
’displayed’ => array(’id’,’name’,’description’),
’date’ => array(),
’filters’ => array(),
’jfilters’ => array()
);
$main[’filters’][]= array(
’field’ => ’available’,
’oper’ => ’=’,
’value’ => "1"
);
$joined = NULL;
}
?>
[!AjaxSearch? &ajaxSearch=`0` &whereSearch=`catalog` &config=`catalog` &tplResult=`@FILE:assets/snippets/ajaxSearch/templates/catalogresult.tpl.html` &order=`id` highlight=`1` &AS_landing=`33` &extract=`0`!]
[2-Jun-09 01:07:31] AjaxSearch 1.8.1 - Php5.2.9 - MySql 5.0.77-log
[2-Jun-09 01:07:31] AjaxSearch - Configuration file catalog :
<?php
function catalog(& $main,& $joined, $listIDs){
$main = array(
'tb_name' => "ext_products",
'tb_alias' => 'catalias',
'id' => 'id',
'searcheable' => array('name','description'),
'displayed' => array('id','name','description'),
'date' => array(),
'filters' => array(),
'jfilters' => array()
);
$main['filters'][]= array(
'field' => 'available',
'oper' => '=',
'value' => "1"
);
$joined = NULL;
}
?>
[2-Jun-09 01:07:31] AjaxSearch - User configuration - Before parameter checking : Array
(
[config] => catalog
[version] => 1.8.1
[debug] => 3
[language] => russian-UTF8
[ajaxSearch] => 0
[advSearch] => oneword
[whereSearch] => catalog
[subSearch] => 5,1
[withTvs] =>
[order] => id
[rank] => pagetitle:100,extract
[minChars] => 3
[AS_showForm] => 1
[resultsPage] => 0
[grabMax] => 10
[extract] => 0
[extractLength] => 200
[extractEllips] => ...
[extractSeparator] => <br />
[formatDate] => d/m/y : H:i:s
[highlightResult] => 1
[pageLinkSeparator] => |
[AS_landing] => 33
[AS_showResults] => 1
[idType] => parents
[parents] =>
[documents] =>
[depth] => 10
[hideMenu] => 2
[hideLink] => 1
[filter] =>
[tplLayout] => @FILE:assets/snippets/ajaxSearch/templates/cataloglayout.tpl.html
[tplResults] => @FILE:assets/snippets/ajaxSearch/templates/results.tpl.html
[tplResult] => @FILE:assets/snippets/ajaxSearch/templates/catalogresult.tpl.html
[tplPaging] => @FILE:assets/snippets/ajaxSearch/templates/paging.tpl.html
[stripInput] => defaultStripInput
[stripOutput] => defaultStripOutput
[searchWordList] =>
[breadcrumbs] => 0
[tvPhx] => 0
[clearDefault] => 0
[jsClearDefault] => assets/snippets/ajaxSearch/js/clearDefault.js
)
[2-Jun-09 01:07:31] AjaxSearch - tplResult template @FILE:assets/snippets/ajaxSearch/templates/catalogresult.tpl.html : <div class="[+as.nameClass+]">
<p>[+as.id+] --- [+as.name +]-------[+as.description+]</p>
</div>
[2-Jun-09 01:07:31] AjaxSearch - tplResults template@FILE:assets/snippets/ajaxSearch/templates/results.tpl.html : [+as.noResults:is=`1`:then=`
<div class="[+as.noResultClass+]">
[+as.noResultText+]
</div>
`:else=`
<p class="ajaxSearch_resultsInfo">[+as.resultInfoText+]</p>
[+as.paging+]
[+as.listResults+]
[+as.paging+]
`+]
[2-Jun-09 01:07:31] AjaxSearch - tplResult template@FILE:assets/snippets/ajaxSearch/templates/cataloglayout.tpl.html : [+as.showForm:is=`1`:then=`
<form [+as.formId+] action="[+as.formAction+]" method="post">
<fieldset>
<label for="ajaxSearch_input">
<input id="ajaxSearch_input" class="cleardefault" type="text" name="search" value="[+as.inputValue+]"[+as.inputOptions+] />
</label>
<label for="ajaxSearch_submit">
<input id="ajaxSearch_submit" type="submit" name="sub" value="[+as.submitText+]" />
</label>
</fieldset>
</form>
`+]
[+as.showIntro:is=`1`:then=`
<p class="ajaxSearch_intro" id="ajaxSearch_intro">[+as.introMessage+]</p>
`+]
[+as.showResults:is=`1`:then=`
[+as.results+]
`+]
[2-Jun-09 01:07:31] AjaxSearchPopup - User configuration - Before doSearch : Array
(
[config] => catalog
[version] => 1.8.1
[debug] => 3
[language] => russian-UTF8
[ajaxSearch] => 0
[advSearch] => oneword
[whereSearch] => catalog
[subSearch] => 5,1
[withTvs] =>
[order] => id
[rank] => pagetitle:100,extract
[minChars] => 3
[AS_showForm] => 1
[resultsPage] => 0
[grabMax] => 10
[extract] => 0:content
[extractLength] => 200
[extractEllips] => ...
[extractSeparator] => <br />
[formatDate] => d/m/y : H:i:s
[highlightResult] => 1
[pageLinkSeparator] => |
[AS_landing] => 33
[AS_showResults] => 1
[idType] => parents
[parents] =>
[documents] =>
[depth] => 10
[hideMenu] => 2
[hideLink] => 1
[filter] =>
[tplLayout] => @FILE:assets/snippets/ajaxSearch/templates/cataloglayout.tpl.html
[tplResults] => @FILE:assets/snippets/ajaxSearch/templates/results.tpl.html
[tplResult] => @FILE:assets/snippets/ajaxSearch/templates/catalogresult.tpl.html
[tplPaging] => @FILE:assets/snippets/ajaxSearch/templates/paging.tpl.html
[stripInput] => defaultStripInput
[stripOutput] => defaultStripOutput
[searchWordList] =>
[breadcrumbs] => 0
[tvPhx] => 0
[clearDefault] => 0
[jsClearDefault] => assets/snippets/ajaxSearch/js/clearDefault.js
[listIDs] =>
[docgrp] =>
)
[2-Jun-09 01:07:31] Search context main ext_products : Array
(
[tb_name] => ext_products
[tb_alias] => catalias
[id] => id
[searcheable] => Array
(
[0] => name
[1] => description
)
[displayed] => Array
(
[0] => id
[1] => name
[2] => description
)
[date] => Array
(
)
[filters] => Array
(
[0] => Array
(
[field] => available
[oper] => =
[value] => 1
)
)
[jfilters] => Array
(
)
)
[2-Jun-09 01:07:31] Select :
SELECT catalias.id, catalias.id, catalias.name, catalias.description
FROM ext_products catalias
WHERE ((catalias.available=1))
GROUP BY catalias.id
HAVING 1
ORDER BY catalias.id
[2-Jun-09 01:07:31] AjaxSearch - tplResult template @FILE:assets/snippets/ajaxSearch/templates/paging.tpl.html : [+as.tpl:is=`paging`:then=`
<span class="ajaxSearch_paging">
[+as.pagingText+]
[+as.pagingLinks+]
</span>
`+]
[+as.tpl:is=`pagingLinks`:then=`
<a href="[+as.pagingLink+]">[+as.pagingText+]</a>[+as.pagingSeparator+]
`+]
[+as.tpl:is=`pagingLinksCurrent`:then=`
[+as.pagingText+][+as.pagingSeparator+]
`+]
[2-Jun-09 01:07:31] AjaxSearchPopup - Output results before ranking : Array
(
[id] => 2
[name] => Iphone 3G
[description] => Though there are still some big features missing from the iPhone, the addition of 3G and GPS, the affordable price tag, and extra features from the iPhone 2.0 software update make the handset a worthy prospect.
[extract] =>
)
[2-Jun-09 01:07:31] AjaxSearchPopup - Output results before ranking : Array
(
[id] => 3
[name] => Palm Treo 750
[description] => A bevy of OS enhancements and access to Telstra's Next G mobile broadband network easily make the Treo 750 the best Windows Mobile device we've ever used.
[extract] =>
)
[2-Jun-09 01:07:31] AjaxSearchPopup - Output results before ranking : Array
(
[id] => 4
[name] => Nokia E90
[description] => Nokia's E90 smartphone is the latest in the Communicator series, featuring HSDPA support, inbuilt GPS and Wi-Fi.
[extract] =>
)
........................