From 5400a938a86c83b668566d7fa4880403c99fc503 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Thu, 20 Dec 2007 10:15:45 +0000 Subject: [PATCH] Optimise tag searching of ways and relations a bit more... --- app/controllers/search_controller.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controllers/search_controller.rb b/app/controllers/search_controller.rb index 51974455a..90ec8fd6a 100644 --- a/app/controllers/search_controller.rb +++ b/app/controllers/search_controller.rb @@ -43,8 +43,8 @@ class SearchController < ApplicationController cond_way += [type] end if value - sql += ' AND current_way_tags.v=? AND MATCH (current_way_tags.v) AGAINST (?)' - cond_way += [value,value] + sql += ' AND current_way_tags.v=? AND MATCH (current_way_tags.v) AGAINST (? IN BOOLEAN MODE)' + cond_way += [value,'"' + value.sub(/[-+*<>"~()]/, ' ') + '"'] end cond_way = [sql] + cond_way @@ -56,8 +56,8 @@ class SearchController < ApplicationController cond_rel += [type] end if value - sql += ' AND current_relation_tags.v=? AND MATCH (current_relation_tags.v) AGAINST (?)' - cond_rel += [value,value] + sql += ' AND current_relation_tags.v=? AND MATCH (current_relation_tags.v) AGAINST (? IN BOOLEAN MODE)' + cond_rel += [value,'"' + value.sub(/[-+*<>"~()]/, ' ') + '"'] end cond_rel = [sql] + cond_rel -- 2.43.2