It looks like you're struggling with the classic push vs. issue pull ". Rivers are designed to output data from the database at intervals. They are easy to configure, but like everything else in computer science, they are a compromise. In particular, you lose real-time indexing. The river you can run may be the best from both worlds, or it can fill your server with a lot of unnecessary traffic (for example, why "SELECT * ..." when you know exactly which document was updated?).
If you have a requirement for real-time indexing (like me), you "push" your updates in 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 issuing messages on the service bus, and the service waiting on the other end retrieved the entity from SQL and indexed it. Once you have this infrastructure, you do not need to write a small application to complete the initial import of SQL data or to create a scheduled task to index the data.
source share