Real time data ..flush?

Hello,
I am new to elastic, We are working on a scenario to pull the data using JDBC connection, every time we wanted to insert the new set of data to elastic instead of cumulative data update . Can you please advise what is the best way to achieve this. we tried flush option but it is not working.

What exactly is the problem?