Open
Conversation
This commit backports the `SetBasicAuth` option already available in
elastic.v3 into elastic.v2. You can now use `SetBasicAuth("username",
"password")` as an option when setting up a new client (closes #146).
This commit also fixes an issue with the startup healthcheck. We now
use the `http.Client` specified via options in `startupHealthcheck`
instead of setting up our own. The latter would go wrong if the
`http.Client` specified when creating the client is special, e.g. when
it uses HTTP Basic Auth (see #145).
In the normal use case, you create one Client in your application on startup. You then share this Client throughout your application, elastic will automatically mark nodes as healthy or dead etc. However, in restricted environments like App Engine, one cannot create such a shared client. You must create a new client for every request. So we cannot afford to keep Goroutines around and must make the creation of a client as efficient as possible. So if you now create a new client with the sniffer and healthchecker disabled (`SetSniff(false)` and `SetHealthcheck(false)`), the `NewClient` function will skip most of the sanity checks it does on normal startup. It will also not start any Goroutines. So to use elastic with restricted environments like App Engine, be sure to disable sniffer and healthchecker via the options `SetSniff(false)` and `SetHealthcheck(false)`.
In the normal use case, you create one Client in your application on startup. You then share this Client throughout your application, elastic will automatically mark nodes as healthy or dead etc. However, in restricted environments like App Engine, one cannot create such a shared client. You must create a new client for every request. So we cannot afford to keep Goroutines around and must make the creation of a client as efficient as possible. So if you now create a new client with the sniffer and healthchecker disabled (`SetSniff(false)` and `SetHealthcheck(false)`), the `NewClient` function will skip most of the sanity checks it does on normal startup. It will also not start any Goroutines. So to use elastic with restricted environments like App Engine, be sure to disable sniffer and healthchecker via the options `SetSniff(false)` and `SetHealthcheck(false)`.
As Elasticsearch 2.0.0 is released, we must update the README.
As Elasticsearch 2.0.0 is released, we update the README accordingly.
This is a backport of [this commit](e310ae7) in elastic.v3.
This commit changes Update in that a 404 response from ES yields an error from `Update.Do`. See [PR-153](#153).
The Count service was missing a few properties from the REST API. Closes #158.
When using HTTP Basic Authentication e.g. with Shield, not only user requests must be authenticated but also the administrative requests as well (e.g. sniffing and health checks).
Some environments do not allow to send a HTTP GET request with a body.
The official clients have a SetSendGetBodyAs option for this. It
changes HTTP GET requests with a body to the method specified by
SetSendGetBodyAs.
Example:
client, err := elastic.NewClient(elastic.SetSendGetBodyAs("POST"))
Use `elastic.SetGzip(true)` to enable gzip compression of HTTP request/response with Elasticsearch. Notice that you need to enable gzip compression in Elasticsearch first by adding `http.compression: true` to `elasticsearch.yml` (see [docs](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/modules-http.html)).
Close #178
See #179 on GitHub.
Feature/bulk delete request parent
…equest_parent Revert "Feature/bulk delete request parent"
If a node in e.g. a Kubernetes cluster changes, it's `NodeID` keeps the same but its `URL` might not. If we just rely on the `NodeID`, this leads to a node not being accessible (because it uses the old `URL`).
This file contains hidden or 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
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.
No description provided.