arelastic 3.3.0 → 3.3.1

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
  SHA256:
3
- metadata.gz: dbe2ab978160bb5c51def73c61c913c93582c675ce467caaa239a0967715826d
4
- data.tar.gz: 4c0b18e7f5767acd373940f3eff5e1e4b676c1f4a6a08766b465f025c5f09f0c
3
+ metadata.gz: 825228d447713a690e532c0865608f0e6c7800039bd04bdb12f03f3a3ef95d46
4
+ data.tar.gz: ec3aca5096dfec14ff7a40b4f4ef7240f05490934248021185909617ba9289ed
5
5
  SHA512:
6
- metadata.gz: 36dd4ea278ccb16d0ffe3cc81d1c737fce8f76d25b5157a617cc2ca60b8ab5dfa02dbcad30f9ca634f343fb5f6bccc33e6050a0974602167614b193903c89b0a
7
- data.tar.gz: 2e9c34a9603a8de8ea28a0e353f82014e5a1bed58ea0954769c104df550c56ba6dfc21a7e239295f5c15266ccc3ca434e242f9e9df6a376cd00fbe3ceae54582
6
+ metadata.gz: 206daea5938e2afa572aeb59c9894edd5a6b27b776242b55db93d6fd760677195d2c065717b2f36212e83a40440767e03736521ed44c5fc8d68c2dbbe82c1a8f
7
+ data.tar.gz: d8684847e83b09a05255ba4223f0e3bf1fcea2fc02af33d466220fe45150267e3d9e78d1ac27dab35ec046f018e2bf8b97175503110f84ae134d5ef9255cc5aa
@@ -0,0 +1,9 @@
1
+ module Arelastic
2
+ module Aggregations
3
+ class Sum < Arelastic::Aggregations::Aggregation
4
+ def as_elastic_aggregation
5
+ {'sum' => options}
6
+ end
7
+ end
8
+ end
9
+ end
@@ -14,5 +14,6 @@ require 'arelastic/aggregations/nested'
14
14
  require 'arelastic/aggregations/range'
15
15
  require 'arelastic/aggregations/reverse_nested'
16
16
  require 'arelastic/aggregations/sampler'
17
+ require 'arelastic/aggregations/sum'
17
18
  require 'arelastic/aggregations/terms'
18
19
  require 'arelastic/aggregations/value_count'
@@ -0,0 +1,16 @@
1
+ require 'helper'
2
+
3
+ class Arelastic::Aggregations::SumTest < Minitest::Test
4
+ def test_as_elastic
5
+ aggregation = Arelastic::Aggregations::Sum.new('foo', 'field' => 'bar_count')
6
+
7
+ expected = {
8
+ "foo" => {
9
+ "sum" => {
10
+ "field" => "bar_count"
11
+ }
12
+ }
13
+ }
14
+ assert_equal expected, aggregation.as_elastic
15
+ end
16
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: arelastic
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.0
4
+ version: 3.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthew Higgins
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-01-31 00:00:00.000000000 Z
11
+ date: 2022-02-09 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Build Elastic Search queries with objects
14
14
  email: developer@matthewhiggins.com
@@ -35,6 +35,7 @@ files:
35
35
  - lib/arelastic/aggregations/range.rb
36
36
  - lib/arelastic/aggregations/reverse_nested.rb
37
37
  - lib/arelastic/aggregations/sampler.rb
38
+ - lib/arelastic/aggregations/sum.rb
38
39
  - lib/arelastic/aggregations/terms.rb
39
40
  - lib/arelastic/aggregations/value_count.rb
40
41
  - lib/arelastic/arities.rb
@@ -116,6 +117,7 @@ files:
116
117
  - test/arelastic/aggregations/range_test.rb
117
118
  - test/arelastic/aggregations/reverse_nested_test.rb
118
119
  - test/arelastic/aggregations/sampler_test.rb
120
+ - test/arelastic/aggregations/sum_test.rb
119
121
  - test/arelastic/aggregations/terms_test.rb
120
122
  - test/arelastic/arities/binary_test.rb
121
123
  - test/arelastic/arities/polyadic_test.rb