branch bow-v2-go updated (578fd07 -> ec307ef)
This is an automated email from the git hooks/post-receive script. New change to branch bow-v2-go in repository bow. See https://gitlab.nuiton.org/chorem/bow.git from 578fd07 ajout des highlighted sur la description et les tags pour expliquer la presence du bookmark dans les resultats new e434b91 correction pour que le highlight prenne l'ensemble du text new ec307ef correction index fulltext The 2 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Detailed log of new commits: commit ec307efcc9957ceef37c274ff6b9bc1124aac3f7 Author: Benjamin <poussin@codelutin.com> Date: Thu May 28 03:06:27 2020 +0200 correction index fulltext commit e434b91be719efe19469f6aa3d7d587aaefac2a4 Author: Benjamin <poussin@codelutin.com> Date: Thu May 28 02:48:28 2020 +0200 correction pour que le highlight prenne l'ensemble du text Summary of changes: migrate/001_init_schema.sql | 2 +- pkg/repository/bookmarkRepository.go | 36 ++++++++++++++++++++++++------------ 2 files changed, 25 insertions(+), 13 deletions(-) -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch bow-v2-go in repository bow. See https://gitlab.nuiton.org/chorem/bow.git commit ec307efcc9957ceef37c274ff6b9bc1124aac3f7 Author: Benjamin <poussin@codelutin.com> Date: Thu May 28 03:06:27 2020 +0200 correction index fulltext --- migrate/001_init_schema.sql | 2 +- pkg/repository/bookmarkRepository.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/migrate/001_init_schema.sql b/migrate/001_init_schema.sql index 8585d8c..0d1b79d 100644 --- a/migrate/001_init_schema.sql +++ b/migrate/001_init_schema.sql @@ -103,7 +103,7 @@ CREATE INDEX bookmark_description_idx ON bookmark USING GIN (to_tsvector(lang, d CREATE INDEX bookmark_privateAlias_idx ON bookmark USING gin (privateAlias); CREATE INDEX bookmark_privateAlias_like_idx ON bookmark USING gin (text(privateAlias) gin_trgm_ops); -- index pour la recherche via ilike "%toto%" CREATE INDEX bookmark_publicAlias_idx ON bookmark USING gin (publicAlias); -- TODO garantir l'unicité -CREATE INDEX bookmark_all_ft_idx ON bookmark USING GIN(to_tsvector(lang, text(tags) || ' ' || description || ' ' || uri || ' ' || text(privateAlias) || ' ' || text(publicAlias))); +CREATE INDEX bookmark_all_ft_idx ON bookmark USING GIN(to_tsvector(lang, text(coalesce(tags, '{}'::text[])) || ' ' || coalesce(description, '') || ' ' || coalesce(uri, '') || ' ' || text(coalesce(privateAlias, '{}'::text[])) || ' ' || text(coalesce(publicAlias, '{}'::text[])))); -- penser au nettoyage de cette table, si plus aucun bookmark ne reference cette uri diff --git a/pkg/repository/bookmarkRepository.go b/pkg/repository/bookmarkRepository.go index 624dd3c..e2e04ae 100644 --- a/pkg/repository/bookmarkRepository.go +++ b/pkg/repository/bookmarkRepository.go @@ -79,7 +79,7 @@ func BookmarkJSON(currentUser model.BowUser, id string, uri string, tags []strin FROM bookmark WHERE tags @> string_to_array($1, ',') AND - (%s to_tsvector(lang, text(tags) || ' ' || description || ' ' || uri || ' ' || text(privateAlias) || ' ' || text(publicAlias)) @@ websearch_to_tsquery($2)) + (%s to_tsvector(lang, text(coalesce(tags, '{}'::text[])) || ' ' || coalesce(description, '') || ' ' || coalesce(uri, '') || ' ' || text(coalesce(privateAlias, '{}'::text[])) || ' ' || text(coalesce(publicAlias, '{}'::text[]))) @@ websearch_to_tsquery($2)) `, hl, queryEmptyFulltext) } -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
participants (1)
-
chorem.org scm