Skip to content

Commit

Permalink
Remove 'term_index_interval' and 'term_index_divisor'
Browse files Browse the repository at this point in the history
These settings are no longer relevant since they are codec /
postingsformat level settings since Lucene 4.0

Closes #3912
  • Loading branch information
s1monw committed Dec 10, 2013
1 parent 666e3d1 commit 3132b99
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 49 deletions.
18 changes: 0 additions & 18 deletions docs/reference/index-modules.asciidoc
Expand Up @@ -36,24 +36,6 @@ otherwise it is written in non-compound format. added[0.90.2]
in compound format or non-compound format? Defaults to `true`.
added[0.90.4]. This is a dynamic setting. added[0.90.6,Previously not dynamic]

`index.term_index_interval`::

Set the interval between indexed terms.
Large values cause less memory to be used by a reader / searcher, but
slow random-access to terms. Small values cause more memory to be used
by a reader / searcher, and speed random-access to terms. Defaults to
`128`.

`index.term_index_divisor`::
Subsamples which indexed terms are loaded
into RAM. This has the same effect as `index.term_index_interval` except
that setting must be done at indexing time while this setting can be set
per reader / searcher. When set to N, then one in every
N*termIndexInterval terms in the index is loaded into memory. By setting
this to a value > 1 you can reduce memory usage, at the expense of
higher latency when loading a TermInfo. The default value is 1. Set this
to -1 to skip loading the terms index entirely.

`index.refresh_interval`::
A time setting controlling how often the
refresh operation will be executed. Defaults to `1s`. Can be set to `-1`
Expand Down
6 changes: 0 additions & 6 deletions docs/reference/indices/update-settings.asciidoc
Expand Up @@ -53,12 +53,6 @@ settings API:
`index.refresh_interval`::
The async refresh interval of a shard.

`index.term_index_interval`::
The Lucene index term interval. Only applies to newly created docs.

`index.term_index_divisor`::
The Lucene reader term index divisor.

`index.index_concurrency`::
Defaults to `8`.

Expand Down
Expand Up @@ -89,8 +89,6 @@
public class RobinEngine extends AbstractIndexShardComponent implements Engine {

private volatile ByteSizeValue indexingBufferSize;
private volatile int termIndexInterval;
private volatile int termIndexDivisor;
private volatile int indexConcurrency;
private volatile boolean compoundOnFlush = true;

Expand Down Expand Up @@ -170,8 +168,6 @@ public RobinEngine(ShardId shardId, @IndexSettings Settings indexSettings, Threa

this.gcDeletesInMillis = indexSettings.getAsTime(INDEX_GC_DELETES, TimeValue.timeValueSeconds(60)).millis();
this.indexingBufferSize = componentSettings.getAsBytesSize("index_buffer_size", new ByteSizeValue(64, ByteSizeUnit.MB)); // not really important, as it is set by the IndexingMemory manager
this.termIndexInterval = indexSettings.getAsInt(INDEX_TERM_INDEX_INTERVAL, IndexWriterConfig.DEFAULT_TERM_INDEX_INTERVAL);
this.termIndexDivisor = indexSettings.getAsInt(INDEX_TERM_INDEX_DIVISOR, 1); // IndexReader#DEFAULT_TERMS_INDEX_DIVISOR
this.codecName = indexSettings.get(INDEX_CODEC, "default");

this.threadPool = threadPool;
Expand Down Expand Up @@ -1410,8 +1406,6 @@ private IndexWriter createWriter() throws IOException {
config.setMergePolicy(mergePolicyProvider.newMergePolicy());
config.setSimilarity(similarityService.similarity());
config.setRAMBufferSizeMB(indexingBufferSize.mbFrac());
config.setTermIndexInterval(termIndexInterval);
config.setReaderTermsIndexDivisor(termIndexDivisor);
config.setMaxThreadStates(indexConcurrency);
config.setCodec(codecService.codec(codecName));
/* We set this timeout to a highish value to work around
Expand Down Expand Up @@ -1451,8 +1445,6 @@ public void warm(AtomicReader reader) throws IOException {
}
}

public static final String INDEX_TERM_INDEX_INTERVAL = "index.term_index_interval";
public static final String INDEX_TERM_INDEX_DIVISOR = "index.term_index_divisor";
public static final String INDEX_INDEX_CONCURRENCY = "index.index_concurrency";
public static final String INDEX_COMPOUND_ON_FLUSH = "index.compound_on_flush";
public static final String INDEX_GC_DELETES = "index.gc_deletes";
Expand All @@ -1475,27 +1467,13 @@ public void onRefreshSettings(Settings settings) {
indexWriter.getConfig().setUseCompoundFile(compoundOnFlush);
}

int termIndexInterval = settings.getAsInt(INDEX_TERM_INDEX_INTERVAL, RobinEngine.this.termIndexInterval);
int termIndexDivisor = settings.getAsInt(INDEX_TERM_INDEX_DIVISOR, RobinEngine.this.termIndexDivisor); // IndexReader#DEFAULT_TERMS_INDEX_DIVISOR
int indexConcurrency = settings.getAsInt(INDEX_INDEX_CONCURRENCY, RobinEngine.this.indexConcurrency);
boolean failOnMergeFailure = settings.getAsBoolean(INDEX_FAIL_ON_MERGE_FAILURE, RobinEngine.this.failOnMergeFailure);
String codecName = settings.get(INDEX_CODEC, RobinEngine.this.codecName);
boolean requiresFlushing = false;
if (termIndexInterval != RobinEngine.this.termIndexInterval || termIndexDivisor != RobinEngine.this.termIndexDivisor || indexConcurrency != RobinEngine.this.indexConcurrency || !codecName.equals(RobinEngine.this.codecName) || failOnMergeFailure != RobinEngine.this.failOnMergeFailure) {
if (indexConcurrency != RobinEngine.this.indexConcurrency || !codecName.equals(RobinEngine.this.codecName) || failOnMergeFailure != RobinEngine.this.failOnMergeFailure) {
rwl.readLock().lock();
try {
if (termIndexInterval != RobinEngine.this.termIndexInterval) {
logger.info("updating index.term_index_interval from [{}] to [{}]", RobinEngine.this.termIndexInterval, termIndexInterval);
RobinEngine.this.termIndexInterval = termIndexInterval;
indexWriter.getConfig().setTermIndexInterval(termIndexInterval);
}
if (termIndexDivisor != RobinEngine.this.termIndexDivisor) {
logger.info("updating index.term_index_divisor from [{}] to [{}]", RobinEngine.this.termIndexDivisor, termIndexDivisor);
RobinEngine.this.termIndexDivisor = termIndexDivisor;
indexWriter.getConfig().setReaderTermsIndexDivisor(termIndexDivisor);
// we want to apply this right now for readers, even "current" ones
requiresFlushing = true;
}
if (indexConcurrency != RobinEngine.this.indexConcurrency) {
logger.info("updating index.index_concurrency from [{}] to [{}]", RobinEngine.this.indexConcurrency, indexConcurrency);
RobinEngine.this.indexConcurrency = indexConcurrency;
Expand Down
Expand Up @@ -77,8 +77,6 @@ public IndexDynamicSettingsModule() {
indexDynamicSettings.addDynamicSetting(LogDocMergePolicyProvider.INDEX_MERGE_POLICY_MAX_MERGE_DOCS, Validator.POSITIVE_INTEGER);
indexDynamicSettings.addDynamicSetting(LogDocMergePolicyProvider.INDEX_MERGE_POLICY_MERGE_FACTOR, Validator.INTEGER_GTE_2);
indexDynamicSettings.addDynamicSetting(LogDocMergePolicyProvider.INDEX_COMPOUND_FORMAT);
indexDynamicSettings.addDynamicSetting(RobinEngine.INDEX_TERM_INDEX_INTERVAL, Validator.POSITIVE_INTEGER);
indexDynamicSettings.addDynamicSetting(RobinEngine.INDEX_TERM_INDEX_DIVISOR, Validator.POSITIVE_INTEGER);
indexDynamicSettings.addDynamicSetting(RobinEngine.INDEX_INDEX_CONCURRENCY, Validator.NON_NEGATIVE_INTEGER);
indexDynamicSettings.addDynamicSetting(RobinEngine.INDEX_COMPOUND_ON_FLUSH, Validator.BOOLEAN);
indexDynamicSettings.addDynamicSetting(RobinEngine.INDEX_GC_DELETES, Validator.TIME);
Expand Down

0 comments on commit 3132b99

Please sign in to comment.