elasticsearch-api 2.0.1 → 2.0.2
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7930e5a92a8e6e184698d3c37b7198aed10fd227
|
4
|
+
data.tar.gz: 6db8b0dab0894bd46f3f24e6ce6aa29b9e93dddb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6a34d854f41738b90b36e27470bfe198bc9c26b46457d553e7d75edad2047ddccc3ee68148e8ea7d2857148e27c18953b2d4953208c9e7baa10f3cdb09d13103
|
7
|
+
data.tar.gz: 8e58ee3cf1f0676168ca4fb13fddd6256b31e6ac29525ac8300ac0d59d77d97c765c51f332ff6f4a6634f3d42e7a367e20e8dd0cddfdc50c79341e3a9ec0e124
|
@@ -33,6 +33,8 @@ module Elasticsearch
|
|
33
33
|
# @see http://www.elastic.co/guide/en/elasticsearch/reference/master/search-exists.html
|
34
34
|
#
|
35
35
|
def search_exists(arguments={})
|
36
|
+
arguments[:index] = UNDERSCORE_ALL if ! arguments[:index] && arguments[:type]
|
37
|
+
|
36
38
|
valid_params = [
|
37
39
|
:ignore_unavailable,
|
38
40
|
:allow_no_indices,
|
@@ -48,7 +50,7 @@ module Elasticsearch
|
|
48
50
|
:lenient,
|
49
51
|
:lowercase_expanded_terms ]
|
50
52
|
method = 'POST'
|
51
|
-
path = "_search/exists"
|
53
|
+
path = Utils.__pathify( Utils.__listify(arguments[:index]), Utils.__listify(arguments[:type]), "_search/exists" )
|
52
54
|
params = Utils.__validate_and_extract_params arguments, valid_params
|
53
55
|
body = arguments[:body]
|
54
56
|
|
@@ -19,6 +19,38 @@ module Elasticsearch
|
|
19
19
|
subject.search_exists :q => 'foo'
|
20
20
|
end
|
21
21
|
|
22
|
+
should "perform request against an index" do
|
23
|
+
subject.expects(:perform_request).with do |method, url, params, body|
|
24
|
+
assert_equal 'POST', method
|
25
|
+
assert_equal 'books/_search/exists', url
|
26
|
+
assert_nil body
|
27
|
+
true
|
28
|
+
end.returns(FakeResponse.new)
|
29
|
+
|
30
|
+
subject.search_exists :index => 'books'
|
31
|
+
end
|
32
|
+
|
33
|
+
should "perform request against an index and type" do
|
34
|
+
subject.expects(:perform_request).with do |method, url, params, body|
|
35
|
+
assert_equal 'POST', method
|
36
|
+
assert_equal 'books/holly/_search/exists', url
|
37
|
+
assert_nil body
|
38
|
+
true
|
39
|
+
end.returns(FakeResponse.new)
|
40
|
+
|
41
|
+
subject.search_exists :index => 'books', :type => 'holly'
|
42
|
+
end
|
43
|
+
|
44
|
+
should "perform request against default index if type given" do
|
45
|
+
subject.expects(:perform_request).with do |method, url, params, body|
|
46
|
+
assert_equal 'POST', method
|
47
|
+
assert_equal '_all/holly/_search/exists', url
|
48
|
+
assert_nil body
|
49
|
+
true
|
50
|
+
end.returns(FakeResponse.new)
|
51
|
+
|
52
|
+
subject.search_exists :type => 'holly'
|
53
|
+
end
|
22
54
|
end
|
23
55
|
|
24
56
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: elasticsearch-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Karel Minarik
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-04-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: multi_json
|
@@ -332,8 +332,23 @@ dependencies:
|
|
332
332
|
- - ">="
|
333
333
|
- !ruby/object:Gem::Version
|
334
334
|
version: '0'
|
335
|
-
|
336
|
-
|
335
|
+
- !ruby/object:Gem::Dependency
|
336
|
+
name: test-unit
|
337
|
+
requirement: !ruby/object:Gem::Requirement
|
338
|
+
requirements:
|
339
|
+
- - "~>"
|
340
|
+
- !ruby/object:Gem::Version
|
341
|
+
version: '2'
|
342
|
+
type: :development
|
343
|
+
prerelease: false
|
344
|
+
version_requirements: !ruby/object:Gem::Requirement
|
345
|
+
requirements:
|
346
|
+
- - "~>"
|
347
|
+
- !ruby/object:Gem::Version
|
348
|
+
version: '2'
|
349
|
+
description: 'Ruby API for Elasticsearch. See the `elasticsearch` gem for full integration.
|
350
|
+
|
351
|
+
'
|
337
352
|
email:
|
338
353
|
- karel.minarik@elasticsearch.org
|
339
354
|
executables: []
|
@@ -654,7 +669,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
654
669
|
version: '0'
|
655
670
|
requirements: []
|
656
671
|
rubyforge_project:
|
657
|
-
rubygems_version: 2.
|
672
|
+
rubygems_version: 2.6.10
|
658
673
|
signing_key:
|
659
674
|
specification_version: 4
|
660
675
|
summary: Ruby API for Elasticsearch.
|