diff --git a/blacklight.gemspec b/blacklight.gemspec index 93c7512ac2..1c505159c0 100644 --- a/blacklight.gemspec +++ b/blacklight.gemspec @@ -20,7 +20,7 @@ Gem::Specification.new do |s| s.add_dependency "rails", ">= 3.2.6", "< 5" s.add_dependency "nokogiri", "~>1.6" # XML Parser s.add_dependency "kaminari", "~> 0.13" # the pagination (page 1,2,3, etc..) of our search results - s.add_dependency "rsolr", "~> 1.0.6" # Library for interacting with rSolr. + s.add_dependency "rsolr", "~> 1.0.11" # Library for interacting with rSolr. s.add_dependency "bootstrap-sass", "~> 3.2" s.add_dependency "deprecation" diff --git a/lib/blacklight/solr/search_builder.rb b/lib/blacklight/solr/search_builder.rb index 2ee9262ad0..345ef591f2 100644 --- a/lib/blacklight/solr/search_builder.rb +++ b/lib/blacklight/solr/search_builder.rb @@ -241,13 +241,13 @@ def facet_value_to_fq_string(facet_field, value) facet_config.query[value][:fq] when (facet_config and facet_config.date) # in solr 3.2+, this could be replaced by a !term query - "#{prefix}#{facet_field}:#{RSolr.escape(value)}" + "#{prefix}#{facet_field}:#{RSolr.solr_escape(value)}" when (value.is_a?(DateTime) or value.is_a?(Date) or value.is_a?(Time)) - "#{prefix}#{facet_field}:#{RSolr.escape(value.to_time.utc.strftime("%Y-%m-%dT%H:%M:%SZ"))}" + "#{prefix}#{facet_field}:#{RSolr.solr_escape(value.to_time.utc.strftime("%Y-%m-%dT%H:%M:%SZ"))}" when (value.is_a?(TrueClass) or value.is_a?(FalseClass) or value == 'true' or value == 'false'), (value.is_a?(Integer) or (value.to_i.to_s == value if value.respond_to? :to_i)), (value.is_a?(Float) or (value.to_f.to_s == value if value.respond_to? :to_f)) - "#{prefix}#{facet_field}:#{RSolr.escape(value.to_s)}" + "#{prefix}#{facet_field}:#{RSolr.solr_escape(value.to_s)}" when value.is_a?(Range) "#{prefix}#{facet_field}:[#{value.first} TO #{value.last}]" else @@ -261,4 +261,4 @@ def grouped_key_for_results blacklight_config.index.group end end -end \ No newline at end of file +end diff --git a/spec/lib/blacklight/solr/search_builder_spec.rb b/spec/lib/blacklight/solr/search_builder_spec.rb index 3499c3955e..330f073a18 100644 --- a/spec/lib/blacklight/solr/search_builder_spec.rb +++ b/spec/lib/blacklight/solr/search_builder_spec.rb @@ -370,11 +370,11 @@ end it "should pass floats through" do - expect(subject.send(:facet_value_to_fq_string, "facet_name", 1.11)).to eq "facet_name:1\\.11" + expect(subject.send(:facet_value_to_fq_string, "facet_name", 1.11)).to eq "facet_name:1.11" end it "should pass floats through" do - expect(subject.send(:facet_value_to_fq_string, "facet_name", "1.11")).to eq "facet_name:1\\.11" + expect(subject.send(:facet_value_to_fq_string, "facet_name", "1.11")).to eq "facet_name:1.11" end it "should escape negative integers" do