es-elasticity 0.4.0 → 0.4.1
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 +5 -1
- 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: ed2432846e6d936d5b7ed4e777b55ee0dd8d759e
|
4
|
+
data.tar.gz: b51bb2084d453987fcff43e751ecec25ff62286a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d639474dc06407cea519dee319025fdd4d23eecca222d86f76ffd092a41b55bb40d5f906b785f257d76ee9bfea89010461933920a76517d4c1ce0997a9964ffa
|
7
|
+
data.tar.gz: 99aa42e41b271174b5ee83586d5207f9f30f43de7e8b2bcfefc03049d2f8b6c4da3a7205f26e106314c9a8196fbc6728b4f1ab75852f28a6c48c141c638e297f
|
data/lib/elasticity/search.rb
CHANGED
@@ -20,6 +20,10 @@ module Elasticity
|
|
20
20
|
self.class.new(@index_name, @document_type, @body.deep_merge(body_changes))
|
21
21
|
end
|
22
22
|
|
23
|
+
def to_count_args
|
24
|
+
{ index: @index_name, type: @document_type, body: { query: @body.fetch(:query) }}
|
25
|
+
end
|
26
|
+
|
23
27
|
def to_search_args
|
24
28
|
{ index: @index_name, type: @document_type, body: @body }
|
25
29
|
end
|
@@ -110,7 +114,7 @@ module Elasticity
|
|
110
114
|
end
|
111
115
|
|
112
116
|
def count(args = {})
|
113
|
-
@client.count(@search_definition.
|
117
|
+
@client.count(@search_definition.to_count_args.reverse_merge(args))["count"]
|
114
118
|
end
|
115
119
|
|
116
120
|
def search_results
|
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.4.
|
4
|
+
version: 0.4.1
|
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-10-
|
11
|
+
date: 2015-10-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|