elastisch
elastisch copied to clipboard
Node info endpoint
I do not see in the docs (and a quick code scan), a request to get the following request from ES :
http://localhost:9200/
{
"name": "Franz Kafka",
"cluster_name": "elasticsearch_nha",
"version": {
"number": "2.3.4",
"build_hash": "e455fd0c13dceca8dbbdbb1665d068ae55dabe3f",
"build_timestamp": "2016-06-30T11:24:31Z",
"build_snapshot": false,
"lucene_version": "5.5.0"
},
"tagline": "You Know, for Search"
}
It is easy enough to do myself but I thought this could be included in elastisch.
For rest this is (require '[clojurewerkz.elastisch.rest :as er]) (er/get conn "http://localhost:9200")
for native you should be able to use (require ' [clojurewerkz.elastisch.native :as es]) (import '[org.elasticsearch.action.get GetRequest]) (es/get conn (GetRequest. "/" )) which will return an instance of org.elasticsearch.action.support.PlainActionFuture you will have to review java api docs to see how this can be turned into the expected result.
Feel free to look into a pull request for both. Like everywhere else, we should return immutable Clojure maps and not Java objects ;)
For those reading this, I use the following function with the REST api:
(require '[clojurewerkz.elastisch.rest :as esr])
(defn es-info [conn]
(esr/get conn (:uri conn)))
Hi I came to this issue looking for my first beginner clojure issue to solve but I think this has already been solved here right? https://github.com/clojurewerkz/elastisch/pull/68/
shouldn't this be closed? or if there is still some work left with this issue, let me know I would like to take a crack at it.