elastic-rails 0.8.2 → 0.8.3

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: a12b5aa58fd03c89b2da12c996b19994bb3a3c1a
4
- data.tar.gz: d1e4d3dee93fd0d9fd92c700b4367b415225a142
3
+ metadata.gz: 3d08a8c17baf9f31d0743be7201f90512d2cc819
4
+ data.tar.gz: ecc0c436bf0cf61aa0fda9c3c549b3fc8d23bf3a
5
5
  SHA512:
6
- metadata.gz: cf802900bc06db2cf8c4457c2839580d255c61fbefe4a616e8323699708ee20231be44220eb5149996501b88d5d0675cbecfccae050f8293e68821a0c5258b60
7
- data.tar.gz: 3879b379633548e1d7d7d18b1500dd5e8e73feaf31858c892e056a1c38a03aaabcb150c37bba2534df28795f03044d2a987086040228c5f9890369ccb9f96607
6
+ metadata.gz: 4d0c518ded1dd7a965caacbe518ce4e698b66bf26ae2fc7f1d6809af324ef37dd830a83cf228ef302a5b8907866925f3bc48bae64b07d8f16ca324699bd75eda
7
+ data.tar.gz: d7c4e2702124b39de9aea445a2584fb2a3311056028f8e6d288888d8686e8494231b2d9810efc6d4b8da96efbaa3ff5c7ae7c4c29b7e06557c577f1d0710cb4b
@@ -10,11 +10,12 @@ module Elastic
10
10
  api_client: nil, # set by method
11
11
  logger: nil, # set by method
12
12
  time_zone: nil, # set by method
13
- disable_indexing: false
13
+ disable_indexing: false,
14
+ disable_index_name_caching: false
14
15
  }
15
16
 
16
17
  attr_accessor :host, :port, :api_client, :index, :page_size, :coord_similarity, :logger,
17
- :import_batch_size, :whiny_indices, :time_zone, :disable_indexing
18
+ :import_batch_size, :whiny_indices, :time_zone, :disable_indexing, :disable_index_name_caching
18
19
 
19
20
  def initialize
20
21
  assign_attributes DEFAULTS
@@ -171,7 +171,7 @@ module Elastic::Core
171
171
 
172
172
  def wait_for_index_to_stabilize
173
173
  return if @settling_time == 0
174
- Elastic.logger.info "Waiting #{@settling_time * 1.2}s for write indices to stabilize ..."
174
+ Elastic.logger.info "Waiting #{@settling_time * 1.2}s for write indices to catch up ..."
175
175
  sleep(@settling_time * 1.2)
176
176
  end
177
177
 
@@ -202,7 +202,7 @@ module Elastic::Core
202
202
  end
203
203
 
204
204
  def resolve_write_indices
205
- @write_indices = nil if write_indices_expired?
205
+ @write_indices = nil if Elastic.config.disable_index_name_caching || write_indices_expired?
206
206
  @write_indices ||= begin
207
207
  result = api.indices.get_alias(name: write_index_alias)
208
208
  @write_indices_expiration = @settling_time.from_now
@@ -4,6 +4,7 @@ RSpec.configure do |config|
4
4
  Elastic.drop
5
5
  Elastic.migrate
6
6
  Elastic.config.disable_indexing = false
7
+ Elastic.config.disable_index_caching = true
7
8
  else
8
9
  Elastic.config.disable_indexing = true
9
10
  end
@@ -1,3 +1,3 @@
1
1
  module Elastic
2
- VERSION = "0.8.2"
2
+ VERSION = "0.8.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: elastic-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.2
4
+ version: 0.8.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ignacio Baixas
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-09-01 00:00:00.000000000 Z
11
+ date: 2017-02-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: elasticsearch
@@ -349,4 +349,3 @@ signing_key:
349
349
  specification_version: 4
350
350
  summary: Elasticsearch integration for Ruby on Rails by Platanus
351
351
  test_files: []
352
- has_rdoc: