Skip to content

Commit

Permalink
Doc strings
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelklishin committed Apr 2, 2012
1 parent 567b3cb commit 62310f3
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/clojurewerkz/elastisch/rest.clj
Expand Up @@ -108,12 +108,17 @@
(join slash [(base) index-name index-type "_refresh"])))


;;
;; API
;;

(defn connect
"Connects with ElasticSearch endpoint and performs discovery"
[uri]
(let [response (get uri)]
(ElasticSearchEndpoint. uri
(:number (:version response)))))
(ElasticSearchEndpoint. uri (get-in response [:version :number]))))

(defn connect!
"Alters default ElasticSearch connection endpoint"
[uri]
(alter-var-root (var *endpoint*) (constantly (connect uri))))

0 comments on commit 62310f3

Please sign in to comment.