arelastic 1.0.2 → 1.0.3
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: 9423c0576c44867372fc88a1ca44407425d06e15
|
4
|
+
data.tar.gz: aa0065aea8b9ba21ff8cdf1a757f1117a1a53f23
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b5818ba5af9d8e1df98f26288ad4a36e5872f2ce1dc057224bd18643df27832935ec69fe8702aaa90077dc5a99b88d6fce8693b8345b58fa652faa997538ab71
|
7
|
+
data.tar.gz: 5d0fd2581a854c34602319803c50b3a13f87b66d9e7ef524f8acb5676d75f5370cd37d18ddc3070c8db6db831b353e71112ef76f4e0ffaa7ce9b31fe7c4246fb
|
@@ -1,16 +1,15 @@
|
|
1
1
|
module Arelastic
|
2
2
|
module Filters
|
3
3
|
class GeoBoundingBox < Arelastic::Filters::Filter
|
4
|
-
attr_accessor :field, :
|
5
|
-
def initialize(field,
|
6
|
-
@field
|
7
|
-
@
|
8
|
-
@
|
9
|
-
@options = options
|
4
|
+
attr_accessor :field, :bounds, :options
|
5
|
+
def initialize(field, bounds, options = {})
|
6
|
+
@field = field
|
7
|
+
@bounds = bounds
|
8
|
+
@options = options
|
10
9
|
end
|
11
10
|
|
12
11
|
def as_elastic
|
13
|
-
params = {field =>
|
12
|
+
params = {field => bounds}.update(options)
|
14
13
|
|
15
14
|
{ "geo_bounding_box" => params }
|
16
15
|
end
|
@@ -13,7 +13,7 @@ class Arelastic::Filters::GeoBoundingBoxTest < Minitest::Test
|
|
13
13
|
|
14
14
|
assert_equal(
|
15
15
|
expected,
|
16
|
-
Arelastic::Filters::GeoBoundingBox.new('location', [40, -70], [30, -60]).as_elastic
|
16
|
+
Arelastic::Filters::GeoBoundingBox.new('location', 'top_left' => [40, -70], 'bottom_right' => [30, -60]).as_elastic
|
17
17
|
)
|
18
18
|
end
|
19
19
|
|
@@ -30,7 +30,7 @@ class Arelastic::Filters::GeoBoundingBoxTest < Minitest::Test
|
|
30
30
|
|
31
31
|
assert_equal(
|
32
32
|
expected,
|
33
|
-
Arelastic::Filters::GeoBoundingBox.new('location', [40, -70], [30, -60], 'index' => true).as_elastic
|
33
|
+
Arelastic::Filters::GeoBoundingBox.new('location', {'top_left' => [40, -70], 'bottom_right' => [30, -60]}, 'index' => true).as_elastic
|
34
34
|
)
|
35
35
|
end
|
36
36
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: arelastic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matthew Higgins
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-01-
|
11
|
+
date: 2016-01-13 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Build Elastic Search queries with objects
|
14
14
|
email: developer@matthewhiggins.com
|