jruby_streaming_update_solr_server 0.1.1 → 0.1.2

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
@@ -3,9 +3,38 @@
3
3
  Some syntactic sugar on top of the StreamingUpdateSolrServer as provided by the Apache
4
4
  Solr project, along with its most common argument, the SolrInputDocument.
5
5
 
6
- Documentation can be generated with yard via the 'rake yard' action.
6
+ Documentation can be generated with yard via the 'rake yard' action and available online at http://rdoc.info/projects/billdueber/jruby_streaming_update_solr_server
7
+
8
+ See the class files for more information, documentation, and examples.
9
+
10
+ == Quick example
11
+
12
+ # @example Create and add a SolrInputDocument
13
+ # url = 'http://solrmachine:port/solr' # URL to solr
14
+ # queuesize = 10 # Size of producer cache
15
+ # threads = 2 # Number of consumer threads to push docs from queue to solr
16
+ #
17
+ # suss = StreamingUpdateSolrServer.new(url,queuesize,threads)
18
+ #
19
+ # doc = SolrInputDocument.new
20
+ # doc << ['title', 'This is the title']
21
+ # doc.add('title', "This is another title, added with 'add'")
22
+ # doc << ['id', 1]
23
+ # suss.add doc # or suss << doc
24
+ # # repeat as desired
25
+ # suss.commit
26
+ #
27
+ # @example Create and add as a hash
28
+ # # The "hash" just needs to be an object that responds to each_pair with field,value(s)
29
+ # suss = StreamingUpdateSolrServer.new(url,queuesize,threads)
30
+ # doc = {}
31
+ # doc['title'] = This is the title'
32
+ # doc[:id] = 1 # Can also take symbols instead of strings if you like
33
+ # doc[:author] = ['Bill', 'Mike']
34
+ # suss << doc
35
+ # # repeat as desired
36
+ # suss.commit
7
37
 
8
- See the class files for more information, documentation, and examples.
9
38
 
10
39
  == What is this again?
11
40
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.1
1
+ 0.1.2
@@ -127,16 +127,17 @@ class SolrInputDocument
127
127
  if field.is_a?(Symbol)
128
128
  field = field.to_s
129
129
  end
130
- if value.respond_to?(:each)
131
- value.each do |v|
132
- self.addField(field, v)
133
- end
134
- else
135
- self.addField(field, value)
136
- end
130
+ self.addField(field, value)
137
131
  self[field]
138
132
  end
139
133
 
134
+ def add(field, val)
135
+ if field.is_a?(Symbol)
136
+ field = field.to_s
137
+ end
138
+ self.addField(field, val)
139
+ self[field]
140
+ end
140
141
 
141
142
  # Get a list of the currently-set values for the passed field
142
143
  #
metadata CHANGED
@@ -1,37 +1,37 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jruby_streaming_update_solr_server
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
- - Bill Dueber
7
+ - Bill Dueber
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-02-12 00:00:00 -05:00
12
+ date: 2010-02-17 00:00:00 -05:00
13
13
  default_executable:
14
14
  dependencies:
15
- - !ruby/object:Gem::Dependency
16
- name: thoughtbot-shoulda
17
- type: :development
18
- version_requirement:
19
- version_requirements: !ruby/object:Gem::Requirement
20
- requirements:
21
- - - ">="
22
- - !ruby/object:Gem::Version
23
- version: "0"
24
- version:
25
- - !ruby/object:Gem::Dependency
26
- name: yard
27
- type: :development
28
- version_requirement:
29
- version_requirements: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: "0"
34
- version:
15
+ - !ruby/object:Gem::Dependency
16
+ name: thoughtbot-shoulda
17
+ type: :development
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: "0"
24
+ version:
25
+ - !ruby/object:Gem::Dependency
26
+ name: yard
27
+ type: :development
28
+ version_requirement:
29
+ version_requirements: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: "0"
34
+ version:
35
35
  description: Some sugar on top of StreamingUpdateSolrServer for use within JRuby
36
36
  email: bill@dueber.com
37
37
  executables: []
@@ -39,44 +39,44 @@ executables: []
39
39
  extensions: []
40
40
 
41
41
  extra_rdoc_files:
42
- - LICENSE
43
- - README.rdoc
42
+ - LICENSE
43
+ - README.rdoc
44
44
  files:
45
- - .document
46
- - .gitignore
47
- - LICENSE
48
- - README.rdoc
49
- - Rakefile
50
- - VERSION
51
- - jars/apache-solr-solrj-1.5-dev.jar
52
- - jars/commons-codec-1.3.jar
53
- - jars/commons-httpclient-3.1.jar
54
- - jars/commons-logging-1.1.1.jar
55
- - jars/slf4j-api-1.5.5.jar
56
- - jars/slf4j-jdk14-1.5.5 2.jar
57
- - lib/jruby_streaming_update_solr_server.rb
58
- - test/helper.rb
59
- - test/test_jruby_streaming_update_solr_server.rb
45
+ - .document
46
+ - .gitignore
47
+ - LICENSE
48
+ - README.rdoc
49
+ - Rakefile
50
+ - VERSION
51
+ - jars/apache-solr-solrj-1.5-dev.jar
52
+ - jars/commons-codec-1.3.jar
53
+ - jars/commons-httpclient-3.1.jar
54
+ - jars/commons-logging-1.1.1.jar
55
+ - jars/slf4j-api-1.5.5.jar
56
+ - jars/slf4j-jdk14-1.5.5 2.jar
57
+ - lib/jruby_streaming_update_solr_server.rb
58
+ - test/helper.rb
59
+ - test/test_jruby_streaming_update_solr_server.rb
60
60
  has_rdoc: true
61
61
  homepage: http://github.com/billdueber/jruby_streaming_update_solr_server
62
62
  licenses: []
63
63
 
64
64
  post_install_message:
65
65
  rdoc_options:
66
- - --charset=UTF-8
66
+ - --charset=UTF-8
67
67
  require_paths:
68
- - lib
68
+ - lib
69
69
  required_ruby_version: !ruby/object:Gem::Requirement
70
70
  requirements:
71
- - - ">="
72
- - !ruby/object:Gem::Version
73
- version: "0"
71
+ - - ">="
72
+ - !ruby/object:Gem::Version
73
+ version: "0"
74
74
  version:
75
75
  required_rubygems_version: !ruby/object:Gem::Requirement
76
76
  requirements:
77
- - - ">="
78
- - !ruby/object:Gem::Version
79
- version: "0"
77
+ - - ">="
78
+ - !ruby/object:Gem::Version
79
+ version: "0"
80
80
  version:
81
81
  requirements: []
82
82
 
@@ -86,5 +86,5 @@ signing_key:
86
86
  specification_version: 3
87
87
  summary: Simple jruby interface into StreamingUpdateSolrServer
88
88
  test_files:
89
- - test/helper.rb
90
- - test/test_jruby_streaming_update_solr_server.rb
89
+ - test/helper.rb
90
+ - test/test_jruby_streaming_update_solr_server.rb