Question: I have an elastic search river setup using the jdbc river plugin, that just does a simple select \* from and indexes that table.

But I would like to be able to trigger the river on demand via the API as well as at a standard time interval, so that I can have it index a document when its inserted into this table.

Anybody know if theres anyway to do this at present? 

i.e. 
`/_river/my_river/_refresh`

Thanks.

Answer: 
I don't see a good way for you to trigger the JDBC River into indexing your specific updated document in real time, and I'm not sure it's meant to be used for that anyways.

Instead of triggering the JDBC river to index your document, why don't you just index the document from the update code?

The JDBC river is a great way to feed in large streams of data, and there is [documentation for maintaining coherency with the polling](https://github.com/jprante/elasticsearch-river-jdbc). but I don't think there is an easy to meet your real time requirement.
It sounds like you are struggling with the classic "[push vs. pull](http://elasticsearch-users.115913.n3.nabble.com/keeping-datastore-and-index-in-sync-Push-Vs-Pull-best-approach-td4032591.html)" indexing problem. Rivers are designed to pull data out of the database at an interval. They're easy to set up, but like all things in computer science, they are a trade-off. Specifically, you lose real-time indexing. A river that you can trigger might be the best of both worlds, or it might inundate your server with a lot of unnecessary traffic (i.e. why do "SELECT \* ..." when you know exactly which document was updated?).

If you have a real-time indexing requirement (like I did), you "push" your updates into Elasticsearch. You just need to write an Elasticsearch client that will deliver your updated records to Elasticsearch as they are saved. FWIW, I solved this problem by firing messages on a service bus, and a service waiting on the other end retrieved the entity from SQL and indexed it. Once you have that infrastructure, it's not a big deal to write a small app to do an initial import of SQL data or create a scheduled job to index data.