lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jonathan Lee <>
Subject Re: spellchecker problems (bugs)
Date Wed, 23 Jul 2008 10:43:25 GMT
I ran into a similar issue and found that I am able to get around it by:

1. Similar to what will do,
issue a spellcheck.reload=true command on the firstSearcher event to read
any existing index off disk. Here are the relevant parts of my

  <listener event="firstSearcher" class="solr.QuerySenderListener">
    <arr name="queries">
        <str name="qt">myHandler</str>
        <str name="q">*:*</str>
        <str name="rows">0</str>
        <str name="spellcheck">true</str>
        <str name="spellcheck.reload">true</str>
  <requestHandler name="myHandler" ...>
    <arr name="last-components">
  <searchComponent name="spellcheck" class="...SpellCheckComponent">
    <lst name="spellchecker">
      <str name="name">default</str>
      <str name="field">name_spell</str>
    <str name="queryAnalyzerFieldType">text_spell</str>

2. I believe there is a bug in IndexBased- and
where the analyzer variable is only set on the build command. Therefore,
when the index is reloaded, but not built after starting solr, issuing a
query with the spellcheck.q parameter will cause a NullPointerException to
be thrown ( Moving the analyzer logic to the
constructor seems to fix the problem.

I did not see a jira ticket for this (nor am I sure it's a real bug :), so I
have attached a patch with these changes. Please let me know if I have
overlooked something here and if I should attach this to an actual ticket.


> From: Geoffrey Young <>
> Reply-To: <>
> Date: Tue, 22 Jul 2008 11:07:41 -0400
> To: <>
> Subject: Re: spellchecker problems (bugs)
> Shalin Shekhar Mangar wrote:
>> The problems you described in the spellchecker are noted in
>> -- I shall create an issue to
>> synchronize so that the index is not corrupted.
> I'd like to discuss this a little...
> I'm not sure that I want to rebuild the spelling index each time the
> underlying data index changes - the process takes very long and my
> updates are frequent changes to non-spelling related data.
> what I'd really like is for a change to my index to not cause an
> exception.  IIRC the "old" way of using a spellchecker didn't work like
> this at all - I could completely rm data/index and leave data/spell in
> place, add new data, not issue cmd=build and the spelling parts still
> worked just fine (albeit with old data).
> not to say that SOLR-622 isn't a good idea (it is) but I don't really
> think the entire solution is keeping the spellcheck index in sync.  do
> they need to be kept in sync for things not to implode on me?
> --Geoff

  • Unnamed multipart/mixed (inline, None, 0 bytes)
View raw message