- way_ids = Array.new
- ways = Array.new
- nodes = Array.new
- relations = Array.new
-
- # Matching for tags table
- cond_way = Array.new
- sql = '1=1'
- if type
- sql += ' AND current_way_tags.k=?'
- cond_way += [type]
- end
- if 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
-
- # 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(/[-+*<>"~()]/, ' ') + '"']
+ if do_nodes
+ response.headers['Error'] = "Searching of nodes is currently unavailable"
+ render :nothing => true, :status => :service_unavailable
+ return false