R
R
Roman Mirilaczvili2021-11-11 12:57:43
linux
Roman Mirilaczvili, 2021-11-11 12:57:43

How to import dataset of 30k documents into ElasticSearch?

Using curl, I import 30k documents in a file of the format described in the documentation .
Gives out a code

HTTP/1.1 413 Request Entity Too Large
content-length: 0

There are documents in the size of 6KB. Perhaps there are more.

I import with a team
curl -i -X POST localhost:9200/_bulk -H "Content-Type: application/x-ndjson" --data-binary @dataset-bulk-30k.ndjson


Need to split a file into parts? Please tell me the best way to do this with curl.

PS
And the only document in the same format imports without problems.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman Mirilaczvili, 2021-11-11
@2ord

Imported like this. Maybe someone has a better option - I'll be glad to know.

split --verbose -l1000 dataset-bulk-30k.ndjson bulk.

for f in bulk.??; do echo $f; curl -i -X POST localhost:9200/_bulk -H "Content-Type: application/x-ndjson" --data-binary @$f; done

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question