English 中文(简体)
Zend_Search_Lucene在另一个地方添加文件后失败
原标题:Zend_Search_Lucene count() failed after addDocument() in another place

• 在我的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

两者无差别

最佳回答

问题!

• 在boot锁上 t子,因此,你不得不在其他地方 in。 在我的案件中,一是使用索引管理员的()中:

问题回答

暂无回答




相关问题
Zend 邮件问题,涉及外国char子+ com子

泽斯德邮局在名称被定为具有外国性质(如“保”)和 com(”)的物品时,就放弃了一种例外(因为邮局(邮局)退回假)。 重新提出以下守则。

PHP Framework: Ebay Like Site

I am going to be builiding a site like ebay - with all the features of ebay. Please note my payment method is limited to paypal. What would be the best PHP framework to use to build this quickly, ...

Link to a specific step in onepage checkout

Is it possible to redirect the browser to nth step in the onepage checkout? If so, how would one go about doing it? I m working on a payment module and have a sort of "cancel" action that i would ...

Tagging with Zend Framework

I m trying to create the same solutions as below, but using a simple MySQL query (instead of the static version used below where the words/tags are implemented in the code). The name of the MySQL ...

dynamicaly adding textboxes to zend_form

I hope that this is a quick question to answer. I am developing a form using Zend_Form, I have a number of Zend_Dojo_Form_Element_Textboxs to add to this form dynamically. These are added from rows ...

热门标签