This commit is contained in:
kimchy 2011-01-30 16:30:17 +02:00
parent 2820988171
commit 8884b575c1
2 changed files with 4 additions and 2 deletions

View File

@ -30,7 +30,8 @@ import org.elasticsearch.index.IndexComponent;
public interface BloomCache extends IndexComponent, CloseableComponent { public interface BloomCache extends IndexComponent, CloseableComponent {
/** /**
* *Async* loads a bloom filter for the field name. * *Async* loads a bloom filter for the field name. Note, this one only supports
* for fields that have a single term per doc.
*/ */
BloomFilter filter(IndexReader reader, String fieldName, boolean asyncLoad); BloomFilter filter(IndexReader reader, String fieldName, boolean asyncLoad);

View File

@ -579,7 +579,8 @@ public class InternalIndexShard extends AbstractIndexShardComponent implements I
} }
} }
// since we can do async merging, it will not be called explicitly when indexing (adding / deleting docs), and only when flushing // since we can do async merging, it will not be called explicitly when indexing (adding / deleting docs), and only when flushing
// so, make sure we periodically call it // so, make sure we periodically call it, this need to be a small enough value so mergine will actually
// happen and reduce the number of segments
TimeValue optimizeInterval = indexSettings.getAsTime("index.merge.async_interval", TimeValue.timeValueSeconds(1)); TimeValue optimizeInterval = indexSettings.getAsTime("index.merge.async_interval", TimeValue.timeValueSeconds(1));
if (optimizeInterval.millis() > 0) { if (optimizeInterval.millis() > 0) {
optimizeScheduleFuture = threadPool.scheduleWithFixedDelay(new EngineOptimizer(), optimizeInterval); optimizeScheduleFuture = threadPool.scheduleWithFixedDelay(new EngineOptimizer(), optimizeInterval);