-
Notifications
You must be signed in to change notification settings - Fork 135
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
Elastisch should use actionGet not get #54
Comments
Also, to be specific, the methods I'm specifically referring to are clojurewerkz.elastisch.native.document/create and clojurewerkz.elastisch.native.document/put |
OK, makes sense. Feel free to submit a pull request! |
To ensure we throw elasticsearch exceptions vs ExecutionExceptions See https://github.com/elasticsearch/elasticsearch/blob/master/src/main/java/org/elasticsearch/action/support/AdapterActionFuture.java for more on this method See also clojurewerkz#54
@michaelklishin see #57 for an initial pass at this. Everything works, but I didn't add any tests specific to this. I'm honestly a little conflicted about how to do that / if it should be. The correct behavior to test is that the proper exceptions get thrown in some situations (like version errors). But there's places all over that were switched to actionGet, and testing all of them seems a bit off. And at that point it's kind of just testing that the method elastisch is calling is the method ES generally recommends for this these days. So long story short, in my head I was able to justify not adding additional tests to myself. If you disagree, feel free to say so, and I'll try thinking it through again. |
LGTM. There is no need to test all actions, pick a couple of common cases (e.g. when an index does not exist) and add tests for them. Thank you! |
Cool. I'll test this indirectly as part of #56, since the proper versioning exception is only thrown with the actionGet call |
In one of our apps, we've built our own elastic search client, that we've recently been attempting to replace with elastisch. Overall this has gone pretty well, but we've had a couple issues.
The most recent one is we are handling some errors elastic search throws in our code, and seeing different behavior now that we have moved to elastisch. After digging through things a bit, it seems to be caused by elastisch doing:
versus
While this normally isn't noticeable, the primary reason actionGet exists is to wrap the exceptions that happen, and make sure elasticsearch variants get thrown, so for those of us that care about the exceptions, it'd be preferential to use actionGet.
This is also why most examples on the web are using actionGet.
Unless there was a specific reason elastisch uses get, I'd be happy to send a PR fixing this, but wanted to check first.
For reference, actionGet is implemented in https://github.com/elasticsearch/elasticsearch/blob/master/src/main/java/org/elasticsearch/action/support/AdapterActionFuture.java
The text was updated successfully, but these errors were encountered: