From 016bcdfa3a48df642b627acef2aef622594bb068 Mon Sep 17 00:00:00 2001 From: Shay Banon Date: Fri, 12 Aug 2011 13:01:11 +0300 Subject: [PATCH] also flush before optimize, just to optimize all the changes up until now --- .../java/org/elasticsearch/index/engine/robin/RobinEngine.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/index/engine/robin/RobinEngine.java b/modules/elasticsearch/src/main/java/org/elasticsearch/index/engine/robin/RobinEngine.java index a2a5bb423ff..756b5c4c202 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/index/engine/robin/RobinEngine.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/index/engine/robin/RobinEngine.java @@ -913,6 +913,9 @@ public class RobinEngine extends AbstractIndexShardComponent implements Engine { } @Override public void optimize(Optimize optimize) throws EngineException { + if (optimize.flush()) { + flush(new Flush()); + } if (optimizeMutex.compareAndSet(false, true)) { rwl.readLock().lock(); try {