qiny_sunspot_solr 2.1.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 (63) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +3 -0
  3. data/README.rdoc +24 -0
  4. data/bin/sunspot-installer +20 -0
  5. data/bin/sunspot-solr +80 -0
  6. data/lib/sunspot/solr/installer.rb +25 -0
  7. data/lib/sunspot/solr/installer/config_installer.rb +62 -0
  8. data/lib/sunspot/solr/installer/task_helper.rb +13 -0
  9. data/lib/sunspot/solr/java.rb +13 -0
  10. data/lib/sunspot/solr/railtie.rb +15 -0
  11. data/lib/sunspot/solr/server.rb +224 -0
  12. data/lib/sunspot/solr/tasks.rb +49 -0
  13. data/lib/sunspot_solr.rb +5 -0
  14. data/solr/README.txt +42 -0
  15. data/solr/contexts/solr.xml +8 -0
  16. data/solr/etc/jetty.xml +167 -0
  17. data/solr/etc/webdefault.xml +527 -0
  18. data/solr/lib/ext/jcl-over-slf4j-1.6.6.jar +0 -0
  19. data/solr/lib/ext/jul-to-slf4j-1.6.6.jar +0 -0
  20. data/solr/lib/ext/log4j-1.2.16.jar +0 -0
  21. data/solr/lib/ext/log4j.properties +19 -0
  22. data/solr/lib/ext/slf4j-api-1.6.6.jar +0 -0
  23. data/solr/lib/ext/slf4j-log4j12-1.6.6.jar +0 -0
  24. data/solr/lib/jetty-continuation-8.1.8.v20121106.jar +0 -0
  25. data/solr/lib/jetty-deploy-8.1.8.v20121106.jar +0 -0
  26. data/solr/lib/jetty-http-8.1.8.v20121106.jar +0 -0
  27. data/solr/lib/jetty-io-8.1.8.v20121106.jar +0 -0
  28. data/solr/lib/jetty-jmx-8.1.8.v20121106.jar +0 -0
  29. data/solr/lib/jetty-security-8.1.8.v20121106.jar +0 -0
  30. data/solr/lib/jetty-server-8.1.8.v20121106.jar +0 -0
  31. data/solr/lib/jetty-servlet-8.1.8.v20121106.jar +0 -0
  32. data/solr/lib/jetty-util-8.1.8.v20121106.jar +0 -0
  33. data/solr/lib/jetty-webapp-8.1.8.v20121106.jar +0 -0
  34. data/solr/lib/jetty-xml-8.1.8.v20121106.jar +0 -0
  35. data/solr/lib/jsp-2.1/ant-1.6.5.jar +0 -0
  36. data/solr/lib/jsp-2.1/core-3.1.1.jar +0 -0
  37. data/solr/lib/jsp-2.1/jsp-2.1.jar +0 -0
  38. data/solr/lib/jsp-2.1/jsp-api-2.1.jar +0 -0
  39. data/solr/lib/servlet-api-3.0.jar +0 -0
  40. data/solr/solr/.gitignore +1 -0
  41. data/solr/solr/conf/admin-extra.html +31 -0
  42. data/solr/solr/conf/elevate.xml +36 -0
  43. data/solr/solr/conf/mapping-ISOLatin1Accent.txt +246 -0
  44. data/solr/solr/conf/protwords.txt +21 -0
  45. data/solr/solr/conf/schema.xml +262 -0
  46. data/solr/solr/conf/scripts.conf +24 -0
  47. data/solr/solr/conf/solrconfig.xml +667 -0
  48. data/solr/solr/conf/spellings.txt +2 -0
  49. data/solr/solr/conf/stopwords.txt +58 -0
  50. data/solr/solr/conf/synonyms.txt +31 -0
  51. data/solr/solr/conf/xslt/example.xsl +132 -0
  52. data/solr/solr/conf/xslt/example_atom.xsl +67 -0
  53. data/solr/solr/conf/xslt/example_rss.xsl +66 -0
  54. data/solr/solr/conf/xslt/luke.xsl +337 -0
  55. data/solr/solr/default/README.txt +54 -0
  56. data/solr/solr/dic/words.dic +149853 -0
  57. data/solr/solr/solr.xml +8 -0
  58. data/solr/start.jar +0 -0
  59. data/solr/webapps/solr.war +0 -0
  60. data/spec/server_spec.rb +98 -0
  61. data/spec/spec_helper.rb +18 -0
  62. data/sunspot_solr.gemspec +40 -0
  63. metadata +165 -0
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="UTF-8" ?>
2
+ <solr persistent="false">
3
+ <cores adminPath="/admin/cores" host="${host:}" hostPort="${jetty.port:}">
4
+ <core name="default" instanceDir="." dataDir="default/data"/>
5
+ <core name="development" instanceDir="." dataDir="development/data"/>
6
+ <core name="test" instanceDir="." dataDir="test/data"/>
7
+ </cores>
8
+ </solr>
data/solr/start.jar ADDED
Binary file
Binary file
@@ -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
@@ -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,40 @@
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 = "qiny_sunspot_solr"
10
+ s.version = Sunspot::VERSION
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 = ["1544763557@qq.com"]
16
+ s.homepage = 'https://github.com/zhuoerri/sunspot/tree/master/sunspot_solr'
17
+ s.summary = 'Bundled Solr distribution for Sunspot with mmseg4j default setting'
18
+ s.license = 'MIT'
19
+ s.description = <<-TEXT
20
+ Sunspot::Solr provides a bundled Solr distribution for use with Sunspot.
21
+ Typical deployment environments will require more configuration, but this
22
+ distribution is well suited to development and testing.
23
+
24
+ I add a default mmseg4j setting
25
+ TEXT
26
+
27
+ s.rubyforge_project = "sunspot"
28
+
29
+ s.files = `git ls-files`.split("\n")
30
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
31
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
32
+ s.require_paths = ["lib"]
33
+
34
+ s.add_development_dependency 'rspec', '~> 1.1'
35
+ s.add_development_dependency 'hanna'
36
+
37
+ s.rdoc_options << '--webcvs=http://github.com/outoftime/sunspot/tree/master/%s' <<
38
+ '--title' << 'Sunspot-Solr - Bundled Solr distribution for Sunspot - API Documentation' <<
39
+ '--main' << 'README.rdoc'
40
+ end
metadata ADDED
@@ -0,0 +1,165 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: qiny_sunspot_solr
3
+ version: !ruby/object:Gem::Version
4
+ version: 2.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Mat Brown
8
+ - Peer Allan
9
+ - Dmitriy Dzema
10
+ - Benjamin Krause
11
+ - Marcel de Graaf
12
+ - Brandon Keepers
13
+ - Peter Berkenbosch
14
+ - Brian Atkinson
15
+ - Tom Coleman
16
+ - Matt Mitchell
17
+ - Nathan Beyer
18
+ - Kieran Topping
19
+ - Nicolas Braem
20
+ - Jeremy Ashkenas
21
+ - Dylan Vaughn
22
+ - Brian Durand
23
+ - Sam Granieri
24
+ - Nick Zadrozny
25
+ - Jason Ronallo
26
+ autorequire:
27
+ bindir: bin
28
+ cert_chain: []
29
+ date: 2019-03-27 00:00:00.000000000 Z
30
+ dependencies:
31
+ - !ruby/object:Gem::Dependency
32
+ name: rspec
33
+ requirement: !ruby/object:Gem::Requirement
34
+ requirements:
35
+ - - "~>"
36
+ - !ruby/object:Gem::Version
37
+ version: '1.1'
38
+ type: :development
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ requirements:
42
+ - - "~>"
43
+ - !ruby/object:Gem::Version
44
+ version: '1.1'
45
+ - !ruby/object:Gem::Dependency
46
+ name: hanna
47
+ requirement: !ruby/object:Gem::Requirement
48
+ requirements:
49
+ - - ">="
50
+ - !ruby/object:Gem::Version
51
+ version: '0'
52
+ type: :development
53
+ prerelease: false
54
+ version_requirements: !ruby/object:Gem::Requirement
55
+ requirements:
56
+ - - ">="
57
+ - !ruby/object:Gem::Version
58
+ version: '0'
59
+ description: |2
60
+ Sunspot::Solr provides a bundled Solr distribution for use with Sunspot.
61
+ Typical deployment environments will require more configuration, but this
62
+ distribution is well suited to development and testing.
63
+
64
+ I add a default mmseg4j setting
65
+ email:
66
+ - 1544763557@qq.com
67
+ executables:
68
+ - sunspot-installer
69
+ - sunspot-solr
70
+ extensions: []
71
+ extra_rdoc_files: []
72
+ files:
73
+ - Gemfile
74
+ - README.rdoc
75
+ - bin/sunspot-installer
76
+ - bin/sunspot-solr
77
+ - lib/sunspot/solr/installer.rb
78
+ - lib/sunspot/solr/installer/config_installer.rb
79
+ - lib/sunspot/solr/installer/task_helper.rb
80
+ - lib/sunspot/solr/java.rb
81
+ - lib/sunspot/solr/railtie.rb
82
+ - lib/sunspot/solr/server.rb
83
+ - lib/sunspot/solr/tasks.rb
84
+ - lib/sunspot_solr.rb
85
+ - solr/README.txt
86
+ - solr/contexts/solr.xml
87
+ - solr/etc/jetty.xml
88
+ - solr/etc/webdefault.xml
89
+ - solr/lib/ext/jcl-over-slf4j-1.6.6.jar
90
+ - solr/lib/ext/jul-to-slf4j-1.6.6.jar
91
+ - solr/lib/ext/log4j-1.2.16.jar
92
+ - solr/lib/ext/log4j.properties
93
+ - solr/lib/ext/slf4j-api-1.6.6.jar
94
+ - solr/lib/ext/slf4j-log4j12-1.6.6.jar
95
+ - solr/lib/jetty-continuation-8.1.8.v20121106.jar
96
+ - solr/lib/jetty-deploy-8.1.8.v20121106.jar
97
+ - solr/lib/jetty-http-8.1.8.v20121106.jar
98
+ - solr/lib/jetty-io-8.1.8.v20121106.jar
99
+ - solr/lib/jetty-jmx-8.1.8.v20121106.jar
100
+ - solr/lib/jetty-security-8.1.8.v20121106.jar
101
+ - solr/lib/jetty-server-8.1.8.v20121106.jar
102
+ - solr/lib/jetty-servlet-8.1.8.v20121106.jar
103
+ - solr/lib/jetty-util-8.1.8.v20121106.jar
104
+ - solr/lib/jetty-webapp-8.1.8.v20121106.jar
105
+ - solr/lib/jetty-xml-8.1.8.v20121106.jar
106
+ - solr/lib/jsp-2.1/ant-1.6.5.jar
107
+ - solr/lib/jsp-2.1/core-3.1.1.jar
108
+ - solr/lib/jsp-2.1/jsp-2.1.jar
109
+ - solr/lib/jsp-2.1/jsp-api-2.1.jar
110
+ - solr/lib/servlet-api-3.0.jar
111
+ - solr/solr/.gitignore
112
+ - solr/solr/conf/admin-extra.html
113
+ - solr/solr/conf/elevate.xml
114
+ - solr/solr/conf/mapping-ISOLatin1Accent.txt
115
+ - solr/solr/conf/protwords.txt
116
+ - solr/solr/conf/schema.xml
117
+ - solr/solr/conf/scripts.conf
118
+ - solr/solr/conf/solrconfig.xml
119
+ - solr/solr/conf/spellings.txt
120
+ - solr/solr/conf/stopwords.txt
121
+ - solr/solr/conf/synonyms.txt
122
+ - solr/solr/conf/xslt/example.xsl
123
+ - solr/solr/conf/xslt/example_atom.xsl
124
+ - solr/solr/conf/xslt/example_rss.xsl
125
+ - solr/solr/conf/xslt/luke.xsl
126
+ - solr/solr/default/README.txt
127
+ - solr/solr/dic/words.dic
128
+ - solr/solr/solr.xml
129
+ - solr/start.jar
130
+ - solr/webapps/solr.war
131
+ - spec/server_spec.rb
132
+ - spec/spec_helper.rb
133
+ - sunspot_solr.gemspec
134
+ homepage: https://github.com/zhuoerri/sunspot/tree/master/sunspot_solr
135
+ licenses:
136
+ - MIT
137
+ metadata: {}
138
+ post_install_message:
139
+ rdoc_options:
140
+ - "--webcvs=http://github.com/outoftime/sunspot/tree/master/%s"
141
+ - "--title"
142
+ - Sunspot-Solr - Bundled Solr distribution for Sunspot - API Documentation
143
+ - "--main"
144
+ - README.rdoc
145
+ require_paths:
146
+ - lib
147
+ required_ruby_version: !ruby/object:Gem::Requirement
148
+ requirements:
149
+ - - ">="
150
+ - !ruby/object:Gem::Version
151
+ version: '0'
152
+ required_rubygems_version: !ruby/object:Gem::Requirement
153
+ requirements:
154
+ - - ">="
155
+ - !ruby/object:Gem::Version
156
+ version: '0'
157
+ requirements: []
158
+ rubyforge_project: sunspot
159
+ rubygems_version: 2.7.7
160
+ signing_key:
161
+ specification_version: 4
162
+ summary: Bundled Solr distribution for Sunspot with mmseg4j default setting
163
+ test_files:
164
+ - spec/server_spec.rb
165
+ - spec/spec_helper.rb