Skip to content

Instantly share code, notes, and snippets.

@nz
Created November 19, 2012 23:09
Show Gist options
  • Save nz/4114708 to your computer and use it in GitHub Desktop.
Save nz/4114708 to your computer and use it in GitHub Desktop.
require 'net/http'
require 'elastictastic'
class Rubygem
include Elastictastic::Document
field :id, type: 'string'
field :version, type: 'string'
field :name, type: 'string'
end
Elastictastic.bulk do
rg = Rubygem.new(id: 'rails-1.0.0', name: 'rails', version: '1.0.0')
rg.save
end
/Users/nick/Desktop/et-error/.bundle/gems/ruby/1.9.1/gems/elastictastic-0.10.4/lib/elastictastic/middleware.rb:75:in `raise_error': input string: "1.0.0" (Elastictastic::ServerError::For)
from /Users/nick/Desktop/et-error/.bundle/gems/ruby/1.9.1/gems/elastictastic-0.10.4/lib/elastictastic/middleware.rb:63:in `block in request'
from /Users/nick/Desktop/et-error/.bundle/gems/ruby/1.9.1/gems/elastictastic-0.10.4/lib/elastictastic/middleware.rb:57:in `tap'
from /Users/nick/Desktop/et-error/.bundle/gems/ruby/1.9.1/gems/elastictastic-0.10.4/lib/elastictastic/middleware.rb:57:in `request'
from /Users/nick/Desktop/et-error/.bundle/gems/ruby/1.9.1/gems/elastictastic-0.10.4/lib/elastictastic/transport_methods.rb:14:in `post'
from /Users/nick/Desktop/et-error/.bundle/gems/ruby/1.9.1/gems/elastictastic-0.10.4/lib/elastictastic/client.rb:58:in `bulk'
from /Users/nick/Desktop/et-error/.bundle/gems/ruby/1.9.1/gems/elastictastic-0.10.4/lib/elastictastic/bulk_persistence_strategy.rb:84:in `flush'
from /Users/nick/Desktop/et-error/.bundle/gems/ruby/1.9.1/gems/elastictastic-0.10.4/lib/elastictastic.rb:158:in `bulk'
from ./repro.rb:12:in `<main>'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment