Q: How to update Lucene Spellchecker indexes without reindexing? I have a Lucene SpellChecker indexing implementation like so:
def buildAutoSuggestIndex(path:Path):SpellChecker = {
    val config = new IndexWriterConfig(new CustomAnalyzer())
    val dictionary = new PlainTextDictionary(path)
    val directory = FSDirectory.open(path.getParent)
    val spellChecker = new SpellChecker(directory)
    val jw = new JaroWinklerDistance()
    jw.setThreshold(jaroWinklerThreshold)

    spellChecker.setStringDistance(new JaroWinklerDistance())
    spellChecker.indexDictionary(dictionary, config, true)

    spellChecker
}

I need to update these Spellchecker dictionaries i.e. reindex new entries, without reindexing the whole index. Is there any way to update SpellChecker indexes?

A: SpellChecker.indexDictionary(...) already avoids reindexing terms right here:
terms: while ((currentTerm = iter.next()) != null) {

  String word = currentTerm.utf8ToString();
  int len = word.length();
  if (len < 3) {
    continue; // too short we bail but "too long" is fine...
  }

  if (!isEmpty) {
    for (TermsEnum te : termsEnums) {
      if (te.seekExact(currentTerm)) {
        continue terms;
      }
    }
  }

  // ok index the word
  Document doc = createDocument(word, getMin(len), getMax(len));
  writer.addDocument(doc);

seelkExact will return false if the term is already contained, and the document with the n-grams for the term is not added (continue terms;).
