# Help with JDBC importer for Elasticsearch - can't install it

**URL:** <https://discuss.elastic.co/t/help-with-jdbc-importer-for-elasticsearch-cant-install-it/36895>\
**Category:** Elasticsearch\
**Created:** [December 10, 2015, 3:42pm UTC](https://discuss.elastic.co/t/help-with-jdbc-importer-for-elasticsearch-cant-install-it/36895 "2015-12-10T15:42:07Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marcus\_Silva](https://avatars.discourse-cdn.com/v4/letter/m/c77e96/32.png) [@Marcus\_Silva](https://discuss.elastic.co/u/Marcus_Silva)\
**Post date:** [December 10, 2015, 3:42pm UTC](https://discuss.elastic.co/t/help-with-jdbc-importer-for-elasticsearch-cant-install-it/36895/1 "2015-12-10T15:42:07Z")

</div>

Hi, I want to use [jdbc importer](https://github.com/jprante/elasticsearch-jdbc) to use elastic search on postgresql, but I didn't understand how to install it. I'm having problems with the last 2 steps:

- modify script in the bin directory to your needs (Elasticsearch cluster address)

- run script with a command that starts org.xbib.tools.JDBCImporter with the lib directory on the classpath

I don't know what script the guide is talking about on the last 2 steps, can someone help me? I mean there are loads of scripts inside the bin directory and it doesn't seem obvious to me which one the guide is talking about. Thank you!

---

<div class="post-metadata">

**Author:** ![miracle24](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@miracle24](https://discuss.elastic.co/u/miracle24)\
**Post date:** [December 11, 2015, 3:40am UTC](https://discuss.elastic.co/t/help-with-jdbc-importer-for-elasticsearch-cant-install-it/36895/2 "2015-12-11T03:40:17Z")

</div>

You can refer to the scripts in the bin directory. They are similar to each other.I suggest that you read some about the linux shell programming, which will help you understand it.

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [December 11, 2015, 6:52am UTC](https://discuss.elastic.co/t/help-with-jdbc-importer-for-elasticsearch-cant-install-it/36895/3 "2015-12-11T06:52:42Z")

</div>

Maybe you use Windows.

I do not know Windows at all so there is tiny information about the OS level setup. For Linux/Mac/Solaris OS, shell script setup is a common feature and daily work for admins.

There are some smarter people than me who can describe "Powershell" setup for JDBC importer [http://r2d2.cc/2015/08/05/elastic-search-on-windows-with-mysql-sql-server-2014-and-import-feeder/](http://r2d2.cc/2015/08/05/elastic-search-on-windows-with-mysql-sql-server-2014-and-import-feeder/)

---

<div class="post-metadata">

**Author:** ![Marcus\_Silva](https://avatars.discourse-cdn.com/v4/letter/m/c77e96/32.png) [@Marcus\_Silva](https://discuss.elastic.co/u/Marcus_Silva)\
**Post date:** [December 11, 2015, 1:09pm UTC](https://discuss.elastic.co/t/help-with-jdbc-importer-for-elasticsearch-cant-install-it/36895/4 "2015-12-11T13:09:13Z")

</div>

I got it working, thanks. However, I'm still struggling because I need to  
update elasticsearch everytime I modify a record or insert a new record on  
postgresql. I can't figure out how to do it, I'm already using the schedule  
parameter for polling but it just gets all the records every time not just  
new ones or modified ones, which is what I need after the first run. I  
think I need to use "statefile.json" somehow to do it, but I can't figure  
out how. Would you mind giving me an example or two of how to use the file  
to accomplish what I need? Thank you.

---

<div class="post-metadata">

**Author:** ![Swina\_Allen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/swina_allen/32/6598_2.png) [@Swina\_Allen](https://discuss.elastic.co/u/Swina_Allen)\
**Post date:** [December 13, 2015, 9:02pm UTC](https://discuss.elastic.co/t/help-with-jdbc-importer-for-elasticsearch-cant-install-it/36895/5 "2015-12-13T21:02:41Z")

</div>

Hi,  
I am new here and I am starting developing on ES but I think your can update you index/indices in 2 ways:

- from your web application when a new record is added you can use elasticsearch.js library and the ES API as [you can check here](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-index) in order to add typed JSON document.
- using your scheduled job/batch, depends on how you created it. I tried using a PowerShell batch loading a json file with a query selecting only new records (depends if your db has some way to track new records like flags or datetime of insert) and it worked perfectly.

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [December 13, 2015, 9:38pm UTC](https://discuss.elastic.co/t/help-with-jdbc-importer-for-elasticsearch-cant-install-it/36895/6 "2015-12-13T21:38:18Z")

</div>

It's all in the documentation at

> **[jprante/elasticsearch-jdbc](https://github.com/jprante/elasticsearch-jdbc#how-to-select-incremental-data-from-a-table)**
>
> elasticsearch-jdbc - JDBC importer for Elasticsearch

and

> **[jprante/elasticsearch-jdbc](https://github.com/jprante/elasticsearch-jdbc#persisted-state)**
>
> elasticsearch-jdbc - JDBC importer for Elasticsearch

---

<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:** [July 5, 2017, 11:31pm UTC](https://discuss.elastic.co/t/help-with-jdbc-importer-for-elasticsearch-cant-install-it/36895/7 "2017-07-05T23:31:27Z")

</div>


