solrsan 0.5.2 → 0.5.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -22,8 +22,8 @@ module Solrsan
22
22
  doc.merge(converted_fields)
23
23
  end
24
24
 
25
- def solr_index
26
- self.class.solr_index(self)
25
+ def solr_index(opts={:add_attributes => {:commitWithin => 10}})
26
+ self.class.solr_index(self, opts)
27
27
  end
28
28
 
29
29
  def destroy_index_document
@@ -43,7 +43,7 @@ module Solrsan
43
43
  end
44
44
 
45
45
  module ClassMethods
46
- def solr_index(doc)
46
+ def solr_index(doc, opts={:add_attributes => {:commitWithin => 10}})
47
47
  solr_docs = []
48
48
  if doc.respond_to?(:map)
49
49
  solr_docs = doc.map{|document| document.indexed_fields }
@@ -52,8 +52,9 @@ module Solrsan
52
52
  else
53
53
  raise "Indexed document must define a as_solr_document method."
54
54
  end
55
+
55
56
  self.perform_solr_command do |rsolr|
56
- rsolr.add(solr_docs)
57
+ rsolr.add(solr_docs, opts)
57
58
  end
58
59
  end
59
60
 
@@ -1,3 +1,3 @@
1
1
  module Solrsan
2
- VERSION = "0.5.2"
2
+ VERSION = "0.5.4"
3
3
  end
data/lib/tasks/solr.rake CHANGED
@@ -23,17 +23,18 @@ namespace :solr do
23
23
  start_solr_cmd = "java -jar start.jar"
24
24
  logging_xml = "etc/jetty-logging.xml"
25
25
  jetty_port_opt = "jetty.port=#{jetty_port}"
26
+ jetty_version = "7.6.0.RC4"
26
27
  solr_params = "#{jetty_port_opt} -Dsolr.solr.home=\"#{solr_home}\" -Dsolr.data.dir=\"#{solr_data_dir}\""
27
28
 
28
29
  desc "Install solr"
29
30
  task :setup do
30
- run_system_command "wget http://download.eclipse.org/jetty/7.5.4.v20111024/dist/jetty-distribution-7.5.4.v20111024.tar.gz"
31
+ run_system_command "wget http://download.eclipse.org/jetty/#{jetty_version}/dist/jetty-distribution-#{jetty_version}.tar.gz"
31
32
  run_system_command "tar -zxvf jetty-distribution-*.tar.gz"
32
33
  run_system_command "rm jetty-distribution-*.tar.gz"
33
34
  run_system_command "sudo mv jetty-distribution-* /usr/local"
34
35
  run_system_command "sudo ln -s /usr/local/jetty-distribution-* #{jetty_path}"
35
36
 
36
- run_system_command "wget http://www.ecoficial.com/apachemirror/lucene/solr/3.4.0/apache-solr-3.4.0.tgz"
37
+ run_system_command "wget http://www.ecoficial.com/apachemirror/lucene/solr/3.5.0/apache-solr-3.5.0.tgz"
37
38
  run_system_command "tar -zxvf apache-solr-*.tgz"
38
39
  run_system_command "sudo cp apache-solr-*/dist/apache-solr-*.war #{jetty_path}/webapps/solr.war"
39
40
  run_system_command "sudo mkdir -p #{solr_data_dir}"
data/solrsan.gemspec CHANGED
@@ -12,7 +12,7 @@ Gem::Specification.new do |s|
12
12
  s.summary = %q{Lightweight wrapper for using Apache Solr within a Ruby application including Rails and Sinatra.}
13
13
  s.description = %q{solrsan is a lightweight wrapper for using Apache Solr within a Ruby application including Rails and Sinatra.}
14
14
 
15
- s.add_dependency('rsolr', '~>1.0.3')
15
+ s.add_dependency('rsolr', '~>1.0.4')
16
16
  s.add_dependency('activemodel', '~>3.1.1')
17
17
  s.add_dependency('activesupport', '~>3.1.1')
18
18
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solrsan
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: 0.5.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,22 +9,22 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-12-04 00:00:00.000000000 Z
12
+ date: 2012-01-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rsolr
16
- requirement: &70260192595060 !ruby/object:Gem::Requirement
16
+ requirement: &70167795674440 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
20
20
  - !ruby/object:Gem::Version
21
- version: 1.0.3
21
+ version: 1.0.4
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70260192595060
24
+ version_requirements: *70167795674440
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: activemodel
27
- requirement: &70260192593880 !ruby/object:Gem::Requirement
27
+ requirement: &70167795827680 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 3.1.1
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70260192593880
35
+ version_requirements: *70167795827680
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: activesupport
38
- requirement: &70260192592320 !ruby/object:Gem::Requirement
38
+ requirement: &70167795825720 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,7 +43,7 @@ dependencies:
43
43
  version: 3.1.1
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *70260192592320
46
+ version_requirements: *70167795825720
47
47
  description: solrsan is a lightweight wrapper for using Apache Solr within a Ruby
48
48
  application including Rails and Sinatra.
49
49
  email: