Ver código fonte

[fix] ignore bulk update for global search

version-14
Rushabh Mehta 8 anos atrás
pai
commit
592ac64fc1
1 arquivos alterados com 4 adições e 3 exclusões
  1. +4
    -3
      frappe/utils/global_search.py

+ 4
- 3
frappe/utils/global_search.py Ver arquivo

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


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


Carregando…
Cancelar
Salvar