-
Notifications
You must be signed in to change notification settings - Fork 726
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Easy way to bulk index a JSON Document? #401
Comments
The |
Missed the last paragraph of your issue, but there is not a bulk api that is only for indexing. There are some extensions for the client though, maybe someone has written one that will index all of the documents that flow through a stream? Or maybe you should give it a shot 😸 |
Finally, you can omit the |
Just for reference, created a small utility for myself to bulk index documents without the action description item here. It just inserts |
Awesome @samechikson, plan to publish it to npm? I'd be happy to link to it from the docs if you're interested. |
Hey @spalger, yeah absolutely. Thanks! Here's the link |
Hi @spalger and @samechikson |
Hi @adilld , es-json-load loads a normal JSON array directly into Elasticsearch. It does not generate a file which you can then use with the bulk API, which is what you seem to want to do. In terms of usage, if you install it globally from npm (
Make sense? |
@samechikson Thank you for your quick response. |
@adilld Sounds like you're trying pipe data into ES, so consider using Logstash which is a dedicated tool written by Elastic for this. You can use CSV files directly. If you are to use es-json-load, transforming a CSV file into a JSON file should work. Just make sure that the JSON file that you use is a JSON Array of objects. This would look something like |
Hi, is there an easy way to bulk index a normal JSON document rather than formatting data to look like
as is shown in the elasticsearch-jsAPI Docs?
So basically I'm trying to omit the action description object, so my body would look like
I don't mind the _id being auto generated (unless that has some negative consequences that I'm not aware of). I thought the bulk method also takes in the index and type in the parameters so it seems redundant to specify those for each document if you're just indexing one type in one index. I guess you do still need the action verb, but it would be nice if you could specify that in the parameters as well.
I feel like a lot of JSON data out there doesn't have the action description object, and so would have to be added after, which seems like a painful task. What are people doing when they have to index lots of documents at once?
The text was updated successfully, but these errors were encountered: