sql: do not add overlong text lines to full text indexation (#58100)

This commit is contained in:
Frédéric Péters 2021-10-22 12:13:06 +02:00
parent 2dc0c2a06a
commit 6300d8d344
1 changed files with 2 additions and 1 deletions

View File

@ -2172,7 +2172,8 @@ class SqlDataMixin(SqlMixin):
elif field.key in ('item', 'items'):
value = data.get('%s_display' % field.id)
if value:
if isinstance(value, str):
if isinstance(value, str) and len(value) < 10000:
# avoid overlong strings, typically base64-encoded values
fts_strings.append(value)
elif type(value) in (tuple, list):
fts_strings.extend(value)