setRefresh(boolean) has been removed in favor of setRefreshPolicy(RefreshPolicy) because there are now three options (NONE, IMMEDIATE, and WAIT_FOR). setRefresh(IMMEDIATE) has the same behavior as setRefresh(true) used to have. See setRefreshPolicy's javadoc for more.
1 个回复
elastic_kevin123
赞同来自:
这个问题因为 Elasticsearch 有延迟的关系(好像记得是3秒还是1秒来着)。有的人的做法比如有以下方法解决的。