blacklight 5.11.3 → 5.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/VERSION +1 -1
  3. data/app/helpers/blacklight/blacklight_helper_behavior.rb +2 -2
  4. data/app/helpers/blacklight/catalog_helper_behavior.rb +2 -4
  5. data/app/helpers/blacklight/facets_helper_behavior.rb +10 -6
  6. data/app/helpers/blacklight/url_helper_behavior.rb +1 -1
  7. data/app/views/bookmarks/_clear_bookmarks_widget.html.erb +1 -0
  8. data/app/views/bookmarks/index.html.erb +0 -1
  9. data/blacklight.gemspec +1 -1
  10. data/config/locales/blacklight.en.yml +1 -0
  11. data/lib/blacklight.rb +2 -1
  12. data/lib/blacklight/bookmarks.rb +2 -0
  13. data/lib/blacklight/catalog.rb +1 -1
  14. data/lib/blacklight/configuration.rb +8 -1
  15. data/lib/blacklight/configuration/fields.rb +20 -10
  16. data/lib/blacklight/document.rb +43 -13
  17. data/lib/blacklight/document_presenter.rb +8 -4
  18. data/lib/blacklight/facet.rb +6 -54
  19. data/lib/blacklight/request_builders.rb +2 -2
  20. data/lib/blacklight/search_builder.rb +48 -18
  21. data/lib/blacklight/search_helper.rb +10 -10
  22. data/lib/blacklight/solr.rb +1 -1
  23. data/lib/blacklight/solr/search_builder.rb +2 -265
  24. data/lib/blacklight/solr/search_builder_behavior.rb +274 -0
  25. data/lib/blacklight/solr_repository.rb +1 -1
  26. data/lib/blacklight/solr_response.rb +8 -16
  27. data/lib/blacklight/solr_response/facets.rb +133 -25
  28. data/lib/blacklight/solr_response/group_response.rb +1 -1
  29. data/lib/blacklight/solr_response/pagination_methods.rb +0 -17
  30. data/lib/generators/blacklight/install_generator.rb +6 -1
  31. data/lib/generators/blacklight/search_builder_generator.rb +20 -0
  32. data/lib/generators/blacklight/templates/search_builder.rb +3 -0
  33. data/lib/railties/blacklight.rake +1 -1
  34. data/spec/controllers/catalog_controller_spec.rb +9 -9
  35. data/spec/helpers/blacklight_helper_spec.rb +29 -179
  36. data/spec/helpers/facets_helper_spec.rb +37 -75
  37. data/spec/helpers/url_helper_spec.rb +1 -1
  38. data/spec/lib/blacklight/configuration_spec.rb +18 -1
  39. data/spec/lib/blacklight/document_spec.rb +62 -0
  40. data/spec/lib/blacklight/search_builder_spec.rb +15 -13
  41. data/spec/lib/blacklight/search_helper_spec.rb +15 -16
  42. data/spec/lib/blacklight/solr/document_spec.rb +5 -3
  43. data/spec/lib/blacklight/solr/search_builder_spec.rb +0 -5
  44. data/spec/lib/blacklight/solr_response/facets_spec.rb +144 -10
  45. data/spec/lib/blacklight/solr_response_spec.rb +5 -13
  46. data/spec/lib/document_presenter_spec.rb +23 -27
  47. data/spec/views/catalog/_facets.html.erb_spec.rb +1 -1
  48. data/spec/views/catalog/_index_default.erb_spec.rb +2 -13
  49. data/spec/views/catalog/_show_default.erb_spec.rb +1 -13
  50. metadata +10 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d66f63cc8f730572a615a21e6e02c6f2bec32a04
4
- data.tar.gz: 0e0a72eaec2d8ac932f37c96cff9c3482e1c884d
3
+ metadata.gz: 1e42546dfea7f15e6d7fb7840dc8c565dc1a2f4d
4
+ data.tar.gz: 4f80a2c7b454658bd1be662f9509224db5eeee47
5
5
  SHA512:
6
- metadata.gz: 2cfd5cd4a3c90a7f88aace8b30f706adc7a932ae8f1b49f30464051fddaf35cc48de2259c307d6501d4e555c934c4196ed5a841cac232d97cca1322ea1c146fb
7
- data.tar.gz: 87e32807796642701f8891a2fb8c2ae6027bc8fc1b24d9e2dc1e3fe66387c6c4710af5ae306e0ef2bf3258b3f055ceb8d915729c4b9b1d35c53c35979cb103ca
6
+ metadata.gz: c8fbed4b5264a3d96387cb0fafe1e39f7e18ad2c1b2847ab357f9c749ff6e63028876db67ed7906ae21f765bfbac900a9dfd891faa2df981a861c63fabb14790
7
+ data.tar.gz: 99196a24351223263018890b8acd9d0d9c5a0adcc2d0793fe44f6f9310d4d803fead0e0930d3fc16e2ddc05d6a1459fb1c6578685d14a23f965f85f3cc2dc3c5
data/VERSION CHANGED
@@ -1 +1 @@
1
- 5.11.3
1
+ 5.12.0
@@ -183,7 +183,7 @@ module Blacklight::BlacklightHelperBehavior
183
183
  document = args.shift || options[:document]
184
184
 
185
185
  field = args.shift || options[:field]
186
- presenter(document).render_index_field_value field, options
186
+ presenter(document).render_index_field_value field, options.except(:document, :field)
187
187
  end
188
188
 
189
189
  ##
@@ -236,7 +236,7 @@ module Blacklight::BlacklightHelperBehavior
236
236
  document = args.shift || options[:document]
237
237
 
238
238
  field = args.shift || options[:field]
239
- presenter(document).render_document_show_field_value field, options
239
+ presenter(document).render_document_show_field_value field, options.except(:document, :field)
240
240
  end
241
241
 
242
242
  ##
@@ -14,11 +14,9 @@ module Blacklight::CatalogHelperBehavior
14
14
  entry_name = if options[:entry_name]
15
15
  options[:entry_name]
16
16
  elsif collection.respond_to? :model # DataMapper
17
- collection.model.model_name.human.downcase
17
+ collection.model.model_name.human.downcase
18
18
  elsif collection.respond_to? :model_name and !collection.model_name.nil? # AR, Blacklight::PaginationMethods
19
- collection.model_name.human.downcase
20
- elsif collection.is_a?(::Kaminari::PaginatableArray)
21
- 'entry'
19
+ collection.model_name.human.downcase
22
20
  else
23
21
  t('blacklight.entry_name.default')
24
22
  end
@@ -159,7 +159,7 @@ module Blacklight::FacetsHelperBehavior
159
159
  # @param [String] facet field
160
160
  # @return [Boolean]
161
161
  def facet_field_in_params? field
162
- params[:f] and params[:f][field]
162
+ !facet_params(field).blank?
163
163
  end
164
164
 
165
165
  ##
@@ -170,13 +170,17 @@ module Blacklight::FacetsHelperBehavior
170
170
  # @param [Object] facet value
171
171
  # @return [Boolean]
172
172
  def facet_in_params?(field, item)
173
- if item and item.respond_to? :field
174
- field = item.field
175
- end
176
-
177
173
  value = facet_value_for_facet_item(item)
178
174
 
179
- params[:f] and params[:f][field] and params[:f][field].include?(value)
175
+ (facet_params(field) || []).include? value
176
+ end
177
+
178
+ ##
179
+ # Get the values of the facet set in the blacklight query string
180
+ def facet_params field
181
+ config = facet_configuration_for_field(field)
182
+
183
+ params[:f][config.key] if params[:f]
180
184
  end
181
185
 
182
186
  ##
@@ -235,7 +235,7 @@ module Blacklight::UrlHelperBehavior
235
235
  p[:f][url_field].push(value)
236
236
 
237
237
  if item and item.respond_to?(:fq) and item.fq
238
- item.fq.each do |f,v|
238
+ Array(item.fq).each do |f,v|
239
239
  p = add_facet_params(f, v, p)
240
240
  end
241
241
  end
@@ -0,0 +1 @@
1
+ <%= link_to t('blacklight.bookmarks.clear.action_title'), clear_bookmarks_path, :method => :delete, :data => { :confirm => t('blacklight.bookmarks.clear.action_confirm') }, :class => 'clear-bookmarks btn btn-danger' %>
@@ -9,7 +9,6 @@
9
9
 
10
10
  <h3 class='section-heading'><%= t('blacklight.bookmarks.no_bookmarks') %></h3>
11
11
  <% else %>
12
- <%= link_to t('blacklight.bookmarks.clear.action_title'), clear_bookmarks_path, :method => :delete, :data => { :confirm => t('blacklight.bookmarks.clear.action_confirm') }, :class => 'clear-bookmarks btn btn-danger pull-right' %>
13
12
  <%= render 'sort_and_per_page' %>
14
13
  <%= render partial: 'tools', locals: { document_list: @document_list } %>
15
14
 
data/blacklight.gemspec CHANGED
@@ -19,7 +19,7 @@ Gem::Specification.new do |s|
19
19
 
20
20
  s.add_dependency "rails", ">= 3.2.6", "< 5"
21
21
  s.add_dependency "nokogiri", "~>1.6" # XML Parser
22
- s.add_dependency "kaminari", "~> 0.13" # the pagination (page 1,2,3, etc..) of our search results
22
+ s.add_dependency "kaminari", "~> 0.15" # the pagination (page 1,2,3, etc..) of our search results
23
23
  s.add_dependency "rsolr", "~> 1.0.11" # Library for interacting with rSolr.
24
24
  s.add_dependency "bootstrap-sass", "~> 3.2"
25
25
  s.add_dependency "deprecation"
@@ -188,6 +188,7 @@ en:
188
188
  more_html: 'more <span class="sr-only">%{field_name}</span> »'
189
189
  selected:
190
190
  remove: '[remove]'
191
+ missing: "[Missing]"
191
192
  group:
192
193
  more: 'more »'
193
194
  filters:
data/lib/blacklight.rb CHANGED
@@ -8,7 +8,8 @@ module Blacklight
8
8
  autoload :Configuration, 'blacklight/configuration'
9
9
  autoload :SearchFields, 'blacklight/search_fields'
10
10
  autoload :SearchBuilder, 'blacklight/search_builder'
11
-
11
+ autoload :SearchBuilderBehavior, 'blacklight/search_builder_behavior'
12
+
12
13
  autoload :Document, 'blacklight/document'
13
14
  autoload :Solr, 'blacklight/solr'
14
15
 
@@ -15,6 +15,8 @@ module Blacklight::Bookmarks
15
15
 
16
16
  before_filter :verify_user
17
17
 
18
+ blacklight_config.add_results_collection_tool(:clear_bookmarks_widget)
19
+
18
20
  blacklight_config.show.document_actions[:bookmark].if = false if blacklight_config.show.document_actions[:bookmark]
19
21
  blacklight_config.show.document_actions[:sms].if = false if blacklight_config.show.document_actions[:sms]
20
22
  end
@@ -78,7 +78,7 @@ module Blacklight::Catalog
78
78
  def facet
79
79
  @facet = blacklight_config.facet_fields[params[:id]]
80
80
  @response = get_facet_field_response(@facet.key, params)
81
- @display_facet = @response.facets.first
81
+ @display_facet = @response.aggregations[@facet.key]
82
82
 
83
83
  @pagination = facet_paginator(@facet, @display_facet)
84
84
 
@@ -212,7 +212,14 @@ module Blacklight
212
212
  end
213
213
 
214
214
  def search_builder_class
215
- super || Blacklight::Solr::SearchBuilder
215
+ super || locate_search_builder_class
216
+ end
217
+
218
+ def locate_search_builder_class
219
+ ::SearchBuilder
220
+ rescue NameError
221
+ Deprecation.warn(Configuration, "Your application is missing the SearchBuilder. Have you run `rails generate blacklight:search_builder`? Falling back to Blacklight::Solr::SearchBuilder")
222
+ Blacklight::Solr::SearchBuilder
216
223
  end
217
224
 
218
225
  def default_per_page
@@ -82,17 +82,23 @@ module Blacklight
82
82
  field_config_from_field_or_hash(config_key, *args)
83
83
  end
84
84
 
85
+ if (field_config.field || field_config.key).to_s =~ /\*/
86
+ field_config.match = Regexp.new("^" + (field_config.field || field_config.key).to_s.gsub('*', '.+') + "$")
87
+ end
88
+
85
89
  # look up any dynamic fields
86
- if (field_config.field || field_config.key).to_s =~ /\*/ and luke_fields
87
- wildcard_field = (field_config.field || field_config.key).to_s
88
- salient_fields = luke_fields.select do |k,v|
89
- k =~ Regexp.new("^" + wildcard_field.gsub('*', '.+') + "$")
90
+ if field_config.match
91
+
92
+ salient_fields = luke_fields.select do |k,v|
93
+ k =~ field_config.match
90
94
  end
91
95
 
92
96
  salient_fields.each do |field, luke_config|
93
97
  config = field_config.dup
98
+ config.match = nil
94
99
  config.field = field
95
100
  config.key = field
101
+
96
102
  if self[config_key.pluralize][ config.key ]
97
103
  self[config_key.pluralize][ config.key ] = config.merge(self[config_key.pluralize][ config.key ])
98
104
  else
@@ -123,15 +129,19 @@ module Blacklight
123
129
  return nil
124
130
  end
125
131
 
126
- @table[:luke_fields] ||= begin
127
- if has_key? :blacklight_solr
128
- blacklight_solr.get('admin/luke', params: { fl: '*', 'json.nl' => 'map' })['fields']
132
+ @table[:luke_fields] ||= Rails.cache.fetch("blacklight_configuration/admin/luke", expires_in: 1.hour) do
133
+ begin
134
+ if repository_class == Blacklight::SolrRepository
135
+ repository = repository_class.new(self)
136
+ repository.send_and_receive('admin/luke', params: { fl: '*', 'json.nl' => 'map' })['fields']
137
+ end
138
+ rescue => e
139
+ Blacklight.logger.warn "Error retrieving field metadata: #{e}"
140
+ false
129
141
  end
130
- rescue
131
- false
132
142
  end
133
143
 
134
- @table[:luke_fields] || nil
144
+ @table[:luke_fields] || {}
135
145
  end
136
146
 
137
147
  # Add a solr field by a solr field name and hash
@@ -26,6 +26,8 @@ module Blacklight::Document
26
26
  include Blacklight::Document::SemanticFields
27
27
  include Blacklight::Document::Export
28
28
 
29
+ extend Deprecation
30
+
29
31
  included do
30
32
  extend ActiveModel::Naming
31
33
  include Blacklight::Document::Extensions
@@ -52,7 +54,7 @@ module Blacklight::Document
52
54
  # If a method is missing, it gets sent to @_source
53
55
  # with all of the original params and block
54
56
  def method_missing(m, *args, &b)
55
- if _source and _source.respond_to? m
57
+ if _source_responds_to?(m)
56
58
  _source.send(m, *args, &b)
57
59
  else
58
60
  super
@@ -60,7 +62,7 @@ module Blacklight::Document
60
62
  end
61
63
 
62
64
  def respond_to_missing? *args
63
- (_source && _source.respond_to?(*args)) || super
65
+ _source_responds_to?(*args) || super
64
66
  end
65
67
 
66
68
  def [] *args
@@ -80,21 +82,29 @@ module Blacklight::Document
80
82
  # doc.has?(:location_facet, 'Clemons')
81
83
  # doc.has?(:id, 'h009', /^u/i)
82
84
  def has?(k, *values)
83
- return true if key?(k) and values.empty?
84
- return false if self[k].nil?
85
- target = self[k]
86
- if target.is_a?(Array)
87
- values.each do |val|
88
- return target.any?{|tv| val.is_a?(Regexp) ? (tv =~ val) : (tv==val)}
89
- end
85
+ if !key?(k)
86
+ false
87
+ elsif values.empty?
88
+ self[k].present?
90
89
  else
91
- return values.any? {|val| val.is_a?(Regexp) ? (target =~ val) : (target == val)}
90
+ Array(values).any? do |expected|
91
+ Array(self[k]).any? do |actual|
92
+ case expected
93
+ when Regexp
94
+ actual =~ expected
95
+ else
96
+ actual == expected
97
+ end
98
+ end
99
+ end
92
100
  end
93
101
  end
102
+ alias_method :has_field?, :has?
94
103
 
95
104
  def key? k
96
105
  _source.key? k
97
106
  end
107
+ alias_method :has_key?, :key?
98
108
 
99
109
  # helper
100
110
  # key is the name of the field
@@ -103,11 +113,24 @@ module Blacklight::Document
103
113
  # - :default - a value to return when the key doesn't exist
104
114
  # if :sep is nil and the field is a multivalued field, the array is returned
105
115
  def get(key, opts={:sep=>', ', :default=>nil})
116
+ val = fetch(key, opts[:default])
117
+
118
+ if val.is_a?(Array) and opts[:sep]
119
+ Deprecation.warn(Blacklight::Solr::Document, "#{self.class}#get with a :sep option is deprecated; use #[] or #fetch and join the values using e.g. Array#to_sentence") unless opts[:sep].nil?
120
+ val.join(opts[:sep])
121
+ else
122
+ val
123
+ end
124
+ end
125
+ deprecation_deprecate get: "Use #[] or #fetch instead"
126
+
127
+ def fetch key, *default
106
128
  if key? key
107
- val = self[key]
108
- (val.is_a?(Array) and opts[:sep]) ? val.join(opts[:sep]) : val
129
+ self[key]
130
+ elsif default.empty? and !block_given?
131
+ raise KeyError.new("key not found \"#{key}\"")
109
132
  else
110
- opts[:default]
133
+ (yield(self) if block_given?) || default.first
111
134
  end
112
135
  end
113
136
 
@@ -171,4 +194,11 @@ module Blacklight::Document
171
194
  self
172
195
  end
173
196
  end
197
+
198
+ private
199
+
200
+ def _source_responds_to? *args
201
+ _source && self != _source && _source.respond_to?(*args)
202
+ end
203
+
174
204
  end
@@ -82,7 +82,7 @@ module Blacklight
82
82
  end
83
83
  label = case field
84
84
  when Symbol
85
- @document.get(field, :sep => nil)
85
+ @document[field]
86
86
  when Proc
87
87
  field.call(@document, opts)
88
88
  when String
@@ -156,10 +156,14 @@ module Blacklight
156
156
  end
157
157
  end
158
158
  when field_config
159
- # regular solr
160
- @document.get(field_config.field, sep: nil)
159
+ # regular document field
160
+ if field_config.default and field_config.default.is_a? Proc
161
+ @document.fetch(field_config.field, &field_config.default)
162
+ else
163
+ @document.fetch(field_config.field, field_config.default)
164
+ end
161
165
  when field
162
- @document.get(field, sep: nil)
166
+ @document[field]
163
167
  end
164
168
 
165
169
  # rendering values
@@ -32,61 +32,13 @@ module Blacklight
32
32
  # Get a FacetField object from the @response
33
33
  def facet_by_field_name field_or_field_name
34
34
  case field_or_field_name
35
- when String, Symbol
36
- facet_field = facet_configuration_for_field(field_or_field_name)
37
- extract_facet_by_field(facet_field)
38
- when Blacklight::Configuration::FacetField
39
- extract_facet_by_field(field_or_field_name)
40
- else
41
- field_or_field_name
42
- end
43
- end
44
-
45
- private
46
-
47
- # Get the solr response for the field :field
48
- def extract_facet_by_field facet_field
49
- case
50
- when (facet_field.respond_to?(:query) and facet_field.query)
51
- create_facet_field_response_for_query_facet_field facet_field.key, facet_field
52
- when (facet_field.respond_to?(:pivot) and facet_field.pivot)
53
- create_facet_field_response_for_pivot_facet_field facet_field.key, facet_field
54
- else
55
- @response.facet_by_field_name(facet_field.field)
56
- end
57
- end
58
-
59
- def create_facet_field_response_for_query_facet_field facet_name, facet_field
60
- salient_facet_queries = facet_field.query.map { |k, x| x[:fq] }
61
- items = []
62
- @response.facet_queries.select { |k,v| salient_facet_queries.include?(k) }.reject { |value, hits| hits == 0 }.map do |value,hits|
63
- salient_fields = facet_field.query.select { |key, val| val[:fq] == value }
64
- key = ((salient_fields.keys if salient_fields.respond_to? :keys) || salient_fields.first).first
65
- items << Blacklight::SolrResponse::Facets::FacetItem.new(:value => key, :hits => hits, :label => facet_field.query[key][:label])
35
+ when String, Symbol, Blacklight::Configuration::FacetField
36
+ facet_field = facet_configuration_for_field(field_or_field_name)
37
+ @response.aggregations[facet_field.key]
38
+ else
39
+ # is this really a useful case?
40
+ field_or_field_name
66
41
  end
67
-
68
- Blacklight::SolrResponse::Facets::FacetField.new facet_name, items
69
- end
70
-
71
-
72
- def create_facet_field_response_for_pivot_facet_field facet_name, facet_field
73
- items = []
74
- (@response.facet_pivot[facet_field.pivot.join(",")] || []).map do |lst|
75
- items << construct_pivot_field(lst)
76
- end
77
-
78
- Blacklight::SolrResponse::Facets::FacetField.new facet_name, items
79
- end
80
-
81
- def construct_pivot_field lst, parent_fq = {}
82
- items = []
83
-
84
- lst[:pivot].each do |i|
85
- items << construct_pivot_field(i, parent_fq.merge({ lst[:field] => lst[:value] }))
86
- end if lst[:pivot]
87
-
88
- Blacklight::SolrResponse::Facets::FacetItem.new(:value => lst[:value], :hits => lst[:count], :field => lst[:field], :items => items, :fq => parent_fq)
89
-
90
42
  end
91
43
  end
92
44
  end
@@ -184,8 +184,8 @@ module Blacklight
184
184
  facet = blacklight_config.facet_fields[facet_field]
185
185
  return if facet.blank?
186
186
 
187
- if facet.limit and @response and @response.facet_by_field_name(facet_field)
188
- limit = @response.facet_by_field_name(facet_field).limit
187
+ if facet.limit and @response and @response.aggregations[facet_field]
188
+ limit = @response.aggregations[facet_field].limit
189
189
 
190
190
  if limit.nil? # we didn't get or a set a limit, so infer one.
191
191
  facet.limit if facet.limit != true
@@ -80,34 +80,64 @@ module Blacklight
80
80
  scope.blacklight_config
81
81
  end
82
82
 
83
- protected
84
- def request
85
- Blacklight::Solr::Request.new
83
+ def start start = nil
84
+ if start
85
+ @start = start.to_i
86
+ self
87
+ else
88
+ @start ||= (page - 1) * (rows || 10)
89
+
90
+ val = @start || 0
91
+ val = 0 if @start < 0
92
+ val
93
+ end
86
94
  end
95
+ alias_method :padding, :start
87
96
 
88
- def page
89
- if blacklight_params[:page].blank?
90
- 1
97
+ def page page = nil
98
+ if page
99
+ @page = page.to_i
100
+ @page = 1 if @page < 1
101
+ self
91
102
  else
92
- blacklight_params[:page].to_i
103
+ @page ||= begin
104
+ page = if blacklight_params[:page].blank?
105
+ 1
106
+ else
107
+ blacklight_params[:page].to_i
108
+ end
109
+
110
+ page
111
+ end
93
112
  end
94
113
  end
95
114
 
96
- def rows default = nil
97
- # default number of rows
98
- rows = default
99
- rows ||= blacklight_config.default_per_page
100
- rows ||= 10
115
+ def rows rows = nil
116
+ if rows
117
+ @rows = rows.to_i
118
+ @rows = blacklight_config.max_per_page if @rows > blacklight_config.max_per_page
119
+ self
120
+ else
121
+ @rows ||= begin
122
+ rows = blacklight_config.default_per_page
101
123
 
102
- # user-provided parameters should override any default row
103
- rows = blacklight_params[:rows].to_i unless blacklight_params[:rows].blank?
104
- rows = blacklight_params[:per_page].to_i unless blacklight_params[:per_page].blank?
124
+ # user-provided parameters should override any default row
125
+ rows = blacklight_params[:rows].to_i unless blacklight_params[:rows].blank?
126
+ rows = blacklight_params[:per_page].to_i unless blacklight_params[:per_page].blank?
105
127
 
106
- # ensure we don't excede the max page size
107
- rows = blacklight_config.max_per_page if rows.to_i > blacklight_config.max_per_page
128
+ # ensure we don't excede the max page size
129
+ rows = blacklight_config.max_per_page if rows.to_i > blacklight_config.max_per_page
108
130
 
131
+ rows.to_i unless rows.nil?
132
+ end
133
+ end
134
+ end
109
135
 
110
- rows
136
+ alias_method :per, :rows
137
+
138
+ protected
139
+ def request
140
+ Blacklight::Solr::Request.new
111
141
  end
112
142
 
113
143
  def sort