mrcsparker-sunspot_solr 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +3 -0
- data/README.rdoc +24 -0
- data/bin/sunspot-installer +20 -0
- data/bin/sunspot-solr +80 -0
- data/lib/sunspot/solr/installer.rb +25 -0
- data/lib/sunspot/solr/installer/config_installer.rb +46 -0
- data/lib/sunspot/solr/installer/task_helper.rb +13 -0
- data/lib/sunspot/solr/java.rb +10 -0
- data/lib/sunspot/solr/railtie.rb +15 -0
- data/lib/sunspot/solr/server.rb +224 -0
- data/lib/sunspot/solr/tasks.rb +49 -0
- data/lib/sunspot_solr.rb +5 -0
- data/solr/README.txt +42 -0
- data/solr/etc/jetty.xml +219 -0
- data/solr/etc/webdefault.xml +379 -0
- data/solr/lib/jetty-6.1.26-patched-JETTY-1340.jar +0 -0
- data/solr/lib/jetty-util-6.1.26-patched-JETTY-1340.jar +0 -0
- data/solr/lib/jsp-2.1/ant-1.6.5.jar +0 -0
- data/solr/lib/jsp-2.1/core-3.1.1.jar +0 -0
- data/solr/lib/jsp-2.1/jsp-2.1.jar +0 -0
- data/solr/lib/jsp-2.1/jsp-api-2.1.jar +0 -0
- data/solr/lib/servlet-api-2.5-20081211.jar +0 -0
- data/solr/solr/.gitignore +1 -0
- data/solr/solr/README.txt +54 -0
- data/solr/solr/conf/admin-extra.html +31 -0
- data/solr/solr/conf/elevate.xml +36 -0
- data/solr/solr/conf/mapping-ISOLatin1Accent.txt +246 -0
- data/solr/solr/conf/protwords.txt +21 -0
- data/solr/solr/conf/schema.xml +238 -0
- data/solr/solr/conf/scripts.conf +24 -0
- data/solr/solr/conf/solrconfig.xml +934 -0
- data/solr/solr/conf/spellings.txt +2 -0
- data/solr/solr/conf/stopwords.txt +58 -0
- data/solr/solr/conf/synonyms.txt +31 -0
- data/solr/solr/conf/xslt/example.xsl +132 -0
- data/solr/solr/conf/xslt/example_atom.xsl +67 -0
- data/solr/solr/conf/xslt/example_rss.xsl +66 -0
- data/solr/solr/conf/xslt/luke.xsl +337 -0
- data/solr/start.jar +0 -0
- data/solr/webapps/solr.war +0 -0
- data/spec/server_spec.rb +98 -0
- data/spec/spec_helper.rb +18 -0
- data/sunspot_solr.gemspec +39 -0
- metadata +176 -0
data/solr/start.jar
ADDED
Binary file
|
Binary file
|
data/spec/server_spec.rb
ADDED
@@ -0,0 +1,98 @@
|
|
1
|
+
require File.expand_path('spec_helper', File.dirname(__FILE__))
|
2
|
+
require 'tempfile'
|
3
|
+
|
4
|
+
describe Sunspot::Solr::Server do
|
5
|
+
SUNSPOT_START_JAR = File.expand_path(
|
6
|
+
File.join(File.dirname(__FILE__), '..', '..', 'solr', 'start.jar')
|
7
|
+
)
|
8
|
+
|
9
|
+
before :each do
|
10
|
+
@server = Sunspot::Solr::Server.new
|
11
|
+
end
|
12
|
+
|
13
|
+
it 'runs server in current process' do
|
14
|
+
@server.should_not_receive(:fork)
|
15
|
+
@server.should_receive(:exec).with(/java .*-jar start.jar/)
|
16
|
+
@server.run
|
17
|
+
end
|
18
|
+
|
19
|
+
it 'runs Java with min memory' do
|
20
|
+
@server.min_memory = 1024
|
21
|
+
@server.should_receive(:exec).with(/-Xms1024/)
|
22
|
+
@server.run
|
23
|
+
end
|
24
|
+
|
25
|
+
it 'runs Java with max memory' do
|
26
|
+
@server.max_memory = 2048
|
27
|
+
@server.should_receive(:exec).with(/-Xmx2048/)
|
28
|
+
@server.run
|
29
|
+
end
|
30
|
+
|
31
|
+
it 'runs Jetty with specified port' do
|
32
|
+
@server.port = 8981
|
33
|
+
@server.should_receive(:exec).with(/-Djetty\.port=8981/)
|
34
|
+
@server.run
|
35
|
+
end
|
36
|
+
|
37
|
+
it 'runs Solr with specified data dir' do
|
38
|
+
@server.solr_data_dir = '/tmp/var/solr/data'
|
39
|
+
@server.should_receive(:exec).with(%r(-Dsolr\.data\.dir=/tmp/var/solr/data))
|
40
|
+
@server.run
|
41
|
+
end
|
42
|
+
|
43
|
+
it 'runs Solr with specified Solr home' do
|
44
|
+
@server.solr_home = '/tmp/var/solr'
|
45
|
+
@server.should_receive(:exec).with(%r(-Dsolr\.solr\.home=/tmp/var/solr))
|
46
|
+
@server.run
|
47
|
+
end
|
48
|
+
|
49
|
+
it 'runs Solr with specified Solr jar' do
|
50
|
+
@server.solr_jar = SUNSPOT_START_JAR
|
51
|
+
FileUtils.should_receive(:cd).with(File.dirname(SUNSPOT_START_JAR))
|
52
|
+
@server.run
|
53
|
+
end
|
54
|
+
|
55
|
+
it 'raises an error if java is missing' do
|
56
|
+
Sunspot::Solr::Java.stub(:installed? => false)
|
57
|
+
expect {
|
58
|
+
Sunspot::Solr::Server.new
|
59
|
+
}.to raise_error(Sunspot::Solr::Server::JavaMissing)
|
60
|
+
end
|
61
|
+
|
62
|
+
describe 'with logging' do
|
63
|
+
before :each do
|
64
|
+
@server.log_level = 'info'
|
65
|
+
@server.log_file = 'log/sunspot-development.log'
|
66
|
+
Tempfile.should_receive(:new).with('logging.properties').and_return(@tempfile = StringIO.new)
|
67
|
+
@tempfile.should_receive(:flush)
|
68
|
+
@tempfile.should_receive(:close)
|
69
|
+
@tempfile.stub!(:path).and_return('/tmp/logging.properties.12345')
|
70
|
+
@server.stub!(:exec)
|
71
|
+
end
|
72
|
+
|
73
|
+
it 'runs Solr with logging properties file' do
|
74
|
+
@server.should_receive(:exec).with(%r(-Djava\.util\.logging\.config\.file=/tmp/logging\.properties\.12345))
|
75
|
+
@server.run
|
76
|
+
end
|
77
|
+
|
78
|
+
it 'sets logging level' do
|
79
|
+
@server.run
|
80
|
+
@tempfile.string.should =~ /^java\.util\.logging\.FileHandler\.level *= *INFO$/
|
81
|
+
end
|
82
|
+
|
83
|
+
it 'sets handler' do
|
84
|
+
@server.run
|
85
|
+
@tempfile.string.should =~ /^handlers *= *java.util.logging.FileHandler$/
|
86
|
+
end
|
87
|
+
|
88
|
+
it 'sets formatter' do
|
89
|
+
@server.run
|
90
|
+
@tempfile.string.should =~ /^java\.util\.logging\.FileHandler\.formatter *= *java\.util\.logging\.SimpleFormatter$/
|
91
|
+
end
|
92
|
+
|
93
|
+
it 'sets log file' do
|
94
|
+
@server.run
|
95
|
+
@tempfile.string.should =~ /^java\.util\.logging\.FileHandler\.pattern *= *log\/sunspot-development\.log$/
|
96
|
+
end
|
97
|
+
end
|
98
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
begin
|
2
|
+
require 'rspec'
|
3
|
+
rescue LoadError => e
|
4
|
+
require 'spec'
|
5
|
+
end
|
6
|
+
|
7
|
+
require 'sunspot_solr'
|
8
|
+
|
9
|
+
rspec =
|
10
|
+
begin
|
11
|
+
RSpec
|
12
|
+
rescue NameError, ArgumentError
|
13
|
+
Spec::Runner
|
14
|
+
end
|
15
|
+
|
16
|
+
rspec.configure do |config|
|
17
|
+
# Maybe later...
|
18
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
lib = File.expand_path('../../sunspot/lib/', __FILE__)
|
3
|
+
|
4
|
+
$:.unshift(lib) unless $:.include?(lib)
|
5
|
+
|
6
|
+
require 'sunspot/version'
|
7
|
+
|
8
|
+
Gem::Specification.new do |s|
|
9
|
+
s.name = "mrcsparker-sunspot_solr"
|
10
|
+
s.version = "1.3.0"
|
11
|
+
s.platform = Gem::Platform::RUBY
|
12
|
+
s.authors = ['Mat Brown', 'Peer Allan', 'Dmitriy Dzema', 'Benjamin Krause', 'Marcel de Graaf', 'Brandon Keepers', 'Peter Berkenbosch',
|
13
|
+
'Brian Atkinson', 'Tom Coleman', 'Matt Mitchell', 'Nathan Beyer', 'Kieran Topping', 'Nicolas Braem', 'Jeremy Ashkenas',
|
14
|
+
'Dylan Vaughn', 'Brian Durand', 'Sam Granieri', 'Nick Zadrozny', 'Jason Ronallo']
|
15
|
+
s.email = ["mat@patch.com"]
|
16
|
+
s.homepage = 'https://github.com/outoftime/sunspot/tree/master/sunspot_solr'
|
17
|
+
s.summary = 'Bundled Solr distribution for Sunspot. Temporary version that uses solr 3.5.0.'
|
18
|
+
s.description = <<-TEXT
|
19
|
+
Sunspot::Solr provides a bundled Solr distribution for use with Sunspot.
|
20
|
+
Typical deployment environments will require more configuration, but this
|
21
|
+
distribution is well suited to development and testing.
|
22
|
+
TEXT
|
23
|
+
|
24
|
+
s.rubyforge_project = "sunspot"
|
25
|
+
|
26
|
+
s.files = `git ls-files`.split("\n")
|
27
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
28
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
29
|
+
s.require_paths = ["lib"]
|
30
|
+
|
31
|
+
s.add_dependency 'escape', '~>0.0.4'
|
32
|
+
|
33
|
+
s.add_development_dependency 'rspec', '~> 1.1'
|
34
|
+
s.add_development_dependency 'hanna'
|
35
|
+
|
36
|
+
s.rdoc_options << '--webcvs=http://github.com/outoftime/sunspot/tree/master/%s' <<
|
37
|
+
'--title' << 'Sunspot-Solr - Bundled Solr distribution for Sunspot - API Documentation' <<
|
38
|
+
'--main' << 'README.rdoc'
|
39
|
+
end
|
metadata
ADDED
@@ -0,0 +1,176 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: mrcsparker-sunspot_solr
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 27
|
5
|
+
prerelease:
|
6
|
+
segments:
|
7
|
+
- 1
|
8
|
+
- 3
|
9
|
+
- 0
|
10
|
+
version: 1.3.0
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- Mat Brown
|
14
|
+
- Peer Allan
|
15
|
+
- Dmitriy Dzema
|
16
|
+
- Benjamin Krause
|
17
|
+
- Marcel de Graaf
|
18
|
+
- Brandon Keepers
|
19
|
+
- Peter Berkenbosch
|
20
|
+
- Brian Atkinson
|
21
|
+
- Tom Coleman
|
22
|
+
- Matt Mitchell
|
23
|
+
- Nathan Beyer
|
24
|
+
- Kieran Topping
|
25
|
+
- Nicolas Braem
|
26
|
+
- Jeremy Ashkenas
|
27
|
+
- Dylan Vaughn
|
28
|
+
- Brian Durand
|
29
|
+
- Sam Granieri
|
30
|
+
- Nick Zadrozny
|
31
|
+
- Jason Ronallo
|
32
|
+
autorequire:
|
33
|
+
bindir: bin
|
34
|
+
cert_chain: []
|
35
|
+
|
36
|
+
date: 2011-12-09 00:00:00 Z
|
37
|
+
dependencies:
|
38
|
+
- !ruby/object:Gem::Dependency
|
39
|
+
name: escape
|
40
|
+
prerelease: false
|
41
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
42
|
+
none: false
|
43
|
+
requirements:
|
44
|
+
- - ~>
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
hash: 23
|
47
|
+
segments:
|
48
|
+
- 0
|
49
|
+
- 0
|
50
|
+
- 4
|
51
|
+
version: 0.0.4
|
52
|
+
type: :runtime
|
53
|
+
version_requirements: *id001
|
54
|
+
- !ruby/object:Gem::Dependency
|
55
|
+
name: rspec
|
56
|
+
prerelease: false
|
57
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
58
|
+
none: false
|
59
|
+
requirements:
|
60
|
+
- - ~>
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
hash: 13
|
63
|
+
segments:
|
64
|
+
- 1
|
65
|
+
- 1
|
66
|
+
version: "1.1"
|
67
|
+
type: :development
|
68
|
+
version_requirements: *id002
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: hanna
|
71
|
+
prerelease: false
|
72
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ">="
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
hash: 3
|
78
|
+
segments:
|
79
|
+
- 0
|
80
|
+
version: "0"
|
81
|
+
type: :development
|
82
|
+
version_requirements: *id003
|
83
|
+
description: " Sunspot::Solr provides a bundled Solr distribution for use with Sunspot.\n Typical deployment environments will require more configuration, but this\n distribution is well suited to development and testing.\n"
|
84
|
+
email:
|
85
|
+
- mat@patch.com
|
86
|
+
executables:
|
87
|
+
- sunspot-installer
|
88
|
+
- sunspot-solr
|
89
|
+
extensions: []
|
90
|
+
|
91
|
+
extra_rdoc_files: []
|
92
|
+
|
93
|
+
files:
|
94
|
+
- Gemfile
|
95
|
+
- README.rdoc
|
96
|
+
- bin/sunspot-installer
|
97
|
+
- bin/sunspot-solr
|
98
|
+
- lib/sunspot/solr/installer.rb
|
99
|
+
- lib/sunspot/solr/installer/config_installer.rb
|
100
|
+
- lib/sunspot/solr/installer/task_helper.rb
|
101
|
+
- lib/sunspot/solr/java.rb
|
102
|
+
- lib/sunspot/solr/railtie.rb
|
103
|
+
- lib/sunspot/solr/server.rb
|
104
|
+
- lib/sunspot/solr/tasks.rb
|
105
|
+
- lib/sunspot_solr.rb
|
106
|
+
- solr/README.txt
|
107
|
+
- solr/etc/jetty.xml
|
108
|
+
- solr/etc/webdefault.xml
|
109
|
+
- solr/lib/jetty-6.1.26-patched-JETTY-1340.jar
|
110
|
+
- solr/lib/jetty-util-6.1.26-patched-JETTY-1340.jar
|
111
|
+
- solr/lib/jsp-2.1/ant-1.6.5.jar
|
112
|
+
- solr/lib/jsp-2.1/core-3.1.1.jar
|
113
|
+
- solr/lib/jsp-2.1/jsp-2.1.jar
|
114
|
+
- solr/lib/jsp-2.1/jsp-api-2.1.jar
|
115
|
+
- solr/lib/servlet-api-2.5-20081211.jar
|
116
|
+
- solr/solr/.gitignore
|
117
|
+
- solr/solr/README.txt
|
118
|
+
- solr/solr/conf/admin-extra.html
|
119
|
+
- solr/solr/conf/elevate.xml
|
120
|
+
- solr/solr/conf/mapping-ISOLatin1Accent.txt
|
121
|
+
- solr/solr/conf/protwords.txt
|
122
|
+
- solr/solr/conf/schema.xml
|
123
|
+
- solr/solr/conf/scripts.conf
|
124
|
+
- solr/solr/conf/solrconfig.xml
|
125
|
+
- solr/solr/conf/spellings.txt
|
126
|
+
- solr/solr/conf/stopwords.txt
|
127
|
+
- solr/solr/conf/synonyms.txt
|
128
|
+
- solr/solr/conf/xslt/example.xsl
|
129
|
+
- solr/solr/conf/xslt/example_atom.xsl
|
130
|
+
- solr/solr/conf/xslt/example_rss.xsl
|
131
|
+
- solr/solr/conf/xslt/luke.xsl
|
132
|
+
- solr/start.jar
|
133
|
+
- solr/webapps/solr.war
|
134
|
+
- spec/server_spec.rb
|
135
|
+
- spec/spec_helper.rb
|
136
|
+
- sunspot_solr.gemspec
|
137
|
+
homepage: https://github.com/outoftime/sunspot/tree/master/sunspot_solr
|
138
|
+
licenses: []
|
139
|
+
|
140
|
+
post_install_message:
|
141
|
+
rdoc_options:
|
142
|
+
- --webcvs=http://github.com/outoftime/sunspot/tree/master/%s
|
143
|
+
- --title
|
144
|
+
- Sunspot-Solr - Bundled Solr distribution for Sunspot - API Documentation
|
145
|
+
- --main
|
146
|
+
- README.rdoc
|
147
|
+
require_paths:
|
148
|
+
- lib
|
149
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
150
|
+
none: false
|
151
|
+
requirements:
|
152
|
+
- - ">="
|
153
|
+
- !ruby/object:Gem::Version
|
154
|
+
hash: 3
|
155
|
+
segments:
|
156
|
+
- 0
|
157
|
+
version: "0"
|
158
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
159
|
+
none: false
|
160
|
+
requirements:
|
161
|
+
- - ">="
|
162
|
+
- !ruby/object:Gem::Version
|
163
|
+
hash: 3
|
164
|
+
segments:
|
165
|
+
- 0
|
166
|
+
version: "0"
|
167
|
+
requirements: []
|
168
|
+
|
169
|
+
rubyforge_project: sunspot
|
170
|
+
rubygems_version: 1.8.12
|
171
|
+
signing_key:
|
172
|
+
specification_version: 3
|
173
|
+
summary: Bundled Solr distribution for Sunspot. Temporary version that uses solr 3.5.0.
|
174
|
+
test_files:
|
175
|
+
- spec/server_spec.rb
|
176
|
+
- spec/spec_helper.rb
|