織夢Dedecms默認(rèn)的模糊搜索只能根據(jù)網(wǎng)站文章的名稱進行搜索,無法搜索到文章內(nèi)部信息,下面講一下如何讓Dedecms自帶搜索實現(xiàn)全文檢索:
1、后臺-->核心-->頻道模型-->內(nèi)容模型管理 -->普通文章-->點擊后面那個放大鏡標(biāo)志(最重要一步)-->附件表可供自定義搜索的字段,這里的字段是程序依據(jù)字段類型自動選擇 生成的,將“文章內(nèi)容”前面那個打勾,此時將修改掉搜索字段,但是還沒有成功,還需要修改
模板相應(yīng)的代碼。
2、將模板文件 head.htm 中的以下代碼:
<form action="{dede:field name='phpurl'/}/search.php" name="formsearch">
<div class="form">
<h4>搜索</h4>
<input type="hidden" name="kwtype" value="0" />
<input name="keyword" type="text" class="search-keyword" id="search-keyword" />
<select name="searchtype" class="search-option" id="search-option">
<option value="titlekeyword" selected='1'>智能模糊搜索</option>
<option value="title">僅搜索標(biāo)題</option>
</select>
<button type="submit" class="search-submit">搜索</button>
</div>
</form>
修改為
<form action="/plus/advancedsearch.php" method="post">
<div class="form">
<h4>搜索</h4>
<input type="hidden" name="mid" value="1" />
<input type="hidden" name="dopost" value="search" />
關(guān)鍵詞:<input type="text" name="q" /> <input type="submit" name="submit" value="開始全文搜索" /></div>
</form>