mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Add comment to search index query
This commit is contained in:
parent
df3a0e1640
commit
3926cefc1f
1 changed files with 2 additions and 0 deletions
|
|
@ -10,7 +10,9 @@ begin
|
|||
setweight(to_tsvector('pg_catalog.english', coalesce(new.title, '')), 'A') ||
|
||||
setweight(to_tsvector('pg_catalog.english', coalesce(new.author, '')), 'A') ||
|
||||
setweight(to_tsvector('pg_catalog.english', coalesce(new.description,'')), 'A') ||
|
||||
-- full hostname (eg www.omnivore.app)
|
||||
setweight(to_tsvector('pg_catalog.english', coalesce(regexp_replace(new.url, '^((http[s]?):\/)?\/?([^:\/\s]+)((\/\w+)*\/)([\w\-\.]+[^#?\s]+)(.*)?(#[\w\-]+)?$', '\3'), '')), 'A') ||
|
||||
-- secondary hostname (eg omnivore)
|
||||
setweight(to_tsvector('pg_catalog.english', coalesce(regexp_replace(new.url, '^((http[s]?):\/)?\/?(.*\.)?([^:\/\s]+)(\..*)((\/+)*\/)?([\w\-\.]+[^#?\s]+)(.*)?(#[\w\-]+)?$', '\4'), '')), 'A') ||
|
||||
setweight(to_tsvector('pg_catalog.english', coalesce(new.content,'')), 'B');
|
||||
return new;
|
||||
|
|
|
|||
Loading…
Reference in a new issue