# Bulk upload file data into app search from a json file

**URL:** <https://discuss.elastic.co/t/bulk-upload-file-data-into-app-search-from-a-json-file/264640>\
**Category:** Elastic Search\
**Tags:** elastic-app-search\
**Created:** [February 18, 2021, 2:27am UTC](https://discuss.elastic.co/t/bulk-upload-file-data-into-app-search-from-a-json-file/264640 "2021-02-18T02:27:13Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![pakwai122](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pakwai122/32/84087_2.png) [@pakwai122](https://discuss.elastic.co/u/pakwai122)\
**Post date:** [February 18, 2021, 2:27am UTC](https://discuss.elastic.co/t/bulk-upload-file-data-into-app-search-from-a-json-file/264640/1 "2021-02-18T02:27:13Z")

</div>

I tried to use postman to post over 10 million lines of data into app search, but it returned i/o timeout. Think it's too large to digest in postman, how can I import the data into app search from a json file(3gb)

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [February 18, 2021, 3:42am UTC](https://discuss.elastic.co/t/bulk-upload-file-data-into-app-search-from-a-json-file/264640/2 "2021-02-18T03:42:46Z")

</div>

Welcome!

As far as i can see, you can not load more than 10 mb of data at once. No more than 100 docs per batch. See [Limits | Elastic App Search Documentation [7.11] | Elastic](https://www.elastic.co/guide/en/app-search/current/limits.html)

So you need to split your input into smaller chunks.

If you don't want to do that by yourself you can look at Logstash. It has an output for this:

> **[App Search output plugin | Logstash Reference \[7.11\] | Elastic](https://www.elastic.co/guide/en/logstash/current/plugins-outputs-elastic_app_search.html)**

---

<div class="post-metadata">

**Author:** ![pakwai122](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pakwai122/32/84087_2.png) [@pakwai122](https://discuss.elastic.co/u/pakwai122)\
**Post date:** [February 18, 2021, 5:19am UTC](https://discuss.elastic.co/t/bulk-upload-file-data-into-app-search-from-a-json-file/264640/3 "2021-02-18T05:19:04Z")

</div>

ive read this thread

> [@Bulk upload documents to Site Search from a JSON file](https://discuss.elastic.co/t/bulk-upload-documents-to-site-search-from-a-json-file/205147):
>
> I just wanted to share some code I helped put together for a customer. They had a JSON document of records that they wanted to upload in bulk to Site Search via our API. books.json [{ "id": "1", "title": "Tom Sawyer", "pages": 200 }, { "id": "2", "title": "Catcher in the Rye", "pages": 300 }] The first challenge was converting their JSON file to a format that Site Search requires. We came up with the following: convert.js var FILE\_NAME = "books.json"; var…

It looks similar to my use case, so wonder does it work on app search too

---

<div class="post-metadata">

**Author:** ![ross.bell](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ross.bell/32/77559_2.png) [@ross.bell](https://discuss.elastic.co/u/ross.bell)\
**Post date:** [February 18, 2021, 4:17pm UTC](https://discuss.elastic.co/t/bulk-upload-file-data-into-app-search-from-a-json-file/264640/4 "2021-02-18T16:17:23Z")

</div>

Hey pakwai122,

Elastic App Search and Site Search are two distinct products with unique APIs. Assuming you're referring to Elastic App Search in your original question, you'll have to follow the App Search specific documentation. The post you linked to is for Site Search. In addition to the _limits_ documentation posted by @dadoonet, this is probably a good place to start: [Documents API | Elastic App Search Documentation [7.11] | Elastic](https://www.elastic.co/guide/en/app-search/current/documents.html#documents-create).

I hope that helps!

Ross

---

<div class="post-metadata">

**Author:** ![JasonStoltz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasonstoltz/32/49893_2.png) [@JasonStoltz](https://discuss.elastic.co/u/JasonStoltz)\
**Post date:** [February 25, 2021, 12:41pm UTC](https://discuss.elastic.co/t/bulk-upload-file-data-into-app-search-from-a-json-file/264640/5 "2021-02-25T12:41:45Z")

</div>

I shared this with @pakwai122 directly first to confirm that this works, so thought I would share here as well for posterity.

Here is a gist for a little node script you can use from the command line to upload documents from a json file to app search: [App Search CLI · GitHub](https://gist.github.com/JasonStoltz/41b29e71310743e94275fc02fac33095). This is not something officially supported by Elastic, just something that I cooked up.

Download it, give it executable permissions, then run it with a command like the following, replacing the path to the json file, the location of your running app search api, your engine name, and a private key:

```auto
app-search-cli upload ~/Documents/pokemon.json http://localhost:3002 test-engine private-kayik65qbd516q1brk724aaa

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 25, 2021, 12:42pm UTC](https://discuss.elastic.co/t/bulk-upload-file-data-into-app-search-from-a-json-file/264640/6 "2021-03-25T12:42:15Z")

</div>

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