clojurewerkz.elastisch.native.response/ok? predicate for clojurewerkz.elastisch.native.document/create result?

7 views
Skip to first unread message

Dave Tenny

unread,
Oct 19, 2015, 1:11:50 PM10/19/15
to clojure-elasticsearch
I'm using [clojurewerkz/elastisch "2.2.0-beta4"]
and creating documents with clojurewerkz.elastisch.native.document/create.

The returned value of the function might look like:

{:index de_index, :_index de_index, :id AVCA_026N_atHsG1D7qJ, :_id AVCA_026N_atHsG1D7qJ, :type de-logins, :_type de-logins, :version 1, :_version 1}


I may have missed it, but I don't see any predicates in the response namespace that look like they're designed to validate a successful create operation.
Or should I just assume an exception is raised on failed create activity?

Michael Klishin

unread,
Oct 19, 2015, 3:17:54 PM10/19/15
to Dave Tenny, clojure-el...@googlegroups.com
On 19 Oct 2015 at 20:11:51, Dave Tenny (dave....@gmail.com) wrote:
> The returned value of the function might look like:
>
> {:index de_index, :_index de_index, :id AVCA_026N_atHsG1D7qJ,
> :_id AVCA_026N_atHsG1D7qJ, :type de-logins,:_type de-logins,
> :version 1, :_version 1}
>
> I may have missed it, but I don't see any predicates in the response
> namespace that look like they're designed to validate a successful
> create operation.
> Or should I just assume an exception is raised on failed create
> activity?

http://clojureelasticsearch.info/articles/querying.html
https://github.com/clojurewerkz/elastisch/blob/master/src/clojurewerkz/elastisch/native/response.clj

Native client also throws exceptions on certain failures and it’s not really possible
to unify that with the HTTP one. 
--
@michaelklishin, github.com/michaelklishin
Reply all
Reply to author
Forward
0 new messages