惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Google DeepMind News
Google DeepMind News
Stack Overflow Blog
Stack Overflow Blog
Hugging Face - Blog
Hugging Face - Blog
博客园_首页
T
The Blog of Author Tim Ferriss
博客园 - 叶小钗
N
Netflix TechBlog - Medium
腾讯CDC
C
Check Point Blog
P
Proofpoint News Feed
Engineering at Meta
Engineering at Meta
GbyAI
GbyAI
S
SegmentFault 最新的问题
F
Fortinet All Blogs
美团技术团队
U
Unit 42
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
博客园 - 司徒正美
F
Full Disclosure
Recorded Future
Recorded Future
D
DataBreaches.Net
博客园 - 【当耐特】
Martin Fowler
Martin Fowler
J
Java Code Geeks
I
InfoQ
Y
Y Combinator Blog
A
About on SuperTechFans
AI
AI
爱范儿
爱范儿
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Forbes - Security
Forbes - Security
W
WeLiveSecurity
M
MIT News - Artificial intelligence
雷峰网
雷峰网
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Simon Willison's Weblog
Simon Willison's Weblog
Schneier on Security
Schneier on Security
The GitHub Blog
The GitHub Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
aimingoo的专栏
aimingoo的专栏
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
G
GRAHAM CLULEY
Know Your Adversary
Know Your Adversary
Latest news
Latest news
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
D
Docker
Recent Commits to openclaw:main
Recent Commits to openclaw:main
量子位
V2EX - 技术
V2EX - 技术
Project Zero
Project Zero

编程设计 – 云破天开

学习写wordpress插件(三)-云破天开 学习写wordpress插件(二)-云破天开 学习写wordpress插件(一)-云破天开 整理电子书-云破天开 两列数据对比,找出不同数据-云破天开 一个简单实用的网站访客统计PHP源码-云破天开 在线图片处理-云破天开 DOS命令-云破天开 EMLOG头部添加名人名言-云破天开
Emlog实现标题+全文内容搜索方法-云破天开
作者:yptk · 2019-07-28 · via 编程设计 – 云破天开

域名不卖,勿扰!

当前位置:云破天开 > 学习笔记 > 编程设计 > 正文

  • 云破天开 发布于 2019-07-28-17:52:04
  • 阅读(4283)
  • 评论(0)

emlog官方默认搜索只支持标题搜索,很鸡肋。

由于文章较多,需要修改成标题+全文搜索,
实现方法:
需要修改emlog内核

找到文件include/controller/search_controller.php中的以下代码:
$sqlSegment = “and title like ‘%{$keyword}%’ order by date desc”; 
修改为:
$sqlSegment = “and ( title like ‘%{$keyword}%’ or content like ‘%{$keyword}%’ ) order by date desc”;
如果文章过多,全文搜索会对服务器造成很大压力。

版权共享,随意转载:云破天开 » Emlog实现标题+全文内容搜索方法

云破天开

作者:yptk

评论

记住我的信息

6+7=

有人回复时邮件通知我
庆贺

小站12岁

人生は、いつもちょっとだけ間にあわない。
《歩いても、歩いても》

距离百年小站还有87年!

SLOGAN

拖着自己前行,探索新世界!

invictus maneo( 正路不通,莫怪歧途)

  • 回顶部