arelastic 2.5.0 → 2.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/arelastic.rb +8 -0
- data/lib/arelastic/builders.rb +1 -1
- data/lib/arelastic/builders/{query.rb → queries.rb} +1 -1
- data/lib/arelastic/builders/search.rb +2 -2
- data/test/arelastic/builders/{query_test.rb → queries_test.rb} +9 -9
- data/test/arelastic/builders/search_test.rb +1 -1
- data/test/arelastic_test.rb +7 -0
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 87e0d3a33fb5774804affcdeaba8652d46064a8d3cff6e8d1e423ca7d7c43703
|
4
|
+
data.tar.gz: c0a30e25ca73dfdd542ada6d7109c595f8448c026e18485bb2618d5104a6eb39
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f8f2f6138254768c4d708ca83000cd081bcedcde99e6b497c225c1050059be735c57513194a41f7e130579fb52d18899d818f355a315d642adfc9430b46f4263
|
7
|
+
data.tar.gz: 463e56264b0e1dc7f68e039c835432861e706cf60e619947cf60ce8b8e4e28b3cf480e1d6bd7047d2190c08fc7248cadb06cb4c73c518c61eae0028019cbf08e
|
data/lib/arelastic.rb
CHANGED
data/lib/arelastic/builders.rb
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
require 'helper'
|
2
2
|
|
3
|
-
class Arelastic::Builders::
|
3
|
+
class Arelastic::Builders::QueriesTest < Minitest::Test
|
4
4
|
def test_constant_score
|
5
|
-
query = Arelastic::Builders::
|
5
|
+
query = Arelastic::Builders::Queries.constant_score({"foo" => "bar"})
|
6
6
|
expected = {"constant_score" => {"foo" => "bar"}}
|
7
7
|
|
8
8
|
assert_equal expected, query.as_elastic
|
9
9
|
end
|
10
10
|
|
11
11
|
def test_bool
|
12
|
-
query = Arelastic::Builders::
|
12
|
+
query = Arelastic::Builders::Queries.bool(
|
13
13
|
must: {"query_string" => "foo"},
|
14
14
|
filter: {"term" => "bar"}
|
15
15
|
)
|
@@ -19,39 +19,39 @@ class Arelastic::Builders::QueryTest < Minitest::Test
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def test_match_all
|
22
|
-
query = Arelastic::Builders::
|
22
|
+
query = Arelastic::Builders::Queries.match_all
|
23
23
|
expected = {"match_all" => {}}
|
24
24
|
|
25
25
|
assert_equal expected, query.as_elastic
|
26
26
|
end
|
27
27
|
|
28
28
|
def test_multi_match
|
29
|
-
Arelastic::Builders::
|
29
|
+
Arelastic::Builders::Queries.multi_match 'blue', ['color', 'description']
|
30
30
|
end
|
31
31
|
|
32
32
|
def test_field
|
33
|
-
query = Arelastic::Builders::
|
33
|
+
query = Arelastic::Builders::Queries['user'].field 'kimchy'
|
34
34
|
expected = { "field" => { "user" => "kimchy" } }
|
35
35
|
|
36
36
|
assert_equal expected, query.as_elastic
|
37
37
|
end
|
38
38
|
|
39
39
|
def test_term
|
40
|
-
query = Arelastic::Builders::
|
40
|
+
query = Arelastic::Builders::Queries['user'].term 'kimchy'
|
41
41
|
expected = {"term" => { "user" => "kimchy" }}
|
42
42
|
|
43
43
|
assert_equal expected, query.as_elastic
|
44
44
|
end
|
45
45
|
|
46
46
|
def test_terms
|
47
|
-
query = Arelastic::Builders::
|
47
|
+
query = Arelastic::Builders::Queries['tags'].terms ['blue', 'pill']
|
48
48
|
expected = {"terms" => { "tags" => ["blue", "pill"] }}
|
49
49
|
|
50
50
|
assert_equal expected, query.as_elastic
|
51
51
|
end
|
52
52
|
|
53
53
|
def test_match
|
54
|
-
query = Arelastic::Builders::
|
54
|
+
query = Arelastic::Builders::Queries['message'].match "hello"
|
55
55
|
expected = {"match" => { "message" => "hello" }}
|
56
56
|
|
57
57
|
assert_equal expected, query.as_elastic
|
@@ -14,7 +14,7 @@ class Arelastic::Builders::SearchTest < Minitest::Test
|
|
14
14
|
end
|
15
15
|
|
16
16
|
def test_query
|
17
|
-
assert_equal Arelastic::Builders::
|
17
|
+
assert_equal Arelastic::Builders::Queries, Arelastic::Builders::Search.queries
|
18
18
|
end
|
19
19
|
|
20
20
|
def test_sort
|
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: 2.
|
4
|
+
version: 2.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matthew Higgins
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-12-04 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Build Elastic Search queries with objects
|
14
14
|
email: developer@matthewhiggins.com
|
@@ -42,7 +42,7 @@ files:
|
|
42
42
|
- lib/arelastic/builders/aggregation.rb
|
43
43
|
- lib/arelastic/builders/filter.rb
|
44
44
|
- lib/arelastic/builders/mapping.rb
|
45
|
-
- lib/arelastic/builders/
|
45
|
+
- lib/arelastic/builders/queries.rb
|
46
46
|
- lib/arelastic/builders/search.rb
|
47
47
|
- lib/arelastic/builders/sort.rb
|
48
48
|
- lib/arelastic/mappings.rb
|
@@ -117,7 +117,7 @@ files:
|
|
117
117
|
- test/arelastic/builders/aggregation_test.rb
|
118
118
|
- test/arelastic/builders/filter_test.rb
|
119
119
|
- test/arelastic/builders/mapping_test.rb
|
120
|
-
- test/arelastic/builders/
|
120
|
+
- test/arelastic/builders/queries_test.rb
|
121
121
|
- test/arelastic/builders/search_test.rb
|
122
122
|
- test/arelastic/builders/sort_test.rb
|
123
123
|
- test/arelastic/mappings/types/binary_test.rb
|
@@ -149,6 +149,7 @@ files:
|
|
149
149
|
- test/arelastic/searches/sort_test.rb
|
150
150
|
- test/arelastic/sorts/field_test.rb
|
151
151
|
- test/arelastic/sorts/geo_distance_test.rb
|
152
|
+
- test/arelastic_test.rb
|
152
153
|
- test/helper.rb
|
153
154
|
homepage: http://github.com/matthuhiggins/arelastic
|
154
155
|
licenses:
|