fix #442, 优化全文搜索功能,在数据库中新建xunsearch视图

This commit is contained in:
wlx 2012-12-26 05:59:03 +00:00
parent 3098e6f2f3
commit 2d32af9077
3 changed files with 5 additions and 3 deletions

View File

@ -71,7 +71,7 @@
<li class="item">
<a href="/data/advancesearch">高级搜索</a>
</li>
<li class="item"><form id="search" enctype="application/x-www-form-urlencoded" action="/data/search" method="post">
<li class="item"><form id="search" enctype="application/x-www-form-urlencoded" action="/search" method="get">
<input type="text" name="q" id="q" value="回车搜索标题和摘要" onfocus="myfocus(this);" onblur="myblur(this);">
<input type="hidden" name="submit" value="submit">
</form></li>

View File

@ -141,7 +141,8 @@ $search=$this->search;
</h2>
<p><?php echo $search->highlight(htmlspecialchars($doc->description)); ?></p>
<ul>
<li><span>metadata:</span> <?php echo $search->highlight(htmlspecialchars($doc->data)); ?></li>
<li><span>关键词:</span> <?php echo $search->highlight(htmlspecialchars($doc->keyword)); ?></li>
<li><span>元数据:</span> <?php echo $search->highlight(htmlspecialchars($doc->data)); ?></li>
</ul>
</div>
<?php endforeach; ?>

View File

@ -6,7 +6,8 @@ class SearchForm extends Zend_Form
{
parent::__construct($options);
$this->setName('search');
$this->setAction('/data/search');
$this->setAction('/search');
$this->setMethod('get');
$q = new Zend_Form_Element_Text('q');
$q->setRequired(true)