From add9c74779231efc5f14ba4cdc3ec41412765a82 Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Thu, 1 Sep 2016 18:07:22 +0530 Subject: [PATCH] [enhance] search results in help (#2022) --- frappe/utils/help.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frappe/utils/help.py b/frappe/utils/help.py index 9d607caba7..87697d3102 100644 --- a/frappe/utils/help.py +++ b/frappe/utils/help.py @@ -81,7 +81,9 @@ class HelpDatabase(object): def search(self, words): self.connect() - return self.db.sql('select title, intro, path from help where match(content) against (%s) limit 10', words) + return self.db.sql(''' + select title, intro, path from help where title like '%{term}%' union + select title, intro, path from help where match(content) against ('{term}') limit 10'''.format(term=words)) def get_content(self, path): self.connect()