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 +4 -4
- data/lib/elasticity/search.rb +6 -3
- data/lib/elasticity/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d2d89f25600a3ab77988c2d38f35096a69b888b9
|
4
|
+
data.tar.gz: e2af05a59820f1b59a39ead2909254ebf7592f13
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 87a385b5dcbb63c72e820c37d8f606db5b2183bbca693461153999e5330d910e62cbfa3dcb722b290484d931859da4cebfb703ca426c0f5d8452ee0ffd3066ff
|
7
|
+
data.tar.gz: 077bc0215ff326b4a684dab6a3b556722128fe915b9999089f4842d57e656c64d90b5f5aee534123f86484cce4c115dfe8ac6e9614c9e911b2cc4005d930390a
|
data/lib/elasticity/search.rb
CHANGED
@@ -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
|
-
|
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
|
-
|
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
|
-
|
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
|
data/lib/elasticity/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2015-08-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|