• 在我的boot锁中:
protected function _initLucene()
{ Zend_Search_Lucene::create(APPLICATION_PATH . /lucene )->setDefaultSearchField( userName ); }
在我的数据图表中:
public function test1() {
$lucene = Zend_Search_Lucene::open(APPLICATION_PATH . /lucene );
$document = new Zend_Search_Lucene_Document();
$document->addField(Zend_Search_Lucene_Field::Text( userName , someValue ));
$lucene->addDocument($document);
$lucene->commit();
return $lucene->count(); # returns 1, correct
}
public function test2() {
$lucene = Zend_Search_Lucene::open(APPLICATION_PATH . /lucene );
return $lucene->count(); # returns 0, incorrect!!
}
在我的索引库中:
public function indexAction() {
echo $myMapper->test1() # prints 1
}
public function testAction() {
echo $myMapper->test2() # prints 0 ??
}
如同Info,i 正在使用窗户/胎盘/x和z1.11。 因此,如果把我的浏览器首先引向指数/指数/指数,便可正确打印出1种,但当它继续引导/指数/测试时,电子格式不正确。 0. 是否有可能在不同的地点/职能中增加文件,找到()文件,因为正计划将文件放在试验行动和测试中?
please help me to identify the problem
p.s. i have tried the following:
- turning $myMapper to static
- moving the code from mapper to controller
两者无差别