Getting Started tutorial errors

Hi,

I'm going through (this Elasticsearch's tutorial)[https://www.elastic.co/guide/en/elasticsearch/reference/current/getting-started-index.html#getting-started-batch-processing] but when I try to run the command to bulk import the accounts.json file, I get the following error:

"type" : "action_request_validation_exception",
        "reason" : "Validation Failed: 1: type is missing;2: type is missing;3: type is missing; (the error is long, and goes up to type 1000 is missing)

I have a cluster up locally, I can check it's health and PUT / GET data from it.

I have tried checking the file format, replacing the file with another one and, most importantly, removing all but one entry from the file, but the error persists.

Can anyone give any suggestions?

Cheers.

What version of Elasticsearch are you using?

Hi warkolm,

Version 6.8.7, installed it with homebrew.

Cheers,

Ok, you should use the 6.8 docs, as there is syntax differences.

This is for 6.8;

curl -H "Content-Type: application/json" -XPOST "localhost:9200/bank/_doc/_bulk?pretty&refresh" --data-binary "@accounts.json"

This is for 7.6 - which is the current version, as per the URL you posted originally;

curl -H "Content-Type: application/json" -XPOST "localhost:9200/bank/_bulk?pretty&refresh" --data-binary "@accounts.json"

1 Like

Thanks! You're absolutely correct, adding the _doc type to the URL solved the issue.

Thanks for your help, warkolm!

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.