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 +4 -4
- data/lib/co-elastic-query.rb +20 -0
- data/lib/co-elastic-query/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eb69eb7c09bf694d2fde1be05798c6317704eed7
|
4
|
+
data.tar.gz: 19f8a209de01e39c7053a600339fb9e1d21a39fd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5df31e54619ce1e3798bf6de57730909e021c477a45bdf4e501a58b5b773d8a74fb810147edba3fb48b3204f8560feccdd63ed102813cdfb7834bfadf1b6fe5a
|
7
|
+
data.tar.gz: 280db23f0a3356fd7832053a5d23af430cf9d18b5f477854183199fad8fd24b37dc0443566f8981b40565350d95d1a2e9303c7467c00d1cc9f9bd6f7872d40c3
|
data/lib/co-elastic-query.rb
CHANGED
@@ -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
|
|
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.
|
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:
|
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.
|
91
|
+
rubygems_version: 2.5.1
|
92
92
|
signing_key:
|
93
93
|
specification_version: 4
|
94
94
|
summary: Elasticsearch query generator
|