rsolr 1.0.13 → 1.1.1.pre1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6e3ceb8a3a7f0e613a2ec1ea63e74f65c6a7f4f8
4
- data.tar.gz: 0043fbd129fb4ea74585184df9efb71543689eb7
3
+ metadata.gz: 93c229e0cee96690d0cf15464b218bab708d4140
4
+ data.tar.gz: c910de4e9d7c29222713d671f37997eadbf51e4a
5
5
  SHA512:
6
- metadata.gz: 91eed5ff5587efe17f84b90c1c5cc962a2a4fddda1824002d91a3d8a08ce0eca0123352a736f7f6ab0b119afc54c1705038f886f5e7fbaadbfc02c02f18bfddc
7
- data.tar.gz: 403a89708dc1ef43fdd2e7b9b776695f766986aae39c6b9a0ca16a6e4c0f3ce65eb2c60f5f815a0d748439d1cf0d107cc5ab81828cf3992b7153e73761afecb5
6
+ metadata.gz: 4f97b243fd8ce50b4b9ddcb401f511c3a7a10a59691774c39be08bdca527eab75741378b01410001bf403a6007030deb07161bfaa41f709c52d3d39dc422caf9
7
+ data.tar.gz: ecd3144115f9f3e2891d7a1c7e7b0c96cd789950d6e13cc3fa99e7d9cf15e464ffacc8abd0b1e7ce122779bc2e5667f2b9655b8817cb9ed6c472c9ab7916a9ec
data/.travis.yml CHANGED
@@ -1,10 +1,14 @@
1
+ addons:
2
+ apt:
3
+ packages:
4
+ - libgmp-dev
5
+ language: ruby
6
+ sudo: false
1
7
  rvm:
2
- - 2.2.0
3
- - 2.1.0
4
- - 2.0.0
5
- - 1.9.3
6
- - 1.8.7
7
- - jruby-19mode
8
+ - 2.3.0
9
+ - 2.2.4
10
+ - 2.1.8
11
+ - jruby-9.0.5.0
8
12
 
9
13
  notifications:
10
14
  irc: "irc.freenode.org#blacklight"
@@ -15,7 +19,3 @@ env:
15
19
  global:
16
20
  - JRUBY_OPTS="-J-Xms512m -J-Xmx1024m"
17
21
  - NOKOGIRI_USE_SYSTEM_LIBRARIES=true
18
-
19
- matrix:
20
- allow_failures:
21
- - rvm: 1.8.7
data/lib/rsolr/client.rb CHANGED
@@ -15,7 +15,7 @@ class RSolr::Client
15
15
  end
16
16
  end
17
17
 
18
- attr_reader :connection, :uri, :proxy, :options
18
+ attr_reader :connection, :uri, :proxy, :options, :update_path
19
19
 
20
20
  def initialize connection, options = {}
21
21
  @proxy = @uri = nil
@@ -30,6 +30,7 @@ class RSolr::Client
30
30
  @proxy = RSolr::Uri.create proxy_url if proxy_url
31
31
  end
32
32
  end
33
+ @update_path = options.fetch(:update_path, 'update')
33
34
  @options = options
34
35
  end
35
36
 
@@ -79,7 +80,7 @@ class RSolr::Client
79
80
  def update opts = {}
80
81
  opts[:headers] ||= {}
81
82
  opts[:headers]['Content-Type'] ||= 'text/xml'
82
- post 'update', opts
83
+ post opts.fetch(:path, update_path), opts
83
84
  end
84
85
 
85
86
  #
@@ -16,12 +16,12 @@ class RSolr::Connection
16
16
  charset = response.type_params["charset"]
17
17
  {:status => response.code.to_i, :headers => response.to_hash, :body => force_charset(response.body, charset)}
18
18
  rescue Errno::ECONNREFUSED => e
19
- raise(Errno::ECONNREFUSED.new(request_context.inspect))
19
+ raise RSolr::Error::ConnectionRefused, request_context.inspect
20
20
  # catch the undefined closed? exception -- this is a confirmed ruby bug
21
- rescue NoMethodError
22
- $!.message == "undefined method `closed?' for nil:NilClass" ?
23
- raise(Errno::ECONNREFUSED.new) :
24
- raise($!)
21
+ rescue NoMethodError => e
22
+ e.message == "undefined method `closed?' for nil:NilClass" ?
23
+ raise(RSolr::Error::ConnectionRefused, request_context.inspect) :
24
+ raise(e)
25
25
  end
26
26
  end
27
27
 
@@ -33,6 +33,10 @@ class RSolr::Connection
33
33
  http = if proxy
34
34
  proxy_user, proxy_pass = proxy.userinfo.split(/:/) if proxy.userinfo
35
35
  Net::HTTP.Proxy(proxy.host, proxy.port, proxy_user, proxy_pass).new uri.host, uri.port
36
+ elsif proxy == false
37
+ # If explicitly passing in false, make sure we set proxy_addr to nil
38
+ # to tell Net::HTTP to *not* use the environment proxy variables.
39
+ Net::HTTP.new uri.host, uri.port, nil
36
40
  else
37
41
  Net::HTTP.new uri.host, uri.port
38
42
  end
@@ -69,4 +73,4 @@ class RSolr::Connection
69
73
  body.force_encoding(charset)
70
74
  end
71
75
 
72
- end
76
+ end
data/lib/rsolr/error.rb CHANGED
@@ -1,9 +1,9 @@
1
1
  module RSolr::Error
2
-
2
+
3
3
  module SolrContext
4
-
4
+
5
5
  attr_accessor :request, :response
6
-
6
+
7
7
  def to_s
8
8
  m = "#{super.to_s}"
9
9
  if response
@@ -19,15 +19,18 @@ module RSolr::Error
19
19
  m << p
20
20
  m
21
21
  end
22
-
22
+
23
23
  protected
24
-
24
+
25
25
  def parse_solr_error_response body
26
26
  begin
27
- info = body.scan(/<pre>(.*)<\/pre>/mi)[0]
27
+ if body =~ /<pre>/
28
+ info = body.scan(/<pre>(.*)<\/pre>/mi)[0]
29
+ elsif body =~ /'msg'=>/
30
+ info = body.scan(/'msg'=>(.*)/)[0]
31
+ end
28
32
  info = info.join if info.respond_to? :join
29
-
30
- info ||= body # body may not contain <pre> elements
33
+ info ||= body # body might not contain <pre> or msg elements
31
34
 
32
35
  partial = info.to_s.split("\n")[0..10]
33
36
  partial.join("\n").gsub("&gt;", ">").gsub("&lt;", "<")
@@ -35,13 +38,17 @@ module RSolr::Error
35
38
  nil
36
39
  end
37
40
  end
38
-
41
+
42
+
43
+ end
44
+
45
+ class ConnectionRefused < ::Errno::ECONNREFUSED
39
46
  end
40
-
47
+
41
48
  class Http < RuntimeError
42
-
49
+
43
50
  include SolrContext
44
-
51
+
45
52
  # ripped right from ActionPack
46
53
  # Defines the standard HTTP status codes, by integer, with their
47
54
  # corresponding default message texts.
@@ -101,13 +108,13 @@ module RSolr::Error
101
108
  507 => "Insufficient Storage",
102
109
  510 => "Not Extended"
103
110
  }
104
-
111
+
105
112
  def initialize request, response
106
113
  @request, @response = request, response
107
114
  end
108
-
115
+
109
116
  end
110
-
117
+
111
118
  # Thrown if the :wt is :ruby
112
119
  # but the body wasn't succesfully parsed/evaluated
113
120
  class InvalidResponse < Http
@@ -123,7 +130,7 @@ module RSolr::Error
123
130
  # Thrown if the :wt is :ruby
124
131
  # but the body wasn't succesfully parsed/evaluated
125
132
  class InvalidRubyResponse < InvalidResponse
126
-
133
+
127
134
  end
128
-
135
+
129
136
  end
data/lib/rsolr/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module RSolr
2
- VERSION = "1.0.13"
2
+ VERSION = "1.1.1.pre1"
3
3
 
4
4
  def self.version
5
5
  VERSION
data/lib/rsolr/xml.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  begin; require 'nokogiri'; rescue LoadError; end
2
+ require 'time'
2
3
 
3
4
  module RSolr::Xml
4
5
 
@@ -15,11 +16,10 @@ module RSolr::Xml
15
16
  @fields = []
16
17
  doc_hash.each_pair do |field,values|
17
18
  # create a new field for each value (multi-valued)
18
- # put non-array values into an array
19
- values = [values] unless values.is_a?(Array)
20
- values.each do |v|
21
- next if v.to_s.empty?
22
- @fields << RSolr::Xml::Field.new({:name=>field}, v.to_s)
19
+ wrap(values).each do |v|
20
+ v = format_value(v)
21
+ next if v.empty?
22
+ @fields << RSolr::Xml::Field.new({:name=>field}, v)
23
23
  end
24
24
  end
25
25
  @attrs={}
@@ -47,9 +47,30 @@ module RSolr::Xml
47
47
  def add_field(name, value, options = {})
48
48
  @fields << RSolr::Xml::Field.new(options.merge({:name=>name}), value)
49
49
  end
50
-
50
+
51
+ private
52
+
53
+ def format_value(v)
54
+ if v.is_a?(Date) && !v.is_a?(DateTime)
55
+ Time.utc(v.year, v.mon, v.mday).iso8601
56
+ elsif v.respond_to?(:to_time) && v.to_time
57
+ v.to_time.getutc.iso8601
58
+ else
59
+ v.to_s
60
+ end
61
+ end
62
+
63
+ def wrap(object)
64
+ if object.nil?
65
+ []
66
+ elsif object.respond_to?(:to_ary)
67
+ object.to_ary || [object]
68
+ else
69
+ [object]
70
+ end
71
+ end
51
72
  end
52
-
73
+
53
74
  class Field
54
75
 
55
76
  # "attrs" is a hash for setting the "doc" xml attributes
@@ -189,7 +210,5 @@ module RSolr::Xml
189
210
  end
190
211
  end
191
212
  end
192
-
193
213
  end
194
-
195
214
  end
data/rsolr.gemspec CHANGED
@@ -29,10 +29,13 @@ Gem::Specification.new do |s|
29
29
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
30
30
  s.require_paths = ["lib"]
31
31
 
32
+ s.required_ruby_version = '>= 1.9.3'
33
+
32
34
  s.add_dependency 'builder', '>= 2.1.2'
33
35
  s.add_development_dependency 'activesupport'
34
36
  s.add_development_dependency 'nokogiri', '>= 1.4.0'
35
37
  s.add_development_dependency 'rake', '~> 10.0'
36
38
  s.add_development_dependency 'rdoc', '~> 4.0'
37
39
  s.add_development_dependency 'rspec', '~> 3.0'
40
+ s.add_development_dependency 'solr_wrapper'
38
41
  end
@@ -14,6 +14,16 @@ describe "RSolr::Client" do
14
14
  it "should accept whatevs and set it as the @connection" do
15
15
  expect(RSolr::Client.new(:whatevs).connection).to eq(:whatevs)
16
16
  end
17
+
18
+ it "should use :update_path from options" do
19
+ client = RSolr::Client.new(:whatevs, { update_path: 'update_test' })
20
+ expect(client.update_path).to eql('update_test')
21
+ end
22
+
23
+ it "should use 'update' for update_path by default" do
24
+ client = RSolr::Client.new(:whatevs)
25
+ expect(client.update_path).to eql('update')
26
+ end
17
27
  end
18
28
 
19
29
  context "send_and_receive" do
@@ -131,6 +141,18 @@ describe "RSolr::Client" do
131
141
  )
132
142
  client.update(:data => "<optimize/>")
133
143
  end
144
+
145
+ it "should use #update_path" do
146
+ expect(client).to receive(:post).with('update_test', any_args)
147
+ expect(client).to receive(:update_path).and_return('update_test')
148
+ client.update({})
149
+ end
150
+
151
+ it "should use path from opts" do
152
+ expect(client).to receive(:post).with('update_opts', any_args)
153
+ allow(client).to receive(:update_path).and_return('update_test')
154
+ client.update({path: 'update_opts'})
155
+ end
134
156
  end
135
157
 
136
158
  context "post based helper methods:" do
@@ -16,6 +16,20 @@ describe "RSolr::Connection" do
16
16
  end
17
17
  end
18
18
 
19
+ context "when the connection is refused" do
20
+ subject { RSolr::Connection.new }
21
+
22
+ it "raises a custom exception" do
23
+ http_stub = double("Net:HTTP")
24
+ http_stub.stub(:request){ raise(Errno::ECONNREFUSED.new) }
25
+
26
+ subject.stub(:setup_raw_request){ http_stub }
27
+ subject.stub(:http){ Net::HTTP.new("localhost", 80) }
28
+
29
+ lambda{ subject.execute(nil,{}) }.should raise_error(RSolr::Error::ConnectionRefused)
30
+ end
31
+ end
32
+
19
33
  context "read timeout configuration" do
20
34
  let(:client) { double.as_null_object }
21
35
 
@@ -5,52 +5,42 @@ describe "RSolr::Error" do
5
5
  rescue RSolr::Error::Http => exception
6
6
  exception
7
7
  end
8
+ let (:response_lines) { (1..15).to_a.map { |i| "line #{i}" } }
9
+ let(:request) { double :[] => "mocked" }
10
+ let(:response_body) { response_lines.join("\n") }
11
+ let(:response) {{
12
+ :body => response_body,
13
+ :status => 400
14
+ }}
15
+ subject { generate_error_with_backtrace(request, response).to_s }
8
16
 
9
17
  context "when the response body is wrapped in a <pre> element" do
10
- before do
11
- response_lines = (1..15).to_a.map { |i| "line #{i}" }
12
-
13
- @request = double :[] => "mocked"
14
- @response = {
15
- :body => "<pre>" + response_lines.join("\n") + "</pre>",
16
- :status => 400
17
- }
18
- end
18
+ let(:response_body) { "<pre>" + response_lines.join("\n") + "</pre>" }
19
19
 
20
20
  it "only shows the first eleven lines of the response" do
21
- error = generate_error_with_backtrace @request, @response
22
- expect(error.to_s).to match(/line 1\n.+line 11\n\n/m)
21
+ expect(subject).to match(/line 1\n.+line 11\n\n/m)
23
22
  end
24
23
 
25
- it "shows only one line when the response is one line long" do
26
- @response[:body] = "<pre>failed</pre>"
27
-
28
- error = generate_error_with_backtrace @request, @response
29
- expect(error.to_s).to match(/Error: failed/)
24
+ context "when the response is one line long" do
25
+ let(:response_body) { "<pre>failed</pre>" }
26
+ it { should match(/Error: failed/) }
30
27
  end
31
28
  end
32
29
 
33
30
  context "when the response body is not wrapped in a <pre> element" do
34
- before do
35
- response_lines = (1..15).to_a.map { |i| "line #{i}" }
36
-
37
- @request = double :[] => "mocked"
38
- @response = {
39
- :body => response_lines.join("\n"),
40
- :status => 400
41
- }
42
- end
43
31
 
44
32
  it "only shows the first eleven lines of the response" do
45
- error = generate_error_with_backtrace @request, @response
46
- expect(error.to_s).to match(/line 1\n.+line 11\n\n/m)
33
+ expect(subject).to match(/line 1\n.+line 11\n\n/m)
47
34
  end
48
35
 
49
- it "shows only one line when the response is one line long" do
50
- @response[:body] = "failed"
51
-
52
- error = generate_error_with_backtrace @request, @response
53
- expect(error.to_s).to match(/Error: failed/)
36
+ context "when the response is one line long" do
37
+ let(:response_body) { 'failed' }
38
+ it { should match(/Error: failed/) }
39
+ end
40
+ context "when the response body contains a msg key" do
41
+ let(:msg) { "'org.apache.solr.search.SyntaxError: Cannot parse \\':false\\': Encountered \" \":\" \": \"\" at line 1, column 0.'" }
42
+ let(:response_body) { (response_lines << "'error'=>{'msg'=> #{msg}").join("\n") }
43
+ it { should include msg }
54
44
  end
55
45
  end
56
46
  end
data/spec/api/xml_spec.rb CHANGED
@@ -102,6 +102,17 @@ describe "RSolr::Xml" do
102
102
  expect(result).to match(/<field name="name">matt2<\/field>/)
103
103
  end
104
104
 
105
+ it 'should allow for objects which can be casted to an array' do
106
+ name = double("name", to_ary: ['matt1', 'matt2'])
107
+ data = {
108
+ :id => 1,
109
+ :name => name
110
+ }
111
+ result = generator.add(data)
112
+ expect(result).to match(/<field name="name">matt1<\/field>/)
113
+ expect(result).to match(/<field name="name">matt2<\/field>/)
114
+ end
115
+
105
116
  it 'should create an add from a single Message::Document' do
106
117
  document = RSolr::Xml::Document.new
107
118
  document.add_field('id', 1)
@@ -152,5 +163,51 @@ describe "RSolr::Xml" do
152
163
 
153
164
  end
154
165
  end
155
-
166
+
167
+ context :formatting do
168
+ it 'should format date objects into ISO 8601' do
169
+ data = {
170
+ dt: Date.new(1992, 03, 15)
171
+ }
172
+ result = generator.add(data)
173
+ expect(result).to match(/<field name="dt">1992-03-15T00:00:00Z<\/field>/)
174
+ end
175
+
176
+ it 'should format time objects into ISO 8601' do
177
+ data = {
178
+ dt: Time.new(1992, 03, 15, 16, 23, 55, 3600)
179
+ }
180
+ result = generator.add(data)
181
+ expect(result).to match(/<field name="dt">1992-03-15T15:23:55Z<\/field>/)
182
+ end
183
+
184
+ it 'should format datetime objects into ISO 8601' do
185
+ data = {
186
+ dt: DateTime.new(1992, 03, 15, 16, 23, 55, '+1')
187
+ }
188
+ result = generator.add(data)
189
+ expect(result).to match(/<field name="dt">1992-03-15T15:23:55Z<\/field>/)
190
+ end
191
+
192
+ it 'passes through other values' do
193
+ data = {
194
+ whatever: 'some string'
195
+ }
196
+
197
+ result = generator.add(data)
198
+ expect(result).to match(/<field name="whatever">some string<\/field>/)
199
+ end
200
+
201
+ # rails monkey-patches String to add a #to_time casting..
202
+ context 'with rails monkey patching' do
203
+ it 'passes through string values' do
204
+ data = {
205
+ whatever: double(to_s: 'some string', to_time: nil)
206
+ }
207
+
208
+ result = generator.add(data)
209
+ expect(result).to match(/<field name="whatever">some string<\/field>/)
210
+ end
211
+ end
212
+ end
156
213
  end
@@ -0,0 +1 @@
1
+ {"initArgs":{},"managedList":[]}
@@ -0,0 +1,67 @@
1
+ <?xml version="1.0" ?>
2
+ <!--
3
+ Licensed to the Apache Software Foundation (ASF) under one or more
4
+ contributor license agreements. See the NOTICE file distributed with
5
+ this work for additional information regarding copyright ownership.
6
+ The ASF licenses this file to You under the Apache License, Version 2.0
7
+ (the "License"); you may not use this file except in compliance with
8
+ the License. You may obtain a copy of the License at
9
+
10
+ http://www.apache.org/licenses/LICENSE-2.0
11
+
12
+ Unless required by applicable law or agreed to in writing, software
13
+ distributed under the License is distributed on an "AS IS" BASIS,
14
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ See the License for the specific language governing permissions and
16
+ limitations under the License.
17
+ -->
18
+
19
+ <!-- Example exchange rates file for CurrencyField type named "currency" in example schema -->
20
+
21
+ <currencyConfig version="1.0">
22
+ <rates>
23
+ <!-- Updated from http://www.exchangerate.com/ at 2011-09-27 -->
24
+ <rate from="USD" to="ARS" rate="4.333871" comment="ARGENTINA Peso" />
25
+ <rate from="USD" to="AUD" rate="1.025768" comment="AUSTRALIA Dollar" />
26
+ <rate from="USD" to="EUR" rate="0.743676" comment="European Euro" />
27
+ <rate from="USD" to="BRL" rate="1.881093" comment="BRAZIL Real" />
28
+ <rate from="USD" to="CAD" rate="1.030815" comment="CANADA Dollar" />
29
+ <rate from="USD" to="CLP" rate="519.0996" comment="CHILE Peso" />
30
+ <rate from="USD" to="CNY" rate="6.387310" comment="CHINA Yuan" />
31
+ <rate from="USD" to="CZK" rate="18.47134" comment="CZECH REP. Koruna" />
32
+ <rate from="USD" to="DKK" rate="5.515436" comment="DENMARK Krone" />
33
+ <rate from="USD" to="HKD" rate="7.801922" comment="HONG KONG Dollar" />
34
+ <rate from="USD" to="HUF" rate="215.6169" comment="HUNGARY Forint" />
35
+ <rate from="USD" to="ISK" rate="118.1280" comment="ICELAND Krona" />
36
+ <rate from="USD" to="INR" rate="49.49088" comment="INDIA Rupee" />
37
+ <rate from="USD" to="XDR" rate="0.641358" comment="INTNL MON. FUND SDR" />
38
+ <rate from="USD" to="ILS" rate="3.709739" comment="ISRAEL Sheqel" />
39
+ <rate from="USD" to="JPY" rate="76.32419" comment="JAPAN Yen" />
40
+ <rate from="USD" to="KRW" rate="1169.173" comment="KOREA (SOUTH) Won" />
41
+ <rate from="USD" to="KWD" rate="0.275142" comment="KUWAIT Dinar" />
42
+ <rate from="USD" to="MXN" rate="13.85895" comment="MEXICO Peso" />
43
+ <rate from="USD" to="NZD" rate="1.285159" comment="NEW ZEALAND Dollar" />
44
+ <rate from="USD" to="NOK" rate="5.859035" comment="NORWAY Krone" />
45
+ <rate from="USD" to="PKR" rate="87.57007" comment="PAKISTAN Rupee" />
46
+ <rate from="USD" to="PEN" rate="2.730683" comment="PERU Sol" />
47
+ <rate from="USD" to="PHP" rate="43.62039" comment="PHILIPPINES Peso" />
48
+ <rate from="USD" to="PLN" rate="3.310139" comment="POLAND Zloty" />
49
+ <rate from="USD" to="RON" rate="3.100932" comment="ROMANIA Leu" />
50
+ <rate from="USD" to="RUB" rate="32.14663" comment="RUSSIA Ruble" />
51
+ <rate from="USD" to="SAR" rate="3.750465" comment="SAUDI ARABIA Riyal" />
52
+ <rate from="USD" to="SGD" rate="1.299352" comment="SINGAPORE Dollar" />
53
+ <rate from="USD" to="ZAR" rate="8.329761" comment="SOUTH AFRICA Rand" />
54
+ <rate from="USD" to="SEK" rate="6.883442" comment="SWEDEN Krona" />
55
+ <rate from="USD" to="CHF" rate="0.906035" comment="SWITZERLAND Franc" />
56
+ <rate from="USD" to="TWD" rate="30.40283" comment="TAIWAN Dollar" />
57
+ <rate from="USD" to="THB" rate="30.89487" comment="THAILAND Baht" />
58
+ <rate from="USD" to="AED" rate="3.672955" comment="U.A.E. Dirham" />
59
+ <rate from="USD" to="UAH" rate="7.988582" comment="UKRAINE Hryvnia" />
60
+ <rate from="USD" to="GBP" rate="0.647910" comment="UNITED KINGDOM Pound" />
61
+
62
+ <!-- Cross-rates for some common currencies -->
63
+ <rate from="EUR" to="GBP" rate="0.869914" />
64
+ <rate from="EUR" to="NOK" rate="7.800095" />
65
+ <rate from="GBP" to="NOK" rate="8.966508" />
66
+ </rates>
67
+ </currencyConfig>
@@ -0,0 +1,54 @@
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.
15
+
16
+ # a couple of test stopwords to test that the words are really being
17
+ # configured from this file:
18
+ stopworda
19
+ stopwordb
20
+
21
+ # Standard english stop words taken from Lucene's StopAnalyzer
22
+ a
23
+ an
24
+ and
25
+ are
26
+ as
27
+ at
28
+ be
29
+ but
30
+ by
31
+ for
32
+ if
33
+ in
34
+ into
35
+ is
36
+ it
37
+ no
38
+ not
39
+ of
40
+ on
41
+ or
42
+ such
43
+ that
44
+ the
45
+ their
46
+ then
47
+ there
48
+ these
49
+ they
50
+ this
51
+ to
52
+ was
53
+ will
54
+ with
@@ -0,0 +1,21 @@
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
+ # Use a protected word file to protect against the stemmer reducing two
15
+ # unrelated words to the same base word.
16
+
17
+ # Some non-words that normally won't be encountered,
18
+ # just to test that they won't be stemmed.
19
+ dontstems
20
+ zwhacky
21
+