[ 
https://issues.apache.org/jira/browse/SOLR-622?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12616250#action_12616250
 ] 

Shalin Shekhar Mangar commented on SOLR-622:
--------------------------------------------

Hmm. The reload OR build logic cannot work correctly with firstSearcher. We 
cannot rely on the spellCheckIndexDir existing on disk to be a sure sign that 
only a reload is necessary. It may just be an empty directory/index. In fact 
the AbstractLuceneSpellChecker creates a FSDirectory on init which means that 
doing a simple reload may not be enough on startup.

I think we should always call reload on firstSearcher for all spell checkers 
and (only for Solr based spell checkers) call build on newSearcher event. The 
only case where this will be a problem is where an index exists, Solr is 
stopped, spell checker config is added/enabled and Solr is restarted. Now a 
reload is done but we do not have any data in the spell check index. If a 
commit is done or build is called manually, things will take care of themselves.

> SpellCheckComponent should build or load indices on startup and commits
> -----------------------------------------------------------------------
>
>                 Key: SOLR-622
>                 URL: https://issues.apache.org/jira/browse/SOLR-622
>             Project: Solr
>          Issue Type: Improvement
>          Components: spellchecker
>    Affects Versions: 1.3
>            Reporter: Shalin Shekhar Mangar
>            Assignee: Shalin Shekhar Mangar
>            Priority: Minor
>             Fix For: 1.3
>
>
> SpellCheckComponent must be able to build/load spell check index on startup 
> and commits. With SOLR-605, SpellCheckComponent can register an event 
> listener for firstSearcher and newSearcher events and rebuild/reload indices 
> as appropriate.
> * If index uses a FSDirectory and exists on disk then just reload it or else 
> build it on firstSearcher event.
> * If index is built from a Solr field then re-build it on newSearcher event.
> This will help avoid having to add QuerySenderListener in configuration and 
> will not force people to issue build on first query.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to