elasticated 2.5.1 → 2.5.2
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 +4 -4
- data/lib/elasticated/delimiter_visitor.rb +4 -2
- data/lib/version.rb +4 -1
- data/spec/strategy_params_for_query_service_spec.rb +17 -0
- 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: d2fa674580a112dd0787b528d87f5972fb5335b0
|
4
|
+
data.tar.gz: e2c8f224ee29f65c339e0c3560af9690e30f0254
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: feff50fbec4f0740a807e9d4901e9c8813722fcca388d7b43d9506d302864c8e2042dfbe5dcf9405e0812e3d67abc238280834b0a4ce7cabe599226fe7f04cca
|
7
|
+
data.tar.gz: 359623772d4c733a50bd9c2cdc16afd860c36a8b7012e62b8429e9c281c667ab9b0dda8aae9be07e96404556f927cee807263f62ea2e6f3f39f5d29461d933dd
|
@@ -36,7 +36,9 @@ module Elasticated
|
|
36
36
|
end
|
37
37
|
|
38
38
|
def visit_query_aggregations(query_aggregations)
|
39
|
-
query_aggregations._aggregations.
|
39
|
+
query_aggregations._aggregations.inject([]) do |acum, aggregation|
|
40
|
+
acum + [aggregation.accept_visitor(self).inject(:merge)].compact
|
41
|
+
end
|
40
42
|
end
|
41
43
|
|
42
44
|
def visit_aggregation(aggregation)
|
@@ -44,7 +46,7 @@ module Elasticated
|
|
44
46
|
end
|
45
47
|
|
46
48
|
def visit_filter_aggregation(filter_aggregation)
|
47
|
-
filter_aggregation._subaggregations._conditions.accept_visitor(self)
|
49
|
+
filter_aggregation._subaggregations._conditions.accept_visitor(self).flatten(1)
|
48
50
|
end
|
49
51
|
|
50
52
|
end
|
data/lib/version.rb
CHANGED
@@ -1,9 +1,12 @@
|
|
1
1
|
module Elasticated
|
2
|
-
VERSION = '2.5.
|
2
|
+
VERSION = '2.5.2'
|
3
3
|
end
|
4
4
|
|
5
5
|
# Changelog
|
6
6
|
|
7
|
+
# 2.5.2
|
8
|
+
# Se corrige el visitor para que los filtros de subaggregations se representen en conjuntos por aggregation y no por filtro
|
9
|
+
|
7
10
|
# 2.5.1
|
8
11
|
# Se agregaron test para el merge delimiters en term delimiter factory que ahora considera arrays de delimiters vacios
|
9
12
|
|
@@ -323,6 +323,23 @@ module Elasticated
|
|
323
323
|
expect(actual).to eq expected
|
324
324
|
end
|
325
325
|
|
326
|
+
it 'should not delimit by non-delimiters' do
|
327
|
+
options = {delimit_by: [:conditions, :aggregations]}
|
328
|
+
delimiters = [Elasticated::Delimiters::DateFieldDelimiter.new(field: :date)]
|
329
|
+
query.filter {equal :date, ['2017-05-23', '2017-06-01']}
|
330
|
+
query.aggregations do
|
331
|
+
filter :nothing_to_do do
|
332
|
+
conditions { equal :primary_keywords, ["hello"] }
|
333
|
+
filter :another_filter do
|
334
|
+
conditions { equal :secondary_keywords, ["bye"] }
|
335
|
+
end
|
336
|
+
end
|
337
|
+
end
|
338
|
+
expected = {date_since: '2017-05-23', date_until: '2017-06-01'}
|
339
|
+
actual = service.strategy_params_for_query(delimiters, query, options)
|
340
|
+
expect(actual).to eq expected
|
341
|
+
end
|
342
|
+
|
326
343
|
end
|
327
344
|
|
328
345
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: elasticated
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.5.
|
4
|
+
version: 2.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pablo Fernandez
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-06-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|