Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Make Index.create actually work #2

Merged
merged 1 commit into from

2 participants

@tekkub

Lookie, it works now!

@jonmagic jonmagic merged commit 8698492 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 29, 2012
  1. @tekkub

    Make Index.create actually work

    tekkub authored
This page is out of date. Refresh to see the latest.
Showing with 4 additions and 3 deletions.
  1. +4 −3 lib/elasticsearch.rb
View
7 lib/elasticsearch.rb
@@ -183,17 +183,18 @@ def remove_by_query(types, options)
# Create a new index in elasticsearch
#
# name - the name of the index to be created
+ # server - URL of the server to create the index on
# create_options - a hash of index creation options
#
# Returns a new ElasticSearch::Index instance
- def self.create(name, create_options={})
- conn = ElasticSearch.get_connection
+ def self.create(name, server, create_options={})
+ conn = ElasticSearch.get_connection(server)
conn.put do |req|
req.url "/#{name}"
req.body = create_options
end
- new(name)
+ new(name, server)
end
end
end
Something went wrong with that request. Please try again.