app/models/search_extension.rb in iqvoc-4.3.3 vs app/models/search_extension.rb in iqvoc-4.4.0
- old
+ new
@@ -20,16 +20,15 @@
def build_search_result_rdf(document, result)
raise NotImplementedError.new("Implement build_search_result_rdf in your specific class (#{self.class.name}) that should be searchable!")
end
module ClassMethods
-
def multi_query(params = {})
query_terms = params[:query].split(/\r\n/)
results = []
query_terms.each do |term|
- results << { :query => term, :result => single_query(params.merge({:query => term})) }
+ results << { query: term, result: single_query(params.merge({ query: term })) }
end
results
end
def single_query(params = {})
@@ -44,15 +43,13 @@
false
end
def build_query_string(params = {})
query_str = params[:query]
- query_str = "%#{query_str}" if ["contains", "ends_with"].include?(params[:query_type].to_s)
- query_str = "#{query_str}%" if ["contains", "begins_with"].include?(params[:query_type].to_s)
+ query_str = "%#{query_str}" if ['contains', 'ends_with'].include?(params[:query_type].to_s)
+ query_str = "#{query_str}%" if ['contains', 'begins_with'].include?(params[:query_type].to_s)
# Note that 'contains' will add an '%' to the beginning AND to the end
query_str
end
-
end
-
end