When using the new delete-by-query plugin functionality, even when the operation succeeds - it takes time till the result can actually be observed. This is an issue when running unit-tests.
I thought that using the "flush" functionality may be beneficial for that (or maybe "force merge"?) but I could find only a scripting API for this.
What is the Java way to do it?
Actually you want to use the refresh
API, which makes all recent index changes visible to searching. flush
is heavier, forcing an fsync of all written lucene files and clearing of Elasticsearch's transaction logs.
Don't do forceMerge
That's very very heavy and very much overkill here.
Thanks!