class Projects_TestControl ler extends Zend_Controller_Acti on public

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
class Projects_TestController extends Zend_Controller_Action
{
public function init()
{
$this->_helper->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender(true);
}
public function indexAction()
{
error_reporting(E_ALL);
ini_set('display_errors', 'On');
$query = 'org_country:"United States"';
$index = Zend_Search_Lucene::open(APPLICATION_PATH.'/../data/search-index');
$hits = $index->find(Zend_Search_Lucene_Search_QueryParser::parse($query,'utf-8'));
echo empty($hits);
//Zend_Debug::dump($hits);
foreach($hits as $k => $v) {
static $iterator = 0;
// if($iterator > 50)break;
//var_dump($v);
echo $v->project_id . ' ' . $v->project_number . ',' . $v->project_title . ', ' . $v->org_country . "\r\n";
// echo $v->project_number . ',' . $v->org_country . "\r\n";
$iterator++;
}
}
}