Skip to content

Commit

Permalink
Merge pull request #2 from tekkub/master
Browse files Browse the repository at this point in the history
Make Index.create actually work
  • Loading branch information
jonmagic committed Mar 29, 2012
2 parents f502614 + a7b984b commit 8698492
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/elasticsearch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 8698492

Please sign in to comment.