-
Notifications
You must be signed in to change notification settings - Fork 37
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
frazerh
wants to merge
73
commits into
grantr:master
Choose a base branch
from
frazerh:index_exists
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
[ci skip]
[ci skip]
[ci skip]
…not URI?): 127.0.0.1:9200")
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
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.
…t respecting the @retries variable
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Possibly the older index_exists? method maybe more backwards compatible.