Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 1902d9ecf0
Fetching contributors…

Cannot retrieve contributors at this time

15 lines (12 sloc) 0.617 kb
(ns esperanto.client
(:use [clojure.walk :only [stringify-keys]])
(:import (org.elasticsearch.common.settings ImmutableSettings)
(org.elasticsearch.common.transport InetSocketTransportAddress)
(org.elasticsearch.client.transport TransportClient)))
(defn make-transport-client [{:keys [host port cluster] :as settings}]
(let [s (doto (ImmutableSettings/settingsBuilder)
(.put "cluster.name" cluster)
(.put (or (stringify-keys settings) {})))]
(doto (TransportClient. s)
(.addTransportAddress
(InetSocketTransportAddress. host (Integer. port))))))
Jump to Line
Something went wrong with that request. Please try again.