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: 3768e622d02b04ed6d2f34897589f64b16a353c7
4
- data.tar.gz: 3e26771c0bf181965151263cfa62f5fd3ab30324
3
+ metadata.gz: 7930e5a92a8e6e184698d3c37b7198aed10fd227
4
+ data.tar.gz: 6db8b0dab0894bd46f3f24e6ce6aa29b9e93dddb
5
5
  SHA512:
6
- metadata.gz: de3b63d3e1f60333d4c95b6ab0c45b2963ab04075a0ba8f83250a4331d16592e9732bbe993f5b98230c24bb1bf36abf9c596f9999891e6c7751bf7ca213f0fee
7
- data.tar.gz: 1f15eec971262a774e988126bb90ef36676d8b8f16d4a22251c24b80c8eca78dd530de6ce758b226fc3f8a5d3a5431deee46f6deeb4bf2ddab3485426a409d27
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
 
@@ -1,5 +1,5 @@
1
1
  module Elasticsearch
2
2
  module API
3
- VERSION = "2.0.1"
3
+ VERSION = "2.0.2"
4
4
  end
5
5
  end
@@ -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.1
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-01-21 00:00:00.000000000 Z
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
- description: |
336
- Ruby API for Elasticsearch. See the `elasticsearch` gem for full integration.
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.2.2
672
+ rubygems_version: 2.6.10
658
673
  signing_key:
659
674
  specification_version: 4
660
675
  summary: Ruby API for Elasticsearch.