diff schema/search_functions.sql @ 4874:7cbe5d32a614

Added search for bottleneck_id.
author Sascha Wilde <wilde@intevation.de>
date Fri, 31 Jan 2020 17:11:30 +0100
parents 5e38667f740c
children a6e5bb85f0a7
line wrap: on
line diff
--- a/schema/search_functions.sql	Fri Jan 24 17:33:12 2020 +0100
+++ b/schema/search_functions.sql	Fri Jan 31 17:11:30 2020 +0100
@@ -52,9 +52,11 @@
     INTO _result
     FROM (SELECT objnam AS name,
                  ST_AsGeoJSON(ST_Envelope(area::geometry))::json AS geom,
-                 'bottleneck' AS type
+                 'bottleneck' AS type,
+                 bottleneck_id AS location
             FROM waterway.bottlenecks
-            WHERE objnam ILIKE '%' || search_string || '%'
+            WHERE (objnam ILIKE '%' || search_string || '%'
+                   OR bottleneck_id ILIKE '%' || search_string || '%')
               AND validity @> now()
           ORDER BY name) r;
   RETURN _result;