server: strip html from search index of summaries
This commit is contained in:
parent
f90ff72316
commit
c693d4e78a
@ -0,0 +1,5 @@
|
||||
-- Add down migration script here
|
||||
DROP INDEX post_summary_idx;
|
||||
CREATE INDEX post_summary_idx ON post USING gin (
|
||||
to_tsvector('english', summary)
|
||||
);
|
||||
11
server/migrations/20250117225159_strip-html-index.up.sql
Normal file
11
server/migrations/20250117225159_strip-html-index.up.sql
Normal file
@ -0,0 +1,11 @@
|
||||
-- Something like this around summary in the idx w/ tsvector
|
||||
DROP INDEX post_summary_idx;
|
||||
CREATE INDEX post_summary_idx ON post USING gin (to_tsvector(
|
||||
'english',
|
||||
regexp_replace(
|
||||
regexp_replace(summary, '<[^>]+>', ' ', 'g'),
|
||||
'\s+',
|
||||
' ',
|
||||
'g'
|
||||
)
|
||||
));
|
||||
Loading…
x
Reference in New Issue
Block a user