From: Sarah Hoffmann Date: Sun, 17 Nov 2019 18:53:42 +0000 (+0100) Subject: prefer English wikipedia for wikidata matches X-Git-Tag: v3.5.0~132^2~3 X-Git-Url: https://git.openstreetmap.org./nominatim.git/commitdiff_plain/6d764a05b013eb59692760c81630361428597c62?hp=cd3ddec7463359524c3df2c66cb784746661afdc prefer English wikipedia for wikidata matches --- diff --git a/sql/functions.sql b/sql/functions.sql index 09033567..9a78887b 100644 --- a/sql/functions.sql +++ b/sql/functions.sql @@ -2703,7 +2703,7 @@ BEGIN IF extratags ? 'wikidata' THEN FOR match IN SELECT * FROM wikipedia_article WHERE wd_page_title = extratags->'wikidata' - ORDER BY importance DESC limit 1 LOOP + ORDER BY language = 'en' DESC, langcount DESC LIMIT 1 LOOP result.importance := match.importance; result.wikipedia := match.language || ':' || match.title; RETURN result;