I have tried both SimpleSearch and AdvSearch but haven't gotten anywhere.
Has anybody had success using either one of these snippets to search through the Gallery?
My website's info:
MODx 2.2.7
AdvSearch 1.0.1
SimpleSearch 1.6.1
AdvSearch
I've tried AdvSearch but had an error come up (below) once I put in &engine='Zend' into the snippet call. I've uploaded the Zend library that Coroico instructs us to use, but still no go:
Fatal error: Uncaught exception 'Zend_Search_Lucene_Exception' with message 'Index doesn't exists in the specified directory.'
I've also put the indexation.php file into the root of my directory. Does it matter that I'm working in a test context? I've edited the $id value on line 22 as instructed as well.
SimpleSearch
With SimpleSearch, I'm having an issue with the FacetHook snippet. I have no freakin' clue what I'm doing! I tried following the tutorial on the RTFM site, as well as trying to follow what I'm finding from other posts, but I'm obviously missing something.
What would I edit to make the following FacetHook snippet code search through the Gallery?
<?php
$c = $modx->newQuery('modUser');
$c->innerJoin('modUserProfile','Profile');
$c->where(array(
'username:LIKE' => '%'.$search.'%',
'OR:Profile.fullname:LIKE' => '%'.$search.'%',
'OR:Profile.email:LIKE' => '%'.$search.'%',
));
$count = $modx->getCount('modUser',$c);
$c->select(array(
'modUser.*',
'Profile.fullname',
'Profile.email',
));
$c->limit($limit,$offset);
$users = $modx->getCollection('modUser',$c);
$results = array();
foreach ($users as $user) {
$results[] = array(
'pagetitle' => $user->get('fullname'),
'longtitle' => $user->get('email'),
'link' => $modx->makeUrl(10,'',array(
'user' => $user->get('id'),
)),
'excerpt' => '',
);
}
$hook->addFacet('people',$results,$count);
return true;
Any help appreciated!
Sar