Skip to content

Commit 69ec28d

Browse files
Dawn Richardsonkarmi
authored andcommitted
[API] Fix the path for indices exists_type? method & update docs
Closes #461
1 parent 725563c commit 69ec28d

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

elasticsearch-api/lib/elasticsearch/api/actions/indices/exists_type.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ module Actions
2222
# @option arguments [Boolean] :local Return local information, do not retrieve the state from master node
2323
# (default: false)
2424
#
25-
# @see http://www.elasticsearch.org/guide/reference/api/admin-indices-types-exists/
25+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-types-exists.html
2626
#
2727
def exists_type(arguments={})
2828
raise ArgumentError, "Required argument 'index' missing" unless arguments[:index]
@@ -36,7 +36,7 @@ def exists_type(arguments={})
3636
]
3737

3838
method = HTTP_HEAD
39-
path = Utils.__pathify Utils.__listify(arguments[:index]), Utils.__escape(arguments[:type])
39+
path = Utils.__pathify Utils.__listify(arguments[:index]), '_mapping', Utils.__escape(arguments[:type])
4040

4141
params = Utils.__validate_and_extract_params arguments, valid_params
4242
body = nil

elasticsearch-api/test/unit/indices/exists_type_test.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class IndicesExistsTypeTest < ::Test::Unit::TestCase
1010
should "perform correct request" do
1111
subject.expects(:perform_request).with do |method, url, params, body|
1212
assert_equal 'HEAD', method
13-
assert_equal 'foo/bar', url
13+
assert_equal 'foo/_mapping/bar', url
1414
assert_equal Hash.new, params
1515
assert_nil body
1616
true
@@ -21,7 +21,7 @@ class IndicesExistsTypeTest < ::Test::Unit::TestCase
2121

2222
should "perform request against multiple indices" do
2323
subject.expects(:perform_request).with do |method, url, params, body|
24-
assert_equal 'foo,bar/bam', url
24+
assert_equal 'foo,bar/_mapping/bam', url
2525
true
2626
end.returns(FakeResponse.new)
2727

@@ -30,7 +30,7 @@ class IndicesExistsTypeTest < ::Test::Unit::TestCase
3030

3131
should "URL-escape the parts" do
3232
subject.expects(:perform_request).with do |method, url, params, body|
33-
assert_equal 'foo%5Ebar/bar%2Fbam', url
33+
assert_equal 'foo%5Ebar/_mapping/bar%2Fbam', url
3434
true
3535
end.returns(FakeResponse.new)
3636

0 commit comments

Comments
 (0)