elasticsearch-dsl-builder 0.0.22 → 0.0.23
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2a46b773e47b5ff467448ec9c37abb7ce671a4ce
|
4
|
+
data.tar.gz: 430faec3b0c3019fbf287ea27faaef63cc257692
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3780c91500a51a5b766f18531f1928e50d4b8b9bdd4b6badbd69926de89b88801859b1c208fadce3b48edf2c6f95fdc88fa99dea39f9205bef5b46b88b5e6d3f
|
7
|
+
data.tar.gz: 83f62728e503233298c7c424f4976e4077bb53318337543a3f9751a8dc640cb654208ec876e6a9757c4fe3424c5fd3c26bb8e85943bb3cd08bc2c0119c7e3075
|
data/Gemfile.lock
CHANGED
@@ -0,0 +1,26 @@
|
|
1
|
+
module ElasticsearchDslBuilder
|
2
|
+
module DSL
|
3
|
+
module Search
|
4
|
+
module Aggregations
|
5
|
+
class ReverseNested < Aggregation
|
6
|
+
def initialize
|
7
|
+
@type = :reverse_nested
|
8
|
+
super()
|
9
|
+
end
|
10
|
+
|
11
|
+
def path(path)
|
12
|
+
raise ArgumentError, 'path must be a String' unless path.instance_of?(String)
|
13
|
+
@path = path
|
14
|
+
self
|
15
|
+
end
|
16
|
+
|
17
|
+
def to_hash
|
18
|
+
@aggregation = {}
|
19
|
+
@aggregation.update(path: @path) if @path
|
20
|
+
super
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe ElasticsearchDslBuilder::DSL::Search::Aggregations::ReverseNested do
|
4
|
+
it 'should fail if path not valid' do
|
5
|
+
expect { Aggregations::ReverseNested.new.path(123) }.to raise_error(ArgumentError)
|
6
|
+
expect { Aggregations::ReverseNested.new.path(nil) }.to raise_error(ArgumentError)
|
7
|
+
end
|
8
|
+
|
9
|
+
it 'should chain create valid ES aggregation hash' do
|
10
|
+
reverse_nested = Aggregations::ReverseNested.new.path('path_a')
|
11
|
+
expect(reverse_nested.to_hash).to eq(reverse_nested: { path: 'path_a' })
|
12
|
+
|
13
|
+
reverse_nested = Aggregations::ReverseNested.new
|
14
|
+
expect(reverse_nested.to_hash).to eq(reverse_nested: {})
|
15
|
+
end
|
16
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: elasticsearch-dsl-builder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.23
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marvin Guerra
|
@@ -94,6 +94,7 @@ files:
|
|
94
94
|
- lib/elasticsearch_dsl_builder/dsl/search/aggregations/geohash_grid.rb
|
95
95
|
- lib/elasticsearch_dsl_builder/dsl/search/aggregations/nested.rb
|
96
96
|
- lib/elasticsearch_dsl_builder/dsl/search/aggregations/range.rb
|
97
|
+
- lib/elasticsearch_dsl_builder/dsl/search/aggregations/reverse_nested.rb
|
97
98
|
- lib/elasticsearch_dsl_builder/dsl/search/aggregations/stats.rb
|
98
99
|
- lib/elasticsearch_dsl_builder/dsl/search/aggregations/sum.rb
|
99
100
|
- lib/elasticsearch_dsl_builder/dsl/search/aggregations/sum_bucket.rb
|
@@ -128,6 +129,7 @@ files:
|
|
128
129
|
- spec/lib/dsl/search/aggregations/geohash_grid_spec.rb
|
129
130
|
- spec/lib/dsl/search/aggregations/nested_spec.rb
|
130
131
|
- spec/lib/dsl/search/aggregations/range_spec.rb
|
132
|
+
- spec/lib/dsl/search/aggregations/reverse_nested_spec.rb
|
131
133
|
- spec/lib/dsl/search/aggregations/stats_spec.rb
|
132
134
|
- spec/lib/dsl/search/aggregations/sum_bucket_spec.rb
|
133
135
|
- spec/lib/dsl/search/aggregations/sum_spec.rb
|
@@ -189,6 +191,7 @@ test_files:
|
|
189
191
|
- spec/lib/dsl/search/aggregations/geohash_grid_spec.rb
|
190
192
|
- spec/lib/dsl/search/aggregations/nested_spec.rb
|
191
193
|
- spec/lib/dsl/search/aggregations/range_spec.rb
|
194
|
+
- spec/lib/dsl/search/aggregations/reverse_nested_spec.rb
|
192
195
|
- spec/lib/dsl/search/aggregations/stats_spec.rb
|
193
196
|
- spec/lib/dsl/search/aggregations/sum_bucket_spec.rb
|
194
197
|
- spec/lib/dsl/search/aggregations/sum_spec.rb
|