diff --git a/docs/config/settings.md b/docs/config/settings.md index 5211f7b5..c6b103f6 100644 --- a/docs/config/settings.md +++ b/docs/config/settings.md @@ -323,7 +323,10 @@ CREATE EXTENSION btree_gin; ALTER TEXT SEARCH CONFIGURATION umapdict ALTER MAPPING FOR hword, hword_part, word WITH unaccent, simple; # Now create the index -CREATE INDEX IF NOT EXISTS search_idx ON umap_map USING GIN(to_tsvector('umapdict', COALESCE(name, ''::character varying)::text), share_status); +CREATE INDEX IF NOT EXISTS search_idx ON umap_map USING GIN(to_tsvector('umapdict', COALESCE(name, ''::character varying)::text), share_status, tags); + +# You should also create an index for tag filtering: +CREATE INDEX IF NOT EXISTS tags_idx ON umap_map USING GIN(share_status, tags); ``` Then set: diff --git a/umap/context_processors.py b/umap/context_processors.py index fcabcfb4..6064a152 100644 --- a/umap/context_processors.py +++ b/umap/context_processors.py @@ -14,6 +14,7 @@ def settings(request): "UMAP_DEMO_SITE": djsettings.UMAP_DEMO_SITE, "UMAP_HOST_INFOS": djsettings.UMAP_HOST_INFOS, "UMAP_ALLOW_EDIT_PROFILE": djsettings.UMAP_ALLOW_EDIT_PROFILE, + "UMAP_TAGS": djsettings.UMAP_TAGS, } diff --git a/umap/templates/umap/search_bar.html b/umap/templates/umap/search_bar.html index 701a0fb0..c3f22b0e 100644 --- a/umap/templates/umap/search_bar.html +++ b/umap/templates/umap/search_bar.html @@ -5,14 +5,22 @@