On Fri, Sep 26, 2008 at 12:43 AM, Grant Ingersoll <[EMAIL PROTECTED]>wrote:
> > On Sep 25, 2008, at 2:17 PM, Jason Rennie wrote: > > I see that there's an option to automatically rebuild the spelling index >> on >> a commit. That's a nice feature that we'll consider using, but we run >> commits every few thousand document updates, which would yield ~100 >> spelling >> index rebuilds a day. OTOH, we run an optimize about once/day which seems >> like a more appropriate schedule for rebuilding the spelling index. >> >> Is there or could there be an option to rebuild the spelling index on >> optimize? >> > > Seems reasonable, could almost do it via the postOptimize call back already > in the config, except the SpellCheckComponent's EvenListener is private > static and has an empty postCommit implementation (which is what is called > after optimization, since it is just like a commit in many ways) > > Thus, a patch would be needed. > 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 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. -- Regards, Shalin Shekhar Mangar.