trample_search 0.15.0 → 0.16.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/lib/trample/metadata.rb +4 -0
- data/lib/trample/search.rb +17 -0
- data/lib/trample/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: 20ffd69885c3eeda15f53ab9d4b6dd4bbc27f7be
|
4
|
+
data.tar.gz: 71f0bc852acc52e6cd9e3f71edc74336e26b0c85
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 54309a47baec66899dc8e2481e37d3c4406394f8e8b86de457e084c468a352ce351b7988f0509daa6a46feab57f11d8975eea381efc5db53ed9642f8bfecaa63
|
7
|
+
data.tar.gz: 9c25d165d404140577558b19e5a9b776c5c55091f12a51ddb95ade05ea96293f299c24b7225d3935d9eb7c4dcbc567aa233e14005d1bab5a961626925f9d6c70
|
data/Gemfile
CHANGED
data/lib/trample/metadata.rb
CHANGED
data/lib/trample/search.rb
CHANGED
@@ -166,6 +166,23 @@ module Trample
|
|
166
166
|
records
|
167
167
|
end
|
168
168
|
|
169
|
+
#This implementation is not using scroll and scan of elastic
|
170
|
+
#https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-scroll.html
|
171
|
+
#In future versions we hope to replace this with elastic in-built implementation
|
172
|
+
#
|
173
|
+
def find_in_batches(batch_size: 10_000)
|
174
|
+
page_number = 1
|
175
|
+
|
176
|
+
loop do
|
177
|
+
paginate(size: batch_size, number: page_number)
|
178
|
+
query!
|
179
|
+
yield results
|
180
|
+
offset = metadata.pagination.current_page * metadata.pagination.per_page
|
181
|
+
break unless metadata.pagination.next?
|
182
|
+
page_number += 1
|
183
|
+
end
|
184
|
+
end
|
185
|
+
|
169
186
|
private
|
170
187
|
|
171
188
|
def deep_dup(o)
|
data/lib/trample/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: trample_search
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.16.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- richmolj
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-07-
|
11
|
+
date: 2016-07-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: virtus
|