emlog搜索时搜索文章内容

Published by minc_nice_100 on

emlog的内置搜索程序默认仅支持搜索标题,我们需要让其一并检索文章内容.

  1. 打开\include\controller\search_controller.php
emlog搜索时搜索文章内容
emlog搜索时搜索文章内容
  1. 找到
    $sqlSegment = "and title like '%$keyword%'";
    

    复制一份,在在第二个双引号前加入

    or content like '%{$keyword}%'
    

    然后把原来的代码注释掉.

emlog搜索时搜索文章内容
emlog搜索时搜索文章内容
  1. 保存,大功告成,记得自己去测试.
Giscus loading...