Commit 5bdd43ef by Ngô Trung Hưng

use solr_escape

parent 99779d23
Pipeline #1039 failed with stages
in 0 seconds
......@@ -23,9 +23,9 @@ class SearchController < ApplicationController
def sub_space_params!(keyword, industry_id, location_id)
arr_params = []
keyword = keyword.present? ? Regexp.escape(keyword) : ''
industry_id = industry_id.present? ? Regexp.escape(industry_id) : ''
location_id = location_id.present? ? Regexp.escape(location_id) : ''
keyword = keyword.present? ? RSolr.solr_escape(keyword) : ''
industry_id = industry_id.present? ? RSolr.solr_escape(industry_id) : ''
location_id = location_id.present? ? RSolr.solr_escape(location_id) : ''
arr_params << keyword << industry_id << location_id
arr_params.each { |val| val.sub!('', '*') if val.blank? }
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment