From a77a6a137f98703947f8049e731f54b8ac8a8f29 Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Tue, 21 Nov 2023 10:40:55 +0100 Subject: [PATCH] Update search index command in documentation Sadly, when using a SearchVector, Django will introduce a COALESCE that will then prevent our index to be used. So we need to add this COALESCE in the index to make psql happy. fix #1414 --- docs/install.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/install.md b/docs/install.md index bf789e08..fb087f2c 100644 --- a/docs/install.md +++ b/docs/install.md @@ -108,7 +108,7 @@ may want to add an index. For that, you should do so: 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', name), share_status); + CREATE INDEX IF NOT EXISTS search_idx ON umap_map USING GIN(to_tsvector('umapdict', COALESCE(name, ''::character varying)::text), share_status); And change `UMAP_SEARCH_CONFIGURATION = "umapdict"` in your settings.