1.1.0-beta1 is a development release that has several new features, most notably a native client with the same API as the REST one Elastisch already has.
Changes in 1.1.0-beta1
1.1.0 includes a major new feature: native ElasticSearch client.
The client uses ElasticSearch’s Java API, and can be used with
both transport and node clients.
Native client is more bandwidth efficient. It also can use SMILE (binary JSON format) to be more efficient on the wire.
Native client API in Elastisch is nearly identical to that of the REST API client
and resides in
namespaces (similarly to how
namespaces are organized).
Transport client (used for TCP/remote connections) connections are set up using
clojurewerkz.elastisch.native/connect!. Note that you need to provide node
configuration that at least has cluster name in it:
1 2 3 4 5 6
Cluster name and transport node addresses can be retrieved via HTTP API, for example:
The Native client tries to be as close as possible to the existing REST client API.
For example, document operation functions in
clojurewerkz.elastisch.rest.document function signatures as closely as
1 2 3 4 5 6 7 8 9
The same with returned results. Note, however, that ES transport client does have (very) minor differences with the REST API and it is not always possible for Elastisch to completely cover such differences.
Native client offers a choice of synchronous (blocking calling thread until a response is received) and asynchronous (returns a future) versions of multiple API operations:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
One notable exception to this is administrative operations (such as opening or closing an index). The rationale for this is that they are rarely executed on the hot code path (e.g. in tight loops), so convenience and better error visibility is more important for them.
GH issues: #17, #18, #20.
Note that native ElasticSearch client currently relies on ElasticSearch 0.90.0.Beta1 client libraries and some operations will only work with that version.
Bulk Request Support
Bulk requests are now supported. All the relevant code is in the
namespace. Here is a small example of bulk document indexing using this new API:
1 2 3
Contributed by Davie Moston.
Scroll Queries Support
Scroll queries are now easier to perform thanks to the new
function that takes a scroll id and amount of time retrieved documents and related information
will be kept in memory for future retrieval. They are analogous to database cursors.
A short code example:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Contributed by Davie Moston.
Cheshire dependency has been upgraded to version
clj-http dependency has been upgraded to version
Count API No Longer Ignores Mapping Types
clojurewerkz.elastisch.rest.document/count no longer ignores mapping types.
GH issue: #6.
Count API now uses GET requests
clojurewerkz.elastisch.rest.document/count now correctly uses
GET for requests without
the query part and
POST for request that have it.
GH issue: #5.
Elastisch change log is available on GitHub.
We recommend all users to give 1.1.0-beta1 a try.
Thank You, Contributors
Kudos to Davie Moston and Andrew Jones who contributed to this release.
Elastisch is a ClojureWerkz Project
- Welle, a Riak client with batteries included
- Monger, a Clojure MongoDB client for a more civilized age
- Neocons, a client for the Neo4J REST API
- Langohr, a Clojure client for RabbitMQ that embraces the AMQP 0.9.1 model
- Quartzite, a powerful scheduling library
and several others. If you like Elastisch, you may also like our other projects.