Fix fulltext indexing
parent
0058d37543
commit
b304ddd5bb
|
@ -632,7 +632,7 @@ class Syncer
|
||||||
let upd = {
|
let upd = {
|
||||||
body_text: obj.text||'',
|
body_text: obj.text||'',
|
||||||
body_html: obj.html,
|
body_html: obj.html,
|
||||||
body_html_text: obj.html.replace(/<style[^>]*>.*<\/style\s*>|<\/?[^>]*>/g, ''),
|
body_html_text: obj.html.replace(/<style[^>]*>[\s\S]*?<\/style\s*>|<\/?[^>]*>/g, ''),
|
||||||
};
|
};
|
||||||
await SQL.update(
|
await SQL.update(
|
||||||
this.pg, 'messages m', {
|
this.pg, 'messages m', {
|
||||||
|
|
|
@ -81,8 +81,8 @@ begin
|
||||||
coalesce(msg.props->>'to', '') || ' ' ||
|
coalesce(msg.props->>'to', '') || ' ' ||
|
||||||
coalesce(msg.props->>'cc', '') || ' ' ||
|
coalesce(msg.props->>'cc', '') || ' ' ||
|
||||||
coalesce(msg.props->>'bcc', '') || ' ' ||
|
coalesce(msg.props->>'bcc', '') || ' ' ||
|
||||||
(select string_agg((a->>'name') || ' ' || (a->>'mimetype') || ' ' || (a->>'size'), ' ')
|
coalesce((select string_agg((a->>'name') || ' ' || (a->>'mimetype') || ' ' || (a->>'size'), ' ')
|
||||||
from jsonb_array_values(coalesce(msg.props->'attachments', '[]'::jsonb)) as t (a)) || ' ' ||
|
from jsonb_array_elements(coalesce(msg.props->'attachments', '[]'::jsonb)) as t (a)), '') || ' ' ||
|
||||||
msg.subject,
|
msg.subject,
|
||||||
'\W+', ' ', 'g'
|
'\W+', ' ', 'g'
|
||||||
)), 'A')
|
)), 'A')
|
||||||
|
|
Loading…
Reference in New Issue