From 74b0bace94b1a035e43024833231d7519ad2382d Mon Sep 17 00:00:00 2001 From: Lenny Turetsky Date: Thu, 14 Dec 2017 17:53:37 -0800 Subject: [PATCH] RSolr.escape has been replaced with RSolr.solr_escape https://github.com/sunspot/sunspot/issues/661 --- sunspot/lib/sunspot/indexer.rb | 2 +- sunspot/lib/sunspot/query/function_query.rb | 2 +- sunspot/lib/sunspot/query/restriction.rb | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sunspot/lib/sunspot/indexer.rb b/sunspot/lib/sunspot/indexer.rb index 955812c5d..a8a350405 100644 --- a/sunspot/lib/sunspot/indexer.rb +++ b/sunspot/lib/sunspot/indexer.rb @@ -55,7 +55,7 @@ def remove_by_id(class_name, *ids) # def remove_all(clazz = nil) if clazz - @connection.delete_by_query("type:#{escape(clazz.name)}") + @connection.delete_by_query("type:#{solr_escape(clazz.name)}") else @connection.delete_by_query("*:*") end diff --git a/sunspot/lib/sunspot/query/function_query.rb b/sunspot/lib/sunspot/query/function_query.rb index d9c2bb67a..bf195fd7c 100644 --- a/sunspot/lib/sunspot/query/function_query.rb +++ b/sunspot/lib/sunspot/query/function_query.rb @@ -34,7 +34,7 @@ def initialize(field) end def to_s - "#{escape(@field.indexed_name)}" << (@boost_amount ? "^#{@boost_amount}" : "") + "#{sunspot_solr(@field.indexed_name)}" << (@boost_amount ? "^#{@boost_amount}" : "") end end diff --git a/sunspot/lib/sunspot/query/restriction.rb b/sunspot/lib/sunspot/query/restriction.rb index 9786c296b..169f27aa2 100644 --- a/sunspot/lib/sunspot/query/restriction.rb +++ b/sunspot/lib/sunspot/query/restriction.rb @@ -92,7 +92,7 @@ def to_boolean_phrase # String:: Boolean phrase for restriction in the positive # def to_positive_boolean_phrase - "#{escape(@field.indexed_name)}:#{to_solr_conditional}" + "#{solr_escape(@field.indexed_name)}:#{to_solr_conditional}" end # @@ -138,7 +138,7 @@ def negate # String:: Solr API representation of given value # def solr_value(value = @value) - solr_value = escape(@field.to_indexed(value)) + solr_value = solr_escape(@field.to_indexed(value)) if RESERVED_WORDS.include?(solr_value) %Q("#{solr_value}") else @@ -168,7 +168,7 @@ def to_positive_boolean_phrase unless @value.nil? super else - "#{escape(@field.indexed_name)}:[* TO *]" + "#{solr_escape(@field.indexed_name)}:[* TO *]" end end