jruby_streaming_update_solr_server 0.4.1 → 0.5.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.
data/README.rdoc CHANGED
@@ -63,6 +63,11 @@ Note that you can use threach to multi-thread it all.
63
63
 
64
64
  === CHANGES
65
65
 
66
+ 0.5.0 (2010.09.16)
67
+ * Removed a begin/rescue/end block that had been looking for simple argumenterrors for logging; speedup is
68
+ tremendous.
69
+ * No longer allow "array-like" in #add; only allow actual Arrays. Again, speedup.
70
+
66
71
  0.4.1 (2010.09.07)
67
72
  * Updated documentation
68
73
  * Added access to document-level boost via #boost and #boost=
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.1
1
+ 0.5.0
@@ -165,23 +165,18 @@ class SolrInputDocument
165
165
 
166
166
  # Add a value to a field. Will add all elements of an array in turn
167
167
  # @param [String] field The field to add a value or values to
168
- # @param [String, Numeric, #each] val The value or array-like of values to add.
168
+ # @param [String, Numeric, Array] val The value or array of values to add.
169
169
  # @param [Float] boost The boost for this field
170
- # @return [Array<String,Numeric>] An array of the field's values after this addition
170
+ # @return [Undefined]
171
171
 
172
172
  def add(field, val, boost=nil)
173
173
  return if val == nil
174
- if val.is_a? String or val.is_a? Numeric
175
- self.addField(field, val)
174
+ if val.is_a? Array
175
+ val.each {|v| self.add(field, v)}
176
176
  else
177
- begin
178
- val.each {|v| self.add(field, v)}
179
- rescue NoMethodError => e
180
- raise NoMethodError, "SolrInputDocument values must be a string, numeric, or an array-like (responds to #each) of same, not #{val.inspect}"
181
- end
177
+ self.addField(field, val)
182
178
  end
183
179
  self.boost = boost if boost
184
- return self[field]
185
180
  end
186
181
 
187
182
 
@@ -197,9 +192,7 @@ class SolrInputDocument
197
192
  # doc << ['author', ['Bill', 'Mike', 'Molly']] #=> ['Bill', 'Mike', 'Molly']
198
193
 
199
194
  def << fv
200
- field = fv[0]
201
- value = fv[1]
202
- self.add(field, value)
195
+ self.add(fv[0], fv[1])
203
196
  end
204
197
 
205
198
  # Get a list of the currently-set values for the passed field
@@ -221,7 +214,7 @@ class SolrInputDocument
221
214
  #
222
215
  # @param [String] field The solr field you're setting the value of
223
216
  # @param [String, Array<String>] value The value or array of values to set
224
- # @return [Array<String>] The list of values (i.e., either +value+ or +[value]+)
217
+ # @return [Undefined]
225
218
  #
226
219
  # @example
227
220
  # doc = SolrInputDocument.new
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jruby_streaming_update_solr_server
3
3
  version: !ruby/object:Gem::Version
4
- hash: 13
4
+ hash: 11
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
- - 4
9
- - 1
10
- version: 0.4.1
8
+ - 5
9
+ - 0
10
+ version: 0.5.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Bill Dueber
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-09-07 00:00:00 -04:00
18
+ date: 2010-09-16 00:00:00 -04:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency