rsolr 1.0.8 → 1.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.
- checksums.yaml +7 -0
- data/.travis.yml +21 -0
- data/CHANGES.txt +20 -1
- data/Gemfile +3 -9
- data/README.rdoc +34 -31
- data/Rakefile +1 -10
- data/lib/rsolr.rb +14 -10
- data/lib/rsolr/char.rb +4 -1
- data/lib/rsolr/client.rb +133 -54
- data/lib/rsolr/connection.rb +21 -17
- data/lib/rsolr/error.rb +39 -20
- data/lib/rsolr/response.rb +57 -13
- data/lib/rsolr/uri.rb +44 -27
- data/lib/rsolr/version.rb +7 -0
- data/lib/rsolr/xml.rb +69 -15
- data/rsolr.gemspec +14 -7
- data/spec/api/char_spec.rb +8 -3
- data/spec/api/client_spec.rb +221 -87
- data/spec/api/connection_spec.rb +93 -29
- data/spec/api/error_spec.rb +22 -32
- data/spec/api/pagination_spec.rb +12 -5
- data/spec/api/rsolr_spec.rb +28 -8
- data/spec/api/uri_spec.rb +108 -50
- data/spec/api/xml_spec.rb +196 -96
- data/spec/fixtures/basic_configs/_rest_managed.json +1 -0
- data/spec/fixtures/basic_configs/currency.xml +67 -0
- data/spec/fixtures/basic_configs/lang/stopwords_en.txt +54 -0
- data/spec/fixtures/basic_configs/protwords.txt +21 -0
- data/spec/fixtures/basic_configs/schema.xml +530 -0
- data/spec/fixtures/basic_configs/solrconfig.xml +572 -0
- data/spec/fixtures/basic_configs/stopwords.txt +14 -0
- data/spec/fixtures/basic_configs/synonyms.txt +29 -0
- data/spec/integration/solr5_spec.rb +26 -0
- data/spec/spec_helper.rb +8 -1
- data/tasks/spec.rake +1 -38
- metadata +98 -34
- data/tasks/rcov.rake +0 -25
@@ -0,0 +1,14 @@
|
|
1
|
+
# Licensed to the Apache Software Foundation (ASF) under one or more
|
2
|
+
# contributor license agreements. See the NOTICE file distributed with
|
3
|
+
# this work for additional information regarding copyright ownership.
|
4
|
+
# The ASF licenses this file to You under the Apache License, Version 2.0
|
5
|
+
# (the "License"); you may not use this file except in compliance with
|
6
|
+
# the License. You may obtain a copy of the License at
|
7
|
+
#
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
#
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
# See the License for the specific language governing permissions and
|
14
|
+
# limitations under the License.
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# The ASF licenses this file to You under the Apache License, Version 2.0
|
2
|
+
# (the "License"); you may not use this file except in compliance with
|
3
|
+
# the License. You may obtain a copy of the License at
|
4
|
+
#
|
5
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
6
|
+
#
|
7
|
+
# Unless required by applicable law or agreed to in writing, software
|
8
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
9
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
10
|
+
# See the License for the specific language governing permissions and
|
11
|
+
# limitations under the License.
|
12
|
+
|
13
|
+
#-----------------------------------------------------------------------
|
14
|
+
#some test synonym mappings unlikely to appear in real input text
|
15
|
+
aaafoo => aaabar
|
16
|
+
bbbfoo => bbbfoo bbbbar
|
17
|
+
cccfoo => cccbar cccbaz
|
18
|
+
fooaaa,baraaa,bazaaa
|
19
|
+
|
20
|
+
# Some synonym groups specific to this example
|
21
|
+
GB,gib,gigabyte,gigabytes
|
22
|
+
MB,mib,megabyte,megabytes
|
23
|
+
Television, Televisions, TV, TVs
|
24
|
+
#notice we use "gib" instead of "GiB" so any WordDelimiterFilter coming
|
25
|
+
#after us won't split it into two words.
|
26
|
+
|
27
|
+
# Synonym mappings can be used for spelling correction too
|
28
|
+
pixima => pixma
|
29
|
+
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'solr_wrapper'
|
3
|
+
|
4
|
+
describe "Solr basic_configs" do
|
5
|
+
SOLR_INSTANCE = SolrWrapper.default_instance({})
|
6
|
+
before(:all) { SOLR_INSTANCE.start }
|
7
|
+
after(:all) { SOLR_INSTANCE.stop }
|
8
|
+
|
9
|
+
context "basic configs" do
|
10
|
+
subject { RSolr.connect url: "http://localhost:#{SOLR_INSTANCE.port}/solr/basic_configs/"}
|
11
|
+
around(:each) do |example|
|
12
|
+
SOLR_INSTANCE.with_collection(name: "basic_configs", dir: File.join(FIXTURES_DIR, "basic_configs")) do |coll|
|
13
|
+
example.run
|
14
|
+
end
|
15
|
+
end
|
16
|
+
describe "HEAD admin/ping" do
|
17
|
+
it "should not raise an exception" do
|
18
|
+
expect { subject.head('admin/ping') }.not_to raise_error
|
19
|
+
end
|
20
|
+
|
21
|
+
it "should not have a body" do
|
22
|
+
expect(subject.head('admin/ping')).to be_kind_of RSolr::HashWithResponse
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
data/spec/spec_helper.rb
CHANGED
data/tasks/spec.rake
CHANGED
@@ -1,39 +1,2 @@
|
|
1
|
-
require "rubygems"
|
2
|
-
require 'rspec'
|
3
1
|
require 'rspec/core/rake_task'
|
4
|
-
|
5
|
-
namespace :spec do
|
6
|
-
|
7
|
-
namespace :ruby do
|
8
|
-
desc 'run api specs through the Ruby implementations'
|
9
|
-
task :api do
|
10
|
-
puts "Ruby 1.8.7"
|
11
|
-
puts `rake spec:api`
|
12
|
-
puts "Ruby 1.9"
|
13
|
-
puts `rake1.9 spec:api`
|
14
|
-
puts "JRuby"
|
15
|
-
puts `jruby -S rake spec:api`
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
desc 'run api specs (mock out Solr dependency)'
|
20
|
-
RSpec::Core::RakeTask.new(:api) do |t|
|
21
|
-
|
22
|
-
t.pattern = [File.join('spec', 'spec_helper.rb')]
|
23
|
-
t.pattern += FileList[File.join('spec', 'api', '**', '*_spec.rb')]
|
24
|
-
|
25
|
-
t.verbose = true
|
26
|
-
t.rspec_opts = ['--color']
|
27
|
-
end
|
28
|
-
|
29
|
-
desc 'run integration specs'
|
30
|
-
RSpec::Core::RakeTask.new(:integration) do |t|
|
31
|
-
|
32
|
-
t.pattern = [File.join('spec', 'spec_helper.rb')]
|
33
|
-
t.pattern += FileList[File.join('spec', 'integration', '**', '*_spec.rb')]
|
34
|
-
|
35
|
-
t.verbose = true
|
36
|
-
t.rspec_opts = ['--color']
|
37
|
-
end
|
38
|
-
|
39
|
-
end
|
2
|
+
RSpec::Core::RakeTask.new(:spec)
|
metadata
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rsolr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
5
|
-
prerelease:
|
4
|
+
version: 1.1.2
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Antoine Latter
|
@@ -25,56 +24,111 @@ authors:
|
|
25
24
|
- Fouad Mardini
|
26
25
|
- Jeremy Hinegardner
|
27
26
|
- Nathan Witmer
|
28
|
-
-
|
27
|
+
- Naomi Dushay
|
28
|
+
- '"shima"'
|
29
29
|
autorequire:
|
30
30
|
bindir: bin
|
31
31
|
cert_chain: []
|
32
|
-
date:
|
32
|
+
date: 2016-08-19 00:00:00.000000000 Z
|
33
33
|
dependencies:
|
34
34
|
- !ruby/object:Gem::Dependency
|
35
35
|
name: builder
|
36
|
-
requirement:
|
37
|
-
none: false
|
36
|
+
requirement: !ruby/object:Gem::Requirement
|
38
37
|
requirements:
|
39
|
-
- -
|
38
|
+
- - ">="
|
40
39
|
- !ruby/object:Gem::Version
|
41
40
|
version: 2.1.2
|
42
41
|
type: :runtime
|
43
42
|
prerelease: false
|
44
|
-
version_requirements:
|
43
|
+
version_requirements: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 2.1.2
|
48
|
+
- !ruby/object:Gem::Dependency
|
49
|
+
name: activesupport
|
50
|
+
requirement: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
type: :development
|
56
|
+
prerelease: false
|
57
|
+
version_requirements: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: nokogiri
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 1.4.0
|
69
|
+
type: :development
|
70
|
+
prerelease: false
|
71
|
+
version_requirements: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 1.4.0
|
45
76
|
- !ruby/object:Gem::Dependency
|
46
77
|
name: rake
|
47
|
-
requirement:
|
48
|
-
none: false
|
78
|
+
requirement: !ruby/object:Gem::Requirement
|
49
79
|
requirements:
|
50
|
-
- - ~>
|
80
|
+
- - "~>"
|
51
81
|
- !ruby/object:Gem::Version
|
52
|
-
version: 0
|
82
|
+
version: '10.0'
|
53
83
|
type: :development
|
54
84
|
prerelease: false
|
55
|
-
version_requirements:
|
85
|
+
version_requirements: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '10.0'
|
56
90
|
- !ruby/object:Gem::Dependency
|
57
91
|
name: rdoc
|
58
|
-
requirement:
|
59
|
-
none: false
|
92
|
+
requirement: !ruby/object:Gem::Requirement
|
60
93
|
requirements:
|
61
|
-
- - ~>
|
94
|
+
- - "~>"
|
62
95
|
- !ruby/object:Gem::Version
|
63
|
-
version:
|
96
|
+
version: '4.0'
|
64
97
|
type: :development
|
65
98
|
prerelease: false
|
66
|
-
version_requirements:
|
99
|
+
version_requirements: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '4.0'
|
67
104
|
- !ruby/object:Gem::Dependency
|
68
105
|
name: rspec
|
69
|
-
requirement:
|
70
|
-
none: false
|
106
|
+
requirement: !ruby/object:Gem::Requirement
|
71
107
|
requirements:
|
72
|
-
- - ~>
|
108
|
+
- - "~>"
|
73
109
|
- !ruby/object:Gem::Version
|
74
|
-
version:
|
110
|
+
version: '3.0'
|
75
111
|
type: :development
|
76
112
|
prerelease: false
|
77
|
-
version_requirements:
|
113
|
+
version_requirements: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - "~>"
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '3.0'
|
118
|
+
- !ruby/object:Gem::Dependency
|
119
|
+
name: solr_wrapper
|
120
|
+
requirement: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
type: :development
|
126
|
+
prerelease: false
|
127
|
+
version_requirements: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - ">="
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '0'
|
78
132
|
description: RSolr aims to provide a simple and extensible library for working with
|
79
133
|
Solr
|
80
134
|
email:
|
@@ -83,7 +137,8 @@ executables: []
|
|
83
137
|
extensions: []
|
84
138
|
extra_rdoc_files: []
|
85
139
|
files:
|
86
|
-
- .gitignore
|
140
|
+
- ".gitignore"
|
141
|
+
- ".travis.yml"
|
87
142
|
- CHANGES.txt
|
88
143
|
- Gemfile
|
89
144
|
- LICENSE
|
@@ -96,6 +151,7 @@ files:
|
|
96
151
|
- lib/rsolr/error.rb
|
97
152
|
- lib/rsolr/response.rb
|
98
153
|
- lib/rsolr/uri.rb
|
154
|
+
- lib/rsolr/version.rb
|
99
155
|
- lib/rsolr/xml.rb
|
100
156
|
- rsolr.gemspec
|
101
157
|
- spec/api/char_spec.rb
|
@@ -106,33 +162,41 @@ files:
|
|
106
162
|
- spec/api/rsolr_spec.rb
|
107
163
|
- spec/api/uri_spec.rb
|
108
164
|
- spec/api/xml_spec.rb
|
165
|
+
- spec/fixtures/basic_configs/_rest_managed.json
|
166
|
+
- spec/fixtures/basic_configs/currency.xml
|
167
|
+
- spec/fixtures/basic_configs/lang/stopwords_en.txt
|
168
|
+
- spec/fixtures/basic_configs/protwords.txt
|
169
|
+
- spec/fixtures/basic_configs/schema.xml
|
170
|
+
- spec/fixtures/basic_configs/solrconfig.xml
|
171
|
+
- spec/fixtures/basic_configs/stopwords.txt
|
172
|
+
- spec/fixtures/basic_configs/synonyms.txt
|
173
|
+
- spec/integration/solr5_spec.rb
|
109
174
|
- spec/spec_helper.rb
|
110
|
-
- tasks/rcov.rake
|
111
175
|
- tasks/rdoc.rake
|
112
176
|
- tasks/rsolr.rake
|
113
177
|
- tasks/spec.rake
|
114
|
-
homepage: https://github.com/
|
115
|
-
licenses:
|
178
|
+
homepage: https://github.com/rsolr/rsolr
|
179
|
+
licenses:
|
180
|
+
- Apache-2.0
|
181
|
+
metadata: {}
|
116
182
|
post_install_message:
|
117
183
|
rdoc_options: []
|
118
184
|
require_paths:
|
119
185
|
- lib
|
120
186
|
required_ruby_version: !ruby/object:Gem::Requirement
|
121
|
-
none: false
|
122
187
|
requirements:
|
123
|
-
- -
|
188
|
+
- - ">="
|
124
189
|
- !ruby/object:Gem::Version
|
125
|
-
version:
|
190
|
+
version: 1.9.3
|
126
191
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
127
|
-
none: false
|
128
192
|
requirements:
|
129
|
-
- -
|
193
|
+
- - ">="
|
130
194
|
- !ruby/object:Gem::Version
|
131
195
|
version: '0'
|
132
196
|
requirements: []
|
133
197
|
rubyforge_project: rsolr
|
134
|
-
rubygems_version:
|
198
|
+
rubygems_version: 2.5.1
|
135
199
|
signing_key:
|
136
|
-
specification_version:
|
200
|
+
specification_version: 4
|
137
201
|
summary: A Ruby client for Apache Solr
|
138
202
|
test_files: []
|
data/tasks/rcov.rake
DELETED
@@ -1,25 +0,0 @@
|
|
1
|
-
# require 'rake'
|
2
|
-
# require 'spec/rake/spectask'
|
3
|
-
#
|
4
|
-
# desc 'run specs with rcov'
|
5
|
-
# Spec::Rake::SpecTask.new('rcov') do |t|
|
6
|
-
# t.spec_files = FileList['spec/**/*_spec.rb']
|
7
|
-
# t.rcov = true
|
8
|
-
# t.rcov_dir = File.join('coverage', 'all')
|
9
|
-
# # --only-uncovered
|
10
|
-
# t.rcov_opts.concat(['--exclude', 'spec', '--sort', 'coverage'])
|
11
|
-
# end
|
12
|
-
#
|
13
|
-
# namespace :rcov do
|
14
|
-
# desc 'run api specs with rcov'
|
15
|
-
# Spec::Rake::SpecTask.new('api') do |t|
|
16
|
-
# rm_f "coverage"
|
17
|
-
# rm_f "coverage.data"
|
18
|
-
# t.spec_files = FileList['spec/spec_helper.rb', 'spec/api/**/*_spec.rb']
|
19
|
-
# t.rcov = true
|
20
|
-
# t.rcov_dir = File.join('coverage', 'api')
|
21
|
-
# # --only-uncovered
|
22
|
-
# t.rcov_opts.concat(['--exclude', 'spec', '--sort', 'coverage'])
|
23
|
-
# end
|
24
|
-
#
|
25
|
-
# end
|