I like the new forum!
I have a 2 node cluster that I'm using as a primary data store for a web application. Think of a blog with comments.
When a comment is added in the web application, it gets sent to Elastic for indexing. Then to ensure it's available for query, the "save" method runs a search query every 100ms that only matches the updated record (it uses the 'date updated' field). As soon as the search query gets a hit, I assume the record is indexed and I return from the 'save' method.
But I believe I've made an incorrect assumption. What I'm seeing is that as soon as the 'save' method returns, I issue a new search request to "refresh" the comment listing on the blog post, which should include the comment that was just added. 9 times out of 10, it includes the new comment, but occasionally it doesn't. If I wait an additional second and then refresh, the comment shows up.
Is this happening because the 'save' method is hitting one node and the subsequent search that follows after the 'save' method is hitting a different node?
I realize this isn't necessarily what Elastic was "built" for, but is there a recommended way to accomplish what I'm trying to do?