调整搜索更新的次序
This commit is contained in:
parent
012c783e1c
commit
43d1f26b1a
|
@ -1851,7 +1851,17 @@ class AuthorController extends Zend_Controller_Action
|
||||||
$sth = $this->db->prepare($sql);
|
$sth = $this->db->prepare($sql);
|
||||||
$sth->execute(array($id));
|
$sth->execute(array($id));
|
||||||
$row = $sth->fetch();
|
$row = $sth->fetch();
|
||||||
|
|
||||||
|
//update search document
|
||||||
|
$search=new Search();
|
||||||
|
//create search view in xunsearch
|
||||||
|
//$sql="select m.uuid,m.title,m.description,x.data,array_to_string(ARRAY( SELECT keyword.keyword FROM keyword WHERE keyword.id = m.id), ', '::text) AS keyword from normalmetadata m left join xml x on m.id=x.id where m.uuid=?";
|
||||||
|
$sql="select * from xunsearch where uuid=?";
|
||||||
|
$sth = $this->db->prepare($sql);
|
||||||
|
$sth->execute(array($row['uuid']));
|
||||||
|
$data = $sth->fetch();
|
||||||
|
$search->update($data);
|
||||||
|
|
||||||
if (empty($row)) //无对应记录
|
if (empty($row)) //无对应记录
|
||||||
{
|
{
|
||||||
$sql="select m.id from metadata m left join mdversion v on m.uuid=v.uuid where v.id=?";
|
$sql="select m.id from metadata m left join mdversion v on m.uuid=v.uuid where v.id=?";
|
||||||
|
@ -2146,15 +2156,7 @@ class AuthorController extends Zend_Controller_Action
|
||||||
$this->jsonexit($data);
|
$this->jsonexit($data);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
//update search document
|
|
||||||
$search=new Search();
|
|
||||||
//create search view in xunsearch
|
|
||||||
//$sql="select m.uuid,m.title,m.description,x.data,array_to_string(ARRAY( SELECT keyword.keyword FROM keyword WHERE keyword.id = m.id), ', '::text) AS keyword from normalmetadata m left join xml x on m.id=x.id where m.uuid=?";
|
|
||||||
$sql="select * from xunsearch where uuid=?";
|
|
||||||
$sth = $this->db->prepare($sql);
|
|
||||||
$sth->execute(array($row['uuid']));
|
|
||||||
$row = $sth->fetch();
|
|
||||||
$search->update($row);
|
|
||||||
}catch(Exception $e) {
|
}catch(Exception $e) {
|
||||||
$msg = "提交失败,请确认权限后重试";
|
$msg = "提交失败,请确认权限后重试";
|
||||||
if($this->debug>0)
|
if($this->debug>0)
|
||||||
|
|
Loading…
Reference in New Issue