algoliasearch-rails 1.23.1 → 1.23.2

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
  SHA256:
3
- metadata.gz: b2d0b61f81920d6dd4f89bd20e60380431722ffe60fca9348b35e3ad45da44f6
4
- data.tar.gz: 67c1d34f733cefa7b8c2d48408c8b0bd0eea42cc541b0bdc430673d3a204c3fd
3
+ metadata.gz: 7ac9c6a0bf5ab646bcde8da6a321cab385e1875e258e5a2f2e50120ae7fbd9f0
4
+ data.tar.gz: 1aef47abb42a2e5cf0fa5201560523c73a44488c763b38b6ad3ad82e55337340
5
5
  SHA512:
6
- metadata.gz: db0be244c2850303c29f7b0ec3d08d724400239c8e0ba60d13118b6cd808f6399b84f4eb1aba5293af96fe29db08814b4ac4f785d32ec503d184343217091b78
7
- data.tar.gz: 812a0517895c42df1917b0bb6677372b65dd69c9264ca29e6c7bba0a5e5d1150ec6602b2aa5ad185d1367cb97741af4db1176535496240971077e4b403a467af
6
+ metadata.gz: 0e4a6e309538e45b67b32b53f041b217cb249fd7dce3a61158b4d256a7d984a1d6b8bdddee38bc5665ff3721c1fdc62042037b385b2a86d0773e84c921abc0ed
7
+ data.tar.gz: 2dfd9c286a3a12b2a9ca37f0d29669abb5a6454a3368f0c8a0265fed5155c6f3af8f727ec5552ea334b955c78f6dc16918c99ba7db7d54adbe66cd1c84f47db1
data/ChangeLog CHANGED
@@ -1,5 +1,12 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## [1.23.2](https://github.com/algolia/algoliasearch-rails/releases/tag/1.23.2) (2019-06-26)
4
+
5
+ **Fixed**
6
+
7
+ * Use `copy_index` when initiating a temporary index to preserve settings, synonyms, and rules.
8
+
9
+
3
10
  ## [1.23.0](https://github.com/algolia/algoliasearch-rails/releases/tag/1.23.0) (2019-06-25)
4
11
 
5
12
  **Added**
data/Gemfile CHANGED
@@ -1,7 +1,7 @@
1
1
  source "http://rubygems.org"
2
2
 
3
3
  gem 'json', '~> 1.8', '>= 1.8.6'
4
- gem 'algoliasearch', '>= 1.23.0', '< 2.0.0'
4
+ gem 'algoliasearch', '>= 1.26.0', '< 2.0.0'
5
5
 
6
6
  if defined?(RUBY_ENGINE) && RUBY_ENGINE == 'rbx'
7
7
  gem 'rubysl', '~> 2.0', :platform => :rbx
@@ -79,7 +79,7 @@ Gem::Specification.new do |s|
79
79
 
80
80
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
81
81
  s.add_runtime_dependency(%q<json>, [">= 1.5.1"])
82
- s.add_runtime_dependency(%q<algoliasearch>, [">= 1.23.0", "< 2.0.0"])
82
+ s.add_runtime_dependency(%q<algoliasearch>, [">= 1.26.0", "< 2.0.0"])
83
83
  s.add_development_dependency(%q<will_paginate>, [">= 2.3.15"])
84
84
  s.add_development_dependency(%q<kaminari>, [">= 0"])
85
85
  s.add_development_dependency "travis"
@@ -87,11 +87,11 @@ Gem::Specification.new do |s|
87
87
  s.add_development_dependency "rdoc"
88
88
  else
89
89
  s.add_dependency(%q<json>, [">= 1.5.1"])
90
- s.add_dependency(%q<algoliasearch>, [">= 1.23.0", "< 2.0.0"])
90
+ s.add_dependency(%q<algoliasearch>, [">= 1.26.0", "< 2.0.0"])
91
91
  end
92
92
  else
93
93
  s.add_dependency(%q<json>, [">= 1.5.1"])
94
- s.add_dependency(%q<algoliasearch>, [">= 1.23.0", "< 2.0.0"])
94
+ s.add_dependency(%q<algoliasearch>, [">= 1.26.0", "< 2.0.0"])
95
95
  end
96
96
  end
97
97
 
@@ -555,14 +555,21 @@ module AlgoliaSearch
555
555
  master_settings.delete 'replicas'
556
556
 
557
557
  # init temporary index
558
- index_name = algolia_index_name(options)
559
- tmp_options = options.merge({ :index_name => "#{index_name}.tmp" })
558
+ src_index_name = algolia_index_name(options)
559
+ tmp_index_name = "#{src_index_name}.tmp"
560
+ tmp_options = options.merge({ :index_name => tmp_index_name })
560
561
  tmp_options.delete(:per_environment) # already included in the temporary index_name
561
562
  tmp_settings = settings.dup
562
- tmp_index = algolia_ensure_init(tmp_options, tmp_settings, master_settings)
563
563
 
564
- algolia_find_in_batches(batch_size) do |group|
565
- if algolia_conditional_index?(tmp_options)
564
+ if options[:check_settings] == false
565
+ ::Algolia::copy_index!(src_index_name, tmp_index_name, %w(settings synonyms rules))
566
+ tmp_index = SafeIndex.new(tmp_index_name, !!options[:raise_on_failure])
567
+ else
568
+ tmp_index = algolia_ensure_init(tmp_options, tmp_settings, master_settings)
569
+ end
570
+
571
+ algolia_find_in_batches(batch_size) do |group|
572
+ if algolia_conditional_index?(options)
566
573
  # select only indexable objects
567
574
  group = group.select { |o| algolia_indexable?(o, tmp_options) }
568
575
  end
@@ -570,7 +577,7 @@ module AlgoliaSearch
570
577
  tmp_index.save_objects(objects)
571
578
  end
572
579
 
573
- move_task = SafeIndex.move_index(tmp_index.name, index_name)
580
+ move_task = SafeIndex.move_index(tmp_index.name, src_index_name)
574
581
  master_index.wait_task(move_task["taskID"]) if synchronous || options[:synchronous]
575
582
  end
576
583
  nil
@@ -1,3 +1,3 @@
1
1
  module AlgoliaSearch
2
- VERSION = '1.23.1'
2
+ VERSION = '1.23.2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: algoliasearch-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.23.1
4
+ version: 1.23.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Algolia
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-06-25 00:00:00.000000000 Z
11
+ date: 2019-06-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -30,7 +30,7 @@ dependencies:
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 1.23.0
33
+ version: 1.26.0
34
34
  - - "<"
35
35
  - !ruby/object:Gem::Version
36
36
  version: 2.0.0
@@ -40,7 +40,7 @@ dependencies:
40
40
  requirements:
41
41
  - - ">="
42
42
  - !ruby/object:Gem::Version
43
- version: 1.23.0
43
+ version: 1.26.0
44
44
  - - "<"
45
45
  - !ruby/object:Gem::Version
46
46
  version: 2.0.0