DEDECMS v5.5 实现全文搜索功能的方法

dedecms 5.5 默认的模糊搜索只能根据网站文章的名称进行搜索,无法搜索到文章内部信息,对此经过研究得出以下修改方法,现共享下:

登入后台———-核心————频道模型——–内容模型管理—

—-普通文章—

—【点击后面那个放大镜标志】(最重要一步)———-

 

附件表可供自定义搜索的字段: 
这里的字段是程序依据字段类型自动选择生成的。

文章内容

 

将“文章内容”前面那个打勾

此时将修改掉搜索字段

但是还没有成功,还需要修改模板相应的代码:

修改模板文件中的: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">仅搜索标题</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" />   关键词:<input type="text" name="q" /> <input type="submit" name="submit" value="开始全文搜索" />    </div>   </form>

 

此时更新网站,将会发现搜索数据已经有了质的飞跃。

 

© 版权声明
THE END
喜欢就支持一下吧
点赞0 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容