Permalink
Browse files

Merge pull request #4 from fetep/feature/node_name

allow specifying node_name to ElasticSearch::Client
  • Loading branch information...
2 parents efcd60a + 89a45ee commit 654232232a8b2733193299a923b9fb7c59b487a1 @jordansissel committed Jul 5, 2012
Showing with 10 additions and 1 deletion.
  1. +4 −0 CHANGELIST
  2. +1 −1 jruby-elasticsearch.gemspec
  3. +5 −0 lib/jruby-elasticsearch/client.rb
View
4 CHANGELIST
@@ -1,3 +1,7 @@
+0.0.14 (2012-??-??)
+ * Allow setting the ES node name by passing :node_name
+ to ElasticSearch::Client.
+
0.0.13 (2012-05-28)
* Support ElasticSearch 0.19.x
View
2 jruby-elasticsearch.gemspec
@@ -6,7 +6,7 @@ Gem::Specification.new do |spec|
end
spec.name = "jruby-elasticsearch"
- spec.version = "0.0.13"
+ spec.version = "0.0.14"
spec.summary = "JRuby API for ElasticSearch using the native ES Java API"
spec.description = "..."
spec.license = "Apache License (2.0)"
View
5 lib/jruby-elasticsearch/client.rb
@@ -13,6 +13,7 @@ class ElasticSearch::Client
# :host => "hostname" - the hostname to connect to.
# :port => 9200 - the port to connect to
# :cluster => "clustername" - the cluster name to use
+ # :node_name => "node_name" - the node name to use when joining the cluster
def initialize(options={})
builder = org.elasticsearch.node.NodeBuilder.nodeBuilder
builder.client(true)
@@ -40,6 +41,10 @@ def initialize(options={})
builder.settings.put('network.host', options[:bind_host])
end
+ if options[:node_name]
+ builder.settings.put('node.name', options[:node_name])
+ end
+
if !options[:cluster].nil?
builder.clusterName(options[:cluster])
end

0 comments on commit 6542322

Please sign in to comment.