arelastic 2.8.0 → 2.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: af4023400c1d257502730aac57b6ce84c98fd24616a1b46be924f61554c5c243
4
- data.tar.gz: cc7c793bed539affe141f675cdd507ebe92c65bb0f221095e9870bb1c1229714
3
+ metadata.gz: 1352e598774b8ec63e6e5840c21bdde48f6057d0863130e85589641496175f1d
4
+ data.tar.gz: 86e8f6398f27fda2b81cc7554fd22027cf7a7c985e116db498cf68dd8dd24553
5
5
  SHA512:
6
- metadata.gz: 294e5fdfe4f87a3051f1e02cb80ab26c328ed0edf22542a9b05ff2ddbb1c6dc18f1227fd1290d294bf9a39f35d3ff9acd986c55630d567614b49faf4106914e6
7
- data.tar.gz: 365ec409f5586f3df3c4f606dc9a6734c5db370035d6cb7bba2295e9216f6e0b9f4f460a680f089d332fa04f94a65ee594c4d7e0fe63f22d50845d04a49b68a2
6
+ metadata.gz: c51d28cc2d3fef1c52c6055ae1e897d988a366aaf2ac847bc1c6b07bba07ec168311ce735f527d48b7a4164aa7c85f5a73aa70ac1ec14644e2c6be9ef463fb5a
7
+ data.tar.gz: aff6d66dc806cab29a7d4e7d3a03a82ee3582acbe510d2cec8fdbb97576ed55e65fa935f783c1e1bb44338f4a19690863e9513bb0f938bdb1f6673c383a9b82a
@@ -1,6 +1,7 @@
1
1
  require 'arelastic/aggregations/aggregation'
2
2
  require 'arelastic/aggregations/bucket'
3
3
 
4
+ require 'arelastic/aggregations/cardinality'
4
5
  require 'arelastic/aggregations/date_histogram'
5
6
  require 'arelastic/aggregations/filter'
6
7
  require 'arelastic/aggregations/filters'
@@ -0,0 +1,9 @@
1
+ module Arelastic
2
+ module Aggregations
3
+ class Cardinality < Arelastic::Aggregations::Aggregation
4
+ def as_elastic_aggregation
5
+ {'cardinality' => options}
6
+ end
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,16 @@
1
+ require 'helper'
2
+
3
+ class Arelastic::Aggregations::CardinalityTest < Minitest::Test
4
+ def test_as_elastic
5
+ aggregation = Arelastic::Aggregations::Cardinality.new('foo', 'field' => 'name')
6
+
7
+ expected = {
8
+ "foo" => {
9
+ "cardinality" => {
10
+ "field" => "name"
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: 2.8.0
4
+ version: 2.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthew Higgins
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-05-28 00:00:00.000000000 Z
11
+ date: 2019-09-09 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Build Elastic Search queries with objects
14
14
  email: developer@matthewhiggins.com
@@ -22,6 +22,7 @@ files:
22
22
  - lib/arelastic/aggregations.rb
23
23
  - lib/arelastic/aggregations/aggregation.rb
24
24
  - lib/arelastic/aggregations/bucket.rb
25
+ - lib/arelastic/aggregations/cardinality.rb
25
26
  - lib/arelastic/aggregations/date_histogram.rb
26
27
  - lib/arelastic/aggregations/filter.rb
27
28
  - lib/arelastic/aggregations/filters.rb
@@ -103,6 +104,7 @@ files:
103
104
  - lib/arelastic/sorts/sort.rb
104
105
  - test/arelastic/aggregations/aggregation_test.rb
105
106
  - test/arelastic/aggregations/bucket_test.rb
107
+ - test/arelastic/aggregations/cardinality_test.rb
106
108
  - test/arelastic/aggregations/date_histogram_test.rb
107
109
  - test/arelastic/aggregations/filter_test.rb
108
110
  - test/arelastic/aggregations/filters_test.rb