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

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

wants to merge 73 commits into from

Conversation

frazerh
Copy link

@frazerh frazerh commented Mar 25, 2013

Possibly the older index_exists? method maybe more backwards compatible.

erickt and others added 30 commits March 25, 2013 09:21
This patch lets you pass arbitrary multi_get
queries to elasticsearch. Before this patch, there 
was no way to select the fields to return.
This is helpful on Heroku where server urls include the index.

ElasticSearch.new("http://127.0.0.1:9200/index/type" sets default_index
to "index" and default_type to "type". You can still change them with
the default scope accessors and by passing :index and :type options.

Fixes #31
Bundler 1.1 is the business.
README needs some love! It kinda sucks.
New in this version:

* Compatibility with Heroku ELASTICSEARCH_URL
Will need to switch to http and json abstraction libraries first.
If uri fails to parse, just use the connect string as given.
For testing the thrift transport
This increases platform compatibility and future proofs against better
json libraries than yajl (like oj). Rails is using MultiJson so it isn't
likely to go away.

Both versions of the MultiJson api are supported.

fixes #35
Use rubydoc.info instead
The old rack escape doesn't work with utf8 multibyte strings in ruby
1.9. Relying on Faraday's popularity to take care of that.

If Faraday doesn't work out, Rack's new escape is supposed to be pretty
good.

This commit also removes support for ruby 1.8.6. Faraday only
supports 1.8.7+, so the rubberband dependency is bumped too.
Patron relies on a C extension so it is not compatible with JRuby.
Faraday supports multiple backends so it will work on more platforms.

fixes #36
grantr and others added 30 commits March 25, 2013 09:21
Fixes error when calling previously private methods.
Previously this was ignored. Fixes #39
This overrode :size given in the query. Elasticsearch defaults to
size 10 anyway so there's no need for a default here.
MultiJson and Faraday allow running on JRuby, yay!
Elasticsearch 0.19.9 no longer supports the _all syntax, and * seems to
be supported at least as far back as 0.14.2.
The code doesn't work as given without this. Fixes #43
…define basic auth, so don't override them per request.
Checking for index existence is a common operation, and previously it
was pretty cumbersome.

Instead of getting the status of all indices and checking for the
requested key, this implementation checks for the status of the
requested index only and rescues the missing exception. This saves on
bandwidth if you have a lot of indices.
Response status is the most useful indicator of what went wrong.
Elasticsearch allows delete_by_query across multiple indices and types,
so no need to require scope.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants