新版本的dedecms5.01更改了默認的搜索模式,所以大家都反映搜索出來的結果不準確。
大家如果認真看一下高級搜索里面的:關鍵字模式: 或 與
如果關鍵字超過3個,用默認的“或”搜索出來的結果將很不準確,這時候如果用“與”來搜索看看,是不是就很準確了。
舉個例子:搜索“故鄉的親人”,http://chinaqupu.com.cn:8080/plus/heightsearch.php
用“或”來搜索,會出現500個結果,這時因為它默認把“故鄉的親人”自動的分為了“故鄉|的|親人”三個詞組,并把所有分別包含這3個詞組的標題都搜索出來了,所以結果就顯得非常不準確。
這時如果換成“與”再試試,只有5條結果,是不是很準確了?
再舉個例子:搜索“故鄉親人”,http://chinaqupu.com.cn:8080/plus/heightsearch.php
,用或來搜索,這次是不是結果少很多了,只有104條結果,這下明白怎么回事了嗎?
把模板中的搜索代碼:
<form action="{dede:global name='cfg_phpurl'/}/search.php" name="formsearch">
<input type="hidden" name="kwtype" value="0" />
<input name="keyword" id="keyword" type="text" class="searchtxt" />
<select name="searchtype" id="searchtype">
<option value="titlekeyword" selected>智能模糊搜索</option>
<option value="title">僅搜索標題</option>
</select>
<input type="image" src="{dede:field name='templeturl'/}/images/topsearch_submit.gif" />
</form>
修改成:
<form action="{dede:global name='cfg_phpurl'/}/search.php" name="formsearch">
<input type="hidden" name="kwtype" value="1" />
<input name="keyword" id="keyword" type="text" class="searchtxt" />
<select name="searchtype" id="searchtype">
<option value="titlekeyword" selected>智能模糊搜索</option>
<option value="title">僅搜索標題</option>
</select>
<input type="image" src="{dede:field name='templeturl'/}/images/topsearch_submit.gif" />
</form>
好了,趕緊試試結果是不是很準確了!~
官方原帖:http://bbs.dedecms.com/read.php?tid=52034&fpage=3
新聞熱點
疑難解答