浏览代码

[fix] ignore bulk update for global search

version-14
Rushabh Mehta 8 年前
父节点
当前提交
592ac64fc1
共有 1 个文件被更改,包括 4 次插入3 次删除
  1. +4
    -3
      frappe/utils/global_search.py

+ 4
- 3
frappe/utils/global_search.py 查看文件

@@ -13,13 +13,13 @@ def setup_global_search_table():
if not '__global_search' in frappe.db.get_tables():
frappe.db.sql('''create table __global_search(
doctype varchar(100),
name varchar(140),
name varchar(255),
title varchar(140),
content text,
fulltext(content),
route varchar(140),
published int(1) not null default 0,
unique (doctype, name))
unique `doctype_name` (doctype, name))
COLLATE=utf8mb4_unicode_ci
ENGINE=MyISAM
CHARACTER SET=utf8mb4''')
@@ -181,8 +181,9 @@ def insert_values_for_multiple_docs(all_contents):
values.append("( '{doctype}', '{name}', '{content}', '{published}', '{title}', '{route}')"
.format(**content))

# ignoring duplicate keys for doctype_name
frappe.db.sql('''
insert into __global_search
insert ignore into __global_search
(doctype, name, content, published, title, route)
values
{0}


正在加载...
取消
保存