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