: postCommit/postOptimize callbacks happen after commit/optimize but before a
: new searcher is opened. Therefore, it is not possible to re-build spellcheck
: index on those events without opening a IndexReader directly on the solr

FWIW: I believe it has to work that way because postCommit events might 
modify the index. (but i'm just guessing)

: index. That is why the event listener in SpellCheckComponent uses the
: newSearcher listener to build on commits.
: 
: I don't think there is anything in the API currently to do what Jason wants.

couldn't the Listener's newSearcher() method just do something like 
this...

if (rebuildOnlyAfterOptimize && 
    ! (newSearcher.getReader().isOptimized() && 
       ! oldSearcher.getReader().isOptimized()) {
  return;
} else {
  // current impl
}

...assuming a new "rebuildOnlyAfterOptimize" option was added?

-Hoss

Reply via email to