es-elasticity 0.3.7 → 0.3.8

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: 72fe553f4fcf606f9a2582cc1563a78905b03c84
4
- data.tar.gz: 010cfafae1a421bd9dabf6449a7a6108b3938ac0
3
+ metadata.gz: d2d89f25600a3ab77988c2d38f35096a69b888b9
4
+ data.tar.gz: e2af05a59820f1b59a39ead2909254ebf7592f13
5
5
  SHA512:
6
- metadata.gz: 068104bc862fb6a45c2ebbb1eab66b11429ff6a995353ed5c3f889de3ebc6359d77c83adf3e4fb09a3ef2e175e6421ec0e061b1b73e60ad7c7bbec2e3a1a3a78
7
- data.tar.gz: 27454507647e48494a1d02566fcefea35ee63e1662fab5307dcf0c019aa88d12b3f47c4b0c56cadfcc20d8fb27a54242f7c5ad09f48a13da5b89d0bae9ea88f0
6
+ metadata.gz: 87a385b5dcbb63c72e820c37d8f606db5b2183bbca693461153999e5330d910e62cbfa3dcb722b290484d931859da4cebfb703ca426c0f5d8452ee0ffd3066ff
7
+ data.tar.gz: 077bc0215ff326b4a684dab6a3b556722128fe915b9999089f4842d57e656c64d90b5f5aee534123f86484cce4c115dfe8ac6e9614c9e911b2cc4005d930390a
@@ -40,13 +40,15 @@ module Elasticity
40
40
  # Performs the search using the default search type and returning an iterator that will yield
41
41
  # hash representations of the documents.
42
42
  def document_hashes
43
- LazySearch.new(@client, @search_definition)
43
+ return @document_hashes if defined?(@document_hashes)
44
+ @document_hashes = LazySearch.new(@client, @search_definition)
44
45
  end
45
46
 
46
47
  # Performs the search using the default search type and returning an iterator that will yield
47
48
  # each document, converted to the provided document_klass.
48
49
  def documents(document_klass)
49
- LazySearch.new(@client, @search_definition) do |hit|
50
+ return @documents if defined?(@documents)
51
+ @documents = LazySearch.new(@client, @search_definition) do |hit|
50
52
  document_klass.from_hit(hit)
51
53
  end
52
54
  end
@@ -56,7 +58,8 @@ module Elasticity
56
58
  #
57
59
  # More info: http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/scan-scroll.html
58
60
  def scan_documents(document_klass, **options)
59
- ScanCursor.new(@client, @search_definition, document_klass, **options)
61
+ return @scan_documents if defined?(@scan_documents)
62
+ @scan_documents = ScanCursor.new(@client, @search_definition, document_klass, **options)
60
63
  end
61
64
 
62
65
  # Performs the search only fetching document ids using it to load ActiveRecord objects from the provided
@@ -1,3 +1,3 @@
1
1
  module Elasticity
2
- VERSION = "0.3.7"
2
+ VERSION = "0.3.8"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: es-elasticity
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.7
4
+ version: 0.3.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rodrigo Kochenburger
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-06 00:00:00.000000000 Z
11
+ date: 2015-08-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler