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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7e134bcdf377161ed5a1909006e3c595a9e1a135
4
- data.tar.gz: 0764431bff33cb0cf4b8ab04aaaee3641856bfce
3
+ metadata.gz: d2fa674580a112dd0787b528d87f5972fb5335b0
4
+ data.tar.gz: e2c8f224ee29f65c339e0c3560af9690e30f0254
5
5
  SHA512:
6
- metadata.gz: affa393e491f7f3f89514a5485b2631cf573ecd09936b993328787f9ff5d4347c5ef9f2b87afc6203da63074de0e4038cd7be34d3f9f482df03c7329948286c1
7
- data.tar.gz: 87a460bc7cef535d7c80a5071bdefd64de5ecd2101bb2fb6218cdc43ad4ab489b19625765374870183c4b37c9054036a79624b09f0c6f998a9593f9ee94a6441
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.flat_map { |agg| agg.accept_visitor(self) }
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.1'
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.1
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-05-31 00:00:00.000000000 Z
11
+ date: 2017-06-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler