让Dedecms自带搜索实现全文检索(支持标题与内容)
<p><span style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'>登陆Dedecms 后台—核心—频道模型—内容模型管理—普通文章—点击后面那个放大镜标志(最重要一步)—附件表可供自定义搜索的字段,这里的字段是程序依据字段类型自动 选择生成的,将“文章内容”前面那个打勾,此时将修改掉搜索字段,但是还没有成功,还需要修改模板相应的代码。 </span><br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><span style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'>将模板文件head.htm 中的以下代码: </span></p>
<div class="msgheader" style='margin: 3px auto 0px; padding: 0px 3px; outline: none; line-height: 21.6px; clear: both; border-width: 1px; border-style: solid; border-color: rgb(0, 153, 204); background: rgb(246, 251, 255); overflow: hidden; font-family: tahoma, arial, "Microsoft YaHei";'>
<p class="right">
<span><u>复制代码</u></span></p>
<p>
代码如下:</p>
</div>
<p class="msgborder" style='margin: 0px auto 3px; padding: 0px 3px; outline: none; line-height: 25.2px; font-size: 14px; clear: both; border-right: 1px solid rgb(0, 153, 204); background: rgb(221, 237, 251); overflow: hidden; border-left: 1px solid rgb(0, 153, 204); word-break: break-all; border-bottom: 1px solid rgb(0, 153, 204); word-wrap: break-word; font-family: tahoma, arial, "Microsoft YaHei";'>
<br>
<form action="{dede:field name='phpurl'/}/search.php" name="formsearch"> <br>
<div class="form"> <br>
<h4>搜索</h4> <br>
<input type="hidden" name="kwtype" value="0" /> <br>
<input name="keyword" type="text" class="search-keyword" id="search-keyword" /> <br>
<select name="searchtype" class="search-option" id="search-option"> <br>
<option value="titlekeyword" selected='1'>智能模糊搜索</option> <br>
<option value="title">仅搜索标题</option> <br>
</select> <br>
<button type="submit" class="search-submit">搜索</button> <br>
</div> <br>
</form> </p>
<p>
<br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><span style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'>修改为: </span></p>
<div class="msgheader" style='margin: 3px auto 0px; padding: 0px 3px; outline: none; line-height: 21.6px; clear: both; border-width: 1px; border-style: solid; border-color: rgb(0, 153, 204); background: rgb(246, 251, 255); overflow: hidden; font-family: tahoma, arial, "Microsoft YaHei";'>
<p class="right">
<span><u>复制代码</u></span></p>
<p>
代码如下:</p>
</div>
<p class="msgborder" style='margin: 0px auto 3px; padding: 0px 3px; outline: none; line-height: 25.2px; font-size: 14px; clear: both; border-right: 1px solid rgb(0, 153, 204); background: rgb(221, 237, 251); overflow: hidden; border-left: 1px solid rgb(0, 153, 204); word-break: break-all; border-bottom: 1px solid rgb(0, 153, 204); word-wrap: break-word; font-family: tahoma, arial, "Microsoft YaHei";'>
<br>
<form action="/plus/advancedsearch.php" method="post"> <br>
<div class="form"> <br>
<h4>搜索</h4> <br>
<input type="hidden" name="mid" value="1" /> <br>
<input type="hidden" name="dopost" value="search" /> <br>
关键词:<input type="text" name="q" /> <input type="submit" name="submit" value="开始全文搜索" /></div> <br>
</form> </p>
<p>
<br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><span style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'>此时更新网站,将会发现搜索数据已经有了质的飞跃! </span><br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><span style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'>但同时带来的问题是,会降低效率。如果访问量过大不建议这样操作。</span></p>
頁:
[1]