# Update Documents SQL - ElasticSearch

**URL:** <https://discuss.elastic.co/t/update-documents-sql-elasticsearch/140480>\
**Category:** Elasticsearch\
**Created:** [July 18, 2018, 8:31am UTC](https://discuss.elastic.co/t/update-documents-sql-elasticsearch/140480 "2018-07-18T08:31:37Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kirtash](https://avatars.discourse-cdn.com/v4/letter/k/a8b319/32.png) [@Kirtash](https://discuss.elastic.co/u/Kirtash)\
**Post date:** [July 18, 2018, 8:31am UTC](https://discuss.elastic.co/t/update-documents-sql-elasticsearch/140480/1 "2018-07-18T08:31:37Z")

</div>

Hi All!

I have a SQL database in my program and I use to view data ElasticSearch and for updates the SQL (I know that in the new version 6.3 i can do queries like SQL), but the problem that I have is that I have update of information using stored procedures but the document of elasticSearch not have these changes.

Do you know any good practice to have updated?

Thanks!

---

<div class="post-metadata">

**Author:** ![Andrei\_Stefan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrei_stefan/32/47533_2.png) [@Andrei\_Stefan](https://discuss.elastic.co/u/Andrei_Stefan)\
**Post date:** [July 19, 2018, 4:56am UTC](https://discuss.elastic.co/t/update-documents-sql-elasticsearch/140480/2 "2018-07-19T04:56:26Z")

</div>

Hi @Kirtash,

I don't think I understand the question.  
You said that you have data in a SQL database and you update that data using stored procedures. But the updates going into your SQL database are not reflected in the Elasticsearch documents?  
How do you look at the data from your SQL database with Elasticsearch?

---

<div class="post-metadata">

**Author:** ![Kirtash](https://avatars.discourse-cdn.com/v4/letter/k/a8b319/32.png) [@Kirtash](https://discuss.elastic.co/u/Kirtash)\
**Post date:** [July 19, 2018, 8:45am UTC](https://discuss.elastic.co/t/update-documents-sql-elasticsearch/140480/3 "2018-07-19T08:45:43Z")

</div>

Hi @Andrei_Stefan!

First of all, sorry for my explanation that is not good. The mainly question is if I can update with SQL directly the register of elasticSearch. Now the update of ElasticSearch is on-demand but i would like can update the data of ElasticSearch everyday using the same SQL or another way to do it.

Thanks!

---

<div class="post-metadata">

**Author:** ![Johnnycc1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/johnnycc1/32/26069_2.png) [@Johnnycc1](https://discuss.elastic.co/u/Johnnycc1)\
**Post date:** [July 19, 2018, 10:42am UTC](https://discuss.elastic.co/t/update-documents-sql-elasticsearch/140480/4 "2018-07-19T10:42:17Z")

</div>

I think most people use logstash or some other app to pull new data from there source system and push into elastic, on a schedule E.g. every 5 minutes. This is best when elastic does not need to be updated in realtime.

The other option is for your app to push to both elastic and the source database.

I would go with the first option if you can.

---

<div class="post-metadata">

**Author:** ![Andrei\_Stefan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrei_stefan/32/47533_2.png) [@Andrei\_Stefan](https://discuss.elastic.co/u/Andrei_Stefan)\
**Post date:** [July 19, 2018, 8:22pm UTC](https://discuss.elastic.co/t/update-documents-sql-elasticsearch/140480/5 "2018-07-19T20:22:30Z")

</div>

@Kirtash,  
At the moment, ES SQL supports only reading the documents. Inserting/updating documents or using stored procedures is not supported.

---

<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:** [August 16, 2018, 8:22pm UTC](https://discuss.elastic.co/t/update-documents-sql-elasticsearch/140480/6 "2018-08-16T20:22:35Z")

</div>

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