co-elastic-query 1.0.8 → 1.0.9

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
  SHA1:
3
- metadata.gz: cf60505d2fc6b1e48f1347900644ff952d9e624d
4
- data.tar.gz: 0f34b87be2fc3b40ed3e1368b6deb87f993a7cdf
3
+ metadata.gz: eb69eb7c09bf694d2fde1be05798c6317704eed7
4
+ data.tar.gz: 19f8a209de01e39c7053a600339fb9e1d21a39fd
5
5
  SHA512:
6
- metadata.gz: 75ce7fbcff180ae0ae8b0b2ad27ef8993caef0a650a10e06c3a44f0e2f089efca7b115ea1d8e96c6e25b8b21a3e01f1703af3c6bd82aadb07a2938ad9671db30
7
- data.tar.gz: d0c5a85991a54a4aebc75f7f3c560d90710abda0aafbea2240ab147651772cb9a49889cf90a9b271f491c1787f928ef39801458a08057db888fdfde09cb392d6
6
+ metadata.gz: 5df31e54619ce1e3798bf6de57730909e021c477a45bdf4e501a58b5b773d8a74fb810147edba3fb48b3204f8560feccdd63ed102813cdfb7834bfadf1b6fe5a
7
+ data.tar.gz: 280db23f0a3356fd7832053a5d23af430cf9d18b5f477854183199fad8fd24b37dc0443566f8981b40565350d95d1a2e9303c7467c00d1cc9f9bd6f7872d40c3
@@ -47,6 +47,12 @@ class Elastic
47
47
  self
48
48
  end
49
49
 
50
+ def and_filter(filters)
51
+ @andFilter ||= {}
52
+ @andFilter.merge!(filters)
53
+ self
54
+ end
55
+
50
56
  # Applys the query to child objects
51
57
  def has_child(name)
52
58
  @hasChild = name
@@ -113,6 +119,20 @@ class Elastic
113
119
  end
114
120
  end
115
121
 
122
+ if @andFilter
123
+ fieldfilters ||= []
124
+ fieldfilter = { :and => [] }
125
+ andArray = fieldfilter[:and]
126
+
127
+ @andFilter.each do |key, value|
128
+ build_filter(andArray, key, value)
129
+ end
130
+
131
+ unless andArray.empty?
132
+ fieldfilters.push(fieldfilter)
133
+ end
134
+ end
135
+
116
136
  if @rangeFilter
117
137
  fieldfilters ||= []
118
138
 
@@ -1,3 +1,3 @@
1
1
  module CoElasticQuery
2
- VERSION = "1.0.8"
2
+ VERSION = "1.0.9"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: co-elastic-query
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.8
4
+ version: 1.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephen von Takach
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-10-20 00:00:00.000000000 Z
12
+ date: 2016-07-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -88,7 +88,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
88
88
  version: '0'
89
89
  requirements: []
90
90
  rubyforge_project:
91
- rubygems_version: 2.4.6
91
+ rubygems_version: 2.5.1
92
92
  signing_key:
93
93
  specification_version: 4
94
94
  summary: Elasticsearch query generator