Skip to content
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

Node info endpoint #237

Open
nha opened this issue Aug 11, 2016 · 4 comments
Open

Node info endpoint #237

nha opened this issue Aug 11, 2016 · 4 comments

Comments

@nha
Copy link

nha commented Aug 11, 2016

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.

@KeeganMyers
Copy link
Contributor

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.

@michaelklishin michaelklishin changed the title hello request Node info endpoint Aug 12, 2016
@michaelklishin
Copy link
Member

Feel free to look into a pull request for both. Like everywhere else, we should return immutable Clojure maps and not Java objects ;)

@nha
Copy link
Author

nha commented Aug 22, 2016

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)))

@palash25
Copy link

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? #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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants