thinking-sphinx 3.4.0 → 3.4.1

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: b763d739981ac8436e92fa07b67bae1e01912014
4
- data.tar.gz: e11258a8602e0005be61a97da389365524bac728
3
+ metadata.gz: 379f1b6689210920466728100f1d13266c2c68d3
4
+ data.tar.gz: 9d19d54828f3c9e156622a29266e3ce2a9c8185a
5
5
  SHA512:
6
- metadata.gz: 7c66d2e95dc7af7b45f4291e5c28e88b400442087add27c2fe43a55e5f4384781adf0c34326ae5e80d22882821f136b8f100b85e5337c335f6612a0fa12b9f40
7
- data.tar.gz: 28909c68df0089f551a0fc2d5026b5259d7dfe4b1f8132ef0aea7fa191d9848a46f2d8e3ca08b8282eb1529bc670304aca2c850fde4a4fa561234369c6beb36d
6
+ metadata.gz: be5375d5429cd3793aabc675507e3ee0d48ff6c1f2a4b613f00af1327840f0e75e368e6000ace714261df9a749db7f3a5b49433536915c8b045ba2938709748a
7
+ data.tar.gz: 156748e9d300264e8fb18dd57628f334fe0728d3c202ed8aed82607a43f07a8de5d29929878e785362a3aa5e87e41c8d756ebf2ce0979843d0ebaa36d521c37b
data/HISTORY CHANGED
@@ -1,3 +1,7 @@
1
+ 2017-08-29: 3.4.1
2
+ * [CHANGE] Treat "Lost connection to MySQL server" as a connection error (Manuel Schnitzer).
3
+ * [FIX] Index normalisation will now work even when index model tables don't exist.
4
+
1
5
  2017-08-28: 3.4.0
2
6
  * [CHANGE] Delta callback logic now prioritises checking for high level settings rather than model changes.
3
7
  * [FIX] Index normalisation now occurs consistently, and removes unneccesary sphinx_internal_class_name fields from real-time indices.
@@ -1,11 +1,12 @@
1
1
  h1. Thinking Sphinx
2
2
 
3
- Thinking Sphinx is a library for connecting ActiveRecord to the Sphinx full-text search tool, and integrates closely with Rails (but also works with other Ruby web frameworks). The current release is v3.4.0.
3
+ Thinking Sphinx is a library for connecting ActiveRecord to the Sphinx full-text search tool, and integrates closely with Rails (but also works with other Ruby web frameworks). The current release is v3.4.1.
4
4
 
5
5
  h2. Upgrading
6
6
 
7
7
  Please refer to the release notes for any changes you need to make when upgrading:
8
8
 
9
+ * "v3.4.1":https://github.com/pat/thinking-sphinx/releases/tag/v3.4.1
9
10
  * "v3.4.0":https://github.com/pat/thinking-sphinx/releases/tag/v3.4.0
10
11
  * "v3.3.0":https://github.com/pat/thinking-sphinx/releases/tag/v3.3.0
11
12
  * "v3.2.0":https://github.com/pat/thinking-sphinx/releases/tag/v3.2.0
@@ -24,7 +25,7 @@ It's a gem, so install it like you would any other gem. You will also need to sp
24
25
 
25
26
  <pre><code>gem 'mysql2', '~> 0.3', :platform => :ruby
26
27
  gem 'jdbc-mysql', '= 5.1.35', :platform => :jruby
27
- gem 'thinking-sphinx', '~> 3.4.0'</code></pre>
28
+ gem 'thinking-sphinx', '~> 3.4.1'</code></pre>
28
29
 
29
30
  The MySQL gems mentioned are required for connecting to Sphinx, so please include it even when you're using PostgreSQL for your database. If you're using JRuby, there is "currently an issue with Sphinx and jdbc-mysql 5.1.36 or newer":http://sphinxsearch.com/forum/view.html?id=13939, so you'll need to stick to nothing more recent than 5.1.35.
30
31
 
@@ -20,7 +20,8 @@ download_and_compile_source () {
20
20
  }
21
21
 
22
22
  load_cache () {
23
- aws s3 cp s3://$bucket/bincaches/$name.tar.gz $file
23
+ mkdir ext
24
+ curl -o $file http://$bucket.s3.amazonaws.com/bincaches/$name.tar.gz
24
25
  tar -zxf $file
25
26
  }
26
27
 
@@ -29,7 +30,7 @@ push_cache () {
29
30
  aws s3 cp $file s3://$bucket/bincaches/$name.tar.gz --acl public-read
30
31
  }
31
32
 
32
- if aws s3api head-object --bucket $bucket --key bincaches/$name.tar.gz
33
+ if curl -i --head --fail http://$bucket.s3.amazonaws.com/bincaches/$name.tar.gz
33
34
  then
34
35
  load_cache
35
36
  else
@@ -28,6 +28,7 @@ class ThinkingSphinx::Configuration::MinimumFields
28
28
 
29
29
  def no_inheritance_columns?
30
30
  indices.select { |index|
31
+ index.model.table_exists? &&
31
32
  index.model.column_names.include?(index.model.inheritance_column)
32
33
  }.empty?
33
34
  end
@@ -9,7 +9,9 @@ class ThinkingSphinx::SphinxError < StandardError
9
9
  replacement = ThinkingSphinx::SyntaxError.new(error.message)
10
10
  when /query error/
11
11
  replacement = ThinkingSphinx::QueryError.new(error.message)
12
- when /Can't connect to MySQL server/, /Communications link failure/
12
+ when /Can't connect to MySQL server/,
13
+ /Communications link failure/,
14
+ /Lost connection to MySQL server/
13
15
  replacement = ThinkingSphinx::ConnectionError.new(
14
16
  "Error connecting to Sphinx via the MySQL protocol. #{error.message}"
15
17
  )
@@ -10,8 +10,10 @@ RSpec.describe ThinkingSphinx::Configuration::MinimumFields do
10
10
  let(:field_a2) { double :name => 'name' }
11
11
  let(:field_b1) { double :name => 'sphinx_internal_class_name' }
12
12
  let(:field_b2) { double :name => 'name' }
13
- let(:model_a) { double :inheritance_column => 'type' }
14
- let(:model_b) { double :inheritance_column => 'type' }
13
+ let(:model_a) { double :inheritance_column => 'type',
14
+ :table_exists? => true }
15
+ let(:model_b) { double :inheritance_column => 'type',
16
+ :table_exists? => true }
15
17
  let(:subject) { ThinkingSphinx::Configuration::MinimumFields.new indices }
16
18
 
17
19
  it 'removes the class name fields when no index models have type columns' do
@@ -24,6 +26,16 @@ RSpec.describe ThinkingSphinx::Configuration::MinimumFields do
24
26
  expect(index_b.fields).to eq([field_b2])
25
27
  end
26
28
 
29
+ it 'removes the class name fields when models have no tables' do
30
+ allow(model_a).to receive(:table_exists?).and_return(false)
31
+ allow(model_b).to receive(:table_exists?).and_return(false)
32
+
33
+ subject.reconcile
34
+
35
+ expect(index_a.sources.first.fields).to eq([field_a2])
36
+ expect(index_b.fields).to eq([field_b2])
37
+ end
38
+
27
39
  it 'keeps the class name fields when one index model has a type column' do
28
40
  allow(model_a).to receive(:column_names).and_return(['id', 'name', 'type'])
29
41
  allow(model_b).to receive(:column_names).and_return(['id', 'name'])
@@ -35,7 +35,14 @@ describe ThinkingSphinx::SphinxError do
35
35
 
36
36
  it "translates connection errors" do
37
37
  allow(error).to receive_messages :message => "Can't connect to MySQL server on '127.0.0.1' (61)"
38
+ expect(ThinkingSphinx::SphinxError.new_from_mysql(error)).
39
+ to be_a(ThinkingSphinx::ConnectionError)
40
+
41
+ allow(error).to receive_messages :message => "Communications link failure"
42
+ expect(ThinkingSphinx::SphinxError.new_from_mysql(error)).
43
+ to be_a(ThinkingSphinx::ConnectionError)
38
44
 
45
+ allow(error).to receive_messages :message => "Lost connection to MySQL server"
39
46
  expect(ThinkingSphinx::SphinxError.new_from_mysql(error)).
40
47
  to be_a(ThinkingSphinx::ConnectionError)
41
48
  end
@@ -3,7 +3,7 @@ $:.push File.expand_path('../lib', __FILE__)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = 'thinking-sphinx'
6
- s.version = '3.4.0'
6
+ s.version = '3.4.1'
7
7
  s.platform = Gem::Platform::RUBY
8
8
  s.authors = ["Pat Allan"]
9
9
  s.email = ["pat@freelancing-gods.com"]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: thinking-sphinx
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.4.0
4
+ version: 3.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pat Allan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-08-28 00:00:00.000000000 Z
11
+ date: 2017-08-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord