When attempting to import data from a model into elasticsearch I am faced with this error:
[2] pry(main)> Article.import
Article Load (8.8ms) SELECT "articles".* FROM "articles" ORDER BY "articles"."id" ASC LIMIT $1 [["LIMIT", 1000]]
Elasticsearch::Transport::Transport::Errors::BadRequest: [400] {"error":{"root_cause":[{"type":"action_request_validation_exception","reason":"Validation Failed: 1: type is missing;2: type is missing;"}],"type":"action_request_validation_exception","reason":"Validation Failed: 1: type is missing;2: type is missing;"},"status":400}
from /Users/mattsluis/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/elasticsearch-transport-7.3.0/lib/elasticsearch/transport/transport/base.rb:206:in `__raise_transport_error'
Any ideas where the issue may lie?
The solution in my case:
I was (accidently) using the v7 gem but using an elasticsearch v6 instance.
gem 'elasticsearch-model', '~> 6'
gem 'elasticsearch-rails', '~> 6'
Sticking with the corresponding version works :)
Most helpful comment
The solution in my case:
I was (accidently) using the v7 gem but using an elasticsearch v6 instance.
Sticking with the corresponding version works :)