-
+
{% if results %}
diff --git a/frappe/utils/global_search.py b/frappe/utils/global_search.py
index 76f433cf80..af38570021 100644
--- a/frappe/utils/global_search.py
+++ b/frappe/utils/global_search.py
@@ -311,16 +311,26 @@ def sync_value(value):
Sync a given document to global search
:param value: dict of { doctype, name, content, published, title, route }
'''
-
+
frappe.db.multisql({
'mariadb': '''INSERT INTO `__global_search`
(`doctype`, `name`, `content`, `published`, `title`, `route`)
VALUES (%(doctype)s, %(name)s, %(content)s, %(published)s, %(title)s, %(route)s)
- ON DUPLICATE key UPDATE `content`=%(content)s''',
+ ON DUPLICATE key UPDATE
+ `content`=%(content)s,
+ `published`=%(published)s,
+ `title`=%(title)s,
+ `route`=%(route)s
+ ''',
'postgres': '''INSERT INTO `__global_search`
(`doctype`, `name`, `content`, `published`, `title`, `route`)
VALUES (%(doctype)s, %(name)s, %(content)s, %(published)s, %(title)s, %(route)s)
- ON CONFLICT("doctype", "name") DO UPDATE SET `content`=%(content)s'''
+ ON CONFLICT("doctype", "name") DO UPDATE SET
+ `content`=%(content)s,
+ `published`=%(published)s,
+ `title`=%(title)s,
+ `route`=%(route)s
+ '''
}, value)
def delete_for_document(doc):
diff --git a/frappe/www/search.py b/frappe/www/search.py
index 56b6ff4e36..e545f4840f 100644
--- a/frappe/www/search.py
+++ b/frappe/www/search.py
@@ -29,7 +29,7 @@ def get_search_results(text, start=0, as_html=False):
for d in results:
d.content = html2text(d.content)
index = d.content.lower().index(text.lower())
- d.content = d.content[:index] + '
' + d.content[index:][:len(text)] + '' + d.content[index + len(text):]
+ d.content = d.content[:index] + '
' + d.content[index:][:len(text)] + '' + d.content[index + len(text):]
if index < 40:
start = 0