elasticsearch-model 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YzQ5M2Q0YTQyMWFiNTY5OGIwNzYyMTA2NTkzOGFmNDczZWQzZjQ4Mg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
N2QyZDk1ODYzYjJlY2E3MGY0ZGNlNmFlZDBkMGYzMTk0NzdlMTlmOQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NGI1ZTM1ODZhYmY1NmVhZmYxYTRjNjRkNTMyYjYxOWY5MzZhY2JkYTlmOWY1
|
10
|
+
ZTlhMWI1NTkwOWNlYWVjNWU3ZWQxZTM3NWQ5MDIyZmUxNzRlYjJjNzk0Mjk4
|
11
|
+
MzU2OTU3NmQzNjRjYzNkZmQ1MmI3MTdmZjAxYjlmYWY3MWEzYWY=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
Y2ZjZGM0MGY4OWFhMzZkNmI0NTU4YTlhYzkzNGZmN2FhNGUxZDg2N2NkOGQ3
|
14
|
+
ZjM2YjIzNTYxODk2MmJjYWViZmU2NGI5YWI0NjBhNGMyOThiYWVlOTRiYjI5
|
15
|
+
ZjUzYWNlNDZhMWM4N2MwYjE3ZmMwMDBiNzVkOTNmNTEwMTJmOTc=
|
@@ -164,6 +164,14 @@ module Elasticsearch
|
|
164
164
|
assert_equal 'Testing Coding', response.records.order('title DESC').first.title
|
165
165
|
end
|
166
166
|
end
|
167
|
+
|
168
|
+
should "allow dot access to response" do
|
169
|
+
response = Article.search query: { match: { title: { query: 'test' } } },
|
170
|
+
aggregations: { dates: { date_histogram: { field: 'created_at', interval: 'hour' } } }
|
171
|
+
|
172
|
+
response.response.respond_to?(:aggregations)
|
173
|
+
assert_equal 2, response.response.aggregations.dates.buckets.first.doc_count
|
174
|
+
end
|
167
175
|
end
|
168
176
|
|
169
177
|
end
|
data/test/unit/response_test.rb
CHANGED
@@ -25,6 +25,16 @@ class Elasticsearch::Model::ResponseTest < Test::Unit::TestCase
|
|
25
25
|
assert_equal 'OK', response.shards.one
|
26
26
|
end
|
27
27
|
|
28
|
+
should "wrap the raw Hash response in Hashie::Mash" do
|
29
|
+
@search = Elasticsearch::Model::Searching::SearchRequest.new OriginClass, '*'
|
30
|
+
@search.stubs(:execute!).returns({'hits' => { 'hits' => [] }, 'aggregations' => { 'dates' => 'FOO' }})
|
31
|
+
|
32
|
+
response = Elasticsearch::Model::Response::Response.new OriginClass, @search
|
33
|
+
|
34
|
+
assert_respond_to response.response, :aggregations
|
35
|
+
assert_equal 'FOO', response.response.aggregations.dates
|
36
|
+
end
|
37
|
+
|
28
38
|
should "load and access the results" do
|
29
39
|
@search.expects(:execute!).returns(RESPONSE)
|
30
40
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: elasticsearch-model
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Karel Minarik
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-06-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: elasticsearch
|