Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor improvement to index_exists? using correct es api call #51

Open
wants to merge 73 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
3fce337
Allow multi_get to take a hash
erickt Oct 14, 2011
967ffad
ignore Gemfile.lock
grantr Oct 17, 2011
bd8d510
bump version to 0.1.4
grantr Oct 17, 2011
b203826
Expose getting aliases for an index.
erickt Nov 2, 2011
68cc4d8
add spec for updating and getting aliases
grantr Nov 4, 2011
da0968a
bump version
grantr Nov 4, 2011
573be55
move patron spec in Gemfile to gemspec
grantr Dec 13, 2011
e64fb9c
set default index and type from server url
grantr Feb 13, 2012
c7cb0dd
don't require a specific bundler
grantr Feb 13, 2012
2c786db
use default index in get_settings and get_aliases
grantr Feb 13, 2012
08b0347
update README to show new url instantiation
grantr Feb 17, 2012
61b7efb
bump version to 0.1.6
grantr Feb 17, 2012
6a7dfe6
test on travis now that ES is available
grantr May 23, 2012
896dea5
don't run coverage on rbx
grantr May 23, 2012
d69c0da
don't run on jruby
grantr May 23, 2012
db45356
add build status to readme
grantr May 23, 2012
6446b44
convert readme to markdown
grantr May 23, 2012
5be651f
actually update the readme
grantr May 23, 2012
95bc4d0
add supported rubies to readme
grantr May 23, 2012
7cef043
Fix error in README.md (otherwise: "URI::InvalidURIError: bad URI(is …
rb2k May 25, 2012
f1cd92d
Fix markdown in API examples
rb2k Jun 24, 2012
ca17315
restore the ability to connect with just ip:port
grantr Jul 12, 2012
1e40e27
add thrift to the Gemfile
grantr Jul 12, 2012
b908d45
add thrift example to readme
grantr Jul 12, 2012
f4134b1
use MultiJson instead of Yajl directly
grantr Jul 12, 2012
2f87620
extract common code into a method
grantr Jul 12, 2012
6d15b22
remove yard
grantr Jul 12, 2012
76d9cc1
use faraday for escaping
grantr Jul 12, 2012
2cfc87c
replace patron with faraday
grantr Jul 12, 2012
00cee85
add exception messages to re-raises in non-standard transports
grantr Jul 12, 2012
a5fd699
remove reference to patron in comments
grantr Jul 12, 2012
551dd86
use attr_accessor for current_server
grantr Jul 12, 2012
61983d8
add connection accessor to client
grantr Jul 12, 2012
10c102a
rename @server_list to @servers
grantr Jul 12, 2012
354ff8f
don't override inspect
grantr Jul 12, 2012
e77b5dc
allow transport to be an object
grantr Jul 12, 2012
3aa0e1e
take a connection block for transports that use it
grantr Jul 12, 2012
3ef8b27
update ancient User-Agent string
grantr Jul 12, 2012
196f3de
bump minor version
grantr Jul 12, 2012
1b2ce62
remove yard rake tasks
grantr Jul 12, 2012
fab53c6
use DummyTransport for alternate transport tests
grantr Jul 12, 2012
726b599
update readme to highlight connect block support
grantr Jul 12, 2012
0eeb37c
update todo
grantr Jul 12, 2012
893c0d6
Update readme to mention multi_json and faraday
grantr Jul 12, 2012
d784281
update readme filename in gemspec
grantr Jul 12, 2012
85d9168
Add version to faraday gemspec dependency.
dougal Jul 26, 2012
66d3241
v0.9.1
grantr Jul 26, 2012
3edf06b
update CONTRIBUTORS
grantr Jul 26, 2012
6200030
add code climate badge
grantr Jul 26, 2012
b6248ad
respect the first argument to get_aliases
grantr Aug 2, 2012
390c17c
v0.9.2
grantr Aug 2, 2012
69e704f
don't default to size 10
grantr Aug 3, 2012
d636cd1
v0.9.3
grantr Aug 3, 2012
f33ace5
Fixing issue with ElasticSearch::RetryingClient trying forever and no…
mauricio Sep 8, 2012
0f5d942
adding missing requires to exceptions
mauricio Sep 10, 2012
2d2a075
add require to satisfy travis
grantr Sep 10, 2012
1121d5c
add jruby to travis builds
grantr Sep 10, 2012
147173e
v0.9.4
grantr Sep 10, 2012
c3c4499
use * instead of _all to search all indices
grantr Sep 10, 2012
02d65d9
v0.9.5
grantr Sep 10, 2012
ae347e2
set default index and type in readme
grantr Nov 14, 2012
cfcf0aa
Add ElasticSearch::Api::Pagination#offset
adammck Dec 27, 2012
a745a2d
Add Kaminari support
adammck Dec 27, 2012
13f0be3
v0.9.6
grantr Jan 3, 2013
fa5b511
Headers are not used by Elasticsearch, but may be used by Faraday to …
courtenay Jan 8, 2013
6b31ada
v0.9.7
grantr Jan 9, 2013
91e9d07
add index_exists?
grantr Feb 7, 2013
9495c18
add status to RequestError
grantr Feb 7, 2013
454a28f
use status accessor to detect missing index
grantr Feb 7, 2013
c493452
allow delete_by_query without specifying index or type
grantr Feb 7, 2013
cb6af5c
v0.9.8
grantr Feb 7, 2013
3173dc5
Merge branch 'master' of git://github.com/grantr/rubberband
Mar 25, 2013
ad84995
Minor improvement to index_exists? using correct es api call
Mar 25, 2013
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions lib/elasticsearch/client/admin_index.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,8 @@ module Index
PSEUDO_INDICES = [:all]

def index_exists?(index)
!!index_status(index)
rescue RequestError => e
if e.status == 404
false
else
raise e
end
response = execute(:index_exists, index)
response.status==200 ? true : false
end

def index_status(*args)
Expand Down
5 changes: 5 additions & 0 deletions lib/elasticsearch/transport/base_protocol.rb
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,11 @@ def multi_get(index, type, query, options={})
end

module IndexAdminProtocol

def index_exists(index)
request(:head, {:index => index})
end

def index_status(index_list, options={})
standard_request(:get, {:index => index_list, :op => "_status"})
end
Expand Down