+ cond_way = [sql] + cond_way
+
+ # Matching for tags table
+ cond_rel = Array.new
+ sql = '1=1'
+ if type
+ sql += ' AND current_relation_tags.k=?'
+ cond_rel += [type]
+ end
+ if 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