You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Min L <mi...@gmail.com> on 2014/12/05 20:07:14 UTC

unable to build spellcheck in solr

Hi all:

My code using solr spellchecker to suggest keywords worked fine locally,
however in qa solr env, it failed to build it with the following error in
solr log:

ERROR Suggester Store Lookup build from index on field: myfieldname failed
reader has: xxx docs

I checked the solr directory and the file fst.bin was created successfully
though. Does anyone know what caused the issue?

command to build:
http://xxxx:8080/solr/mycore/suggestkeyword?spellcheck.build=true

Thanks a lot!

Re: unable to build spellcheck in solr

Posted by Erick Erickson <er...@gmail.com>.
Not sure, of course. Sure seems like a better error message is in order,
is there anything above the message you pasted in the log file that sheds
more light on the subject?

Erick

On Fri, Dec 5, 2014 at 1:22 PM, Min L <mi...@gmail.com> wrote:
> Thanks for your reply.
>
> This is all it is in the solr log, no stack. It fails regardless of
> buildOncommit=true or false by building it manually. The file fst.bin was
> created.
>
> I found the source code in suggester.java where it logged the error.
> Perhaps lookup.store(new FileOutputStream(target)) failed? Wonder why.
>
> if (storeDir != null) {
>
>       File target = new File(storeDir, factory.storeFileName());
>
>       if(!lookup.store(new FileOutputStream(target))) {
>
>         if (sourceLocation == null) {
>
>           assert reader != null && field != null;
>
> *          LOG.error("Store Lookup build from index on field: " + field + "
> failed reader has: " + reader.maxDoc() + " docs");*
>
>         } else {
>
>           LOG.error("Store Lookup build from sourceloaction: " +
> sourceLocation + " failed");
>
>         }
>
>       } else {
>
>         LOG.info("Stored suggest data to: " + target.getAbsolutePath());
>
>       }
>
>     }
>
> On Fri, Dec 5, 2014 at 12:59 PM, Erick Erickson <er...@gmail.com>
> wrote:
>
>> What's the rest of the stack trace? There should
>> be a root cause somewhere.
>>
>> Best,
>> Erick
>>
>> On Fri, Dec 5, 2014 at 11:07 AM, Min L <mi...@gmail.com> wrote:
>> > Hi all:
>> >
>> > My code using solr spellchecker to suggest keywords worked fine locally,
>> > however in qa solr env, it failed to build it with the following error in
>> > solr log:
>> >
>> > ERROR Suggester Store Lookup build from index on field: myfieldname
>> failed
>> > reader has: xxx docs
>> >
>> > I checked the solr directory and the file fst.bin was created
>> successfully
>> > though. Does anyone know what caused the issue?
>> >
>> > command to build:
>> > http://xxxx:8080/solr/mycore/suggestkeyword?spellcheck.build=true
>> >
>> > Thanks a lot!
>>

Re: unable to build spellcheck in solr

Posted by Min L <mi...@gmail.com>.
Thanks for your reply.

This is all it is in the solr log, no stack. It fails regardless of
buildOncommit=true or false by building it manually. The file fst.bin was
created.

I found the source code in suggester.java where it logged the error.
Perhaps lookup.store(new FileOutputStream(target)) failed? Wonder why.

if (storeDir != null) {

      File target = new File(storeDir, factory.storeFileName());

      if(!lookup.store(new FileOutputStream(target))) {

        if (sourceLocation == null) {

          assert reader != null && field != null;

*          LOG.error("Store Lookup build from index on field: " + field + "
failed reader has: " + reader.maxDoc() + " docs");*

        } else {

          LOG.error("Store Lookup build from sourceloaction: " +
sourceLocation + " failed");

        }

      } else {

        LOG.info("Stored suggest data to: " + target.getAbsolutePath());

      }

    }

On Fri, Dec 5, 2014 at 12:59 PM, Erick Erickson <er...@gmail.com>
wrote:

> What's the rest of the stack trace? There should
> be a root cause somewhere.
>
> Best,
> Erick
>
> On Fri, Dec 5, 2014 at 11:07 AM, Min L <mi...@gmail.com> wrote:
> > Hi all:
> >
> > My code using solr spellchecker to suggest keywords worked fine locally,
> > however in qa solr env, it failed to build it with the following error in
> > solr log:
> >
> > ERROR Suggester Store Lookup build from index on field: myfieldname
> failed
> > reader has: xxx docs
> >
> > I checked the solr directory and the file fst.bin was created
> successfully
> > though. Does anyone know what caused the issue?
> >
> > command to build:
> > http://xxxx:8080/solr/mycore/suggestkeyword?spellcheck.build=true
> >
> > Thanks a lot!
>

Re: unable to build spellcheck in solr

Posted by Erick Erickson <er...@gmail.com>.
What's the rest of the stack trace? There should
be a root cause somewhere.

Best,
Erick

On Fri, Dec 5, 2014 at 11:07 AM, Min L <mi...@gmail.com> wrote:
> Hi all:
>
> My code using solr spellchecker to suggest keywords worked fine locally,
> however in qa solr env, it failed to build it with the following error in
> solr log:
>
> ERROR Suggester Store Lookup build from index on field: myfieldname failed
> reader has: xxx docs
>
> I checked the solr directory and the file fst.bin was created successfully
> though. Does anyone know what caused the issue?
>
> command to build:
> http://xxxx:8080/solr/mycore/suggestkeyword?spellcheck.build=true
>
> Thanks a lot!

Re: unable to build spellcheck in solr

Posted by Min L <mi...@gmail.com>.
Below is the solrconfig.xml. myfieldName is indexed in solr and is
searchable. The spellcheck.build=true
<http://xxxx:8080/solr/mycore/suggestkeyword?spellcheck.build=true> works
in one env but not in another.

<searchComponent class="solr.SpellCheckComponent" name="suggestk">

    <lst name="spellchecker">

      <str name="name">suggestDict</str>

      <str name="classname">org.apache.solr.spelling.suggest.Suggester</str>

      <str name="lookupImpl">
org.apache.solr.spelling.suggest.fst.FSTLookupFactory</str>

      <str name="storeDir">suggestDir</str>

      <str name="field">myfieldName</str>

      <float name="threshold">0.001</float>

    </lst>

  </searchComponent>

  <requestHandler class="org.apache.solr.handler.component.SearchHandler"
name="/suggestk">

    <lst name="defaults">

      <str name="wt">json</str>

      <str name="spellcheck">true</str>

      <str name="spellcheck.dictionary">suggestDict</str>

      <str name="spellcheck.count">10</str>

    </lst>

    <arr name="components">

      <str> suggestk </str>

    </arr>

  </requestHandler>


Thanks.

On Fri, Dec 5, 2014 at 2:05 PM, Alexandre Rafalovitch <ar...@gmail.com>
wrote:

> What's your suggester XML definition?
>
> Do you have a link similar to:
> <str name="sourceLocation">fuzzysuggest.txt</str>
>
> That particular code path seems to be expecting it.
>
> Regards,
>    Alex.
> Personal: http://www.outerthoughts.com/ and @arafalov
> Solr resources and newsletter: http://www.solr-start.com/ and @solrstart
> Solr popularizers community: https://www.linkedin.com/groups?gid=6713853
>
>
> On 5 December 2014 at 14:07, Min L <mi...@gmail.com> wrote:
> > Hi all:
> >
> > My code using solr spellchecker to suggest keywords worked fine locally,
> > however in qa solr env, it failed to build it with the following error in
> > solr log:
> >
> > ERROR Suggester Store Lookup build from index on field: myfieldname
> failed
> > reader has: xxx docs
> >
> > I checked the solr directory and the file fst.bin was created
> successfully
> > though. Does anyone know what caused the issue?
> >
> > command to build:
> > http://xxxx:8080/solr/mycore/suggestkeyword?spellcheck.build=true
> >
> > Thanks a lot!
>

Re: unable to build spellcheck in solr

Posted by Alexandre Rafalovitch <ar...@gmail.com>.
What's your suggester XML definition?

Do you have a link similar to:
<str name="sourceLocation">fuzzysuggest.txt</str>

That particular code path seems to be expecting it.

Regards,
   Alex.
Personal: http://www.outerthoughts.com/ and @arafalov
Solr resources and newsletter: http://www.solr-start.com/ and @solrstart
Solr popularizers community: https://www.linkedin.com/groups?gid=6713853


On 5 December 2014 at 14:07, Min L <mi...@gmail.com> wrote:
> Hi all:
>
> My code using solr spellchecker to suggest keywords worked fine locally,
> however in qa solr env, it failed to build it with the following error in
> solr log:
>
> ERROR Suggester Store Lookup build from index on field: myfieldname failed
> reader has: xxx docs
>
> I checked the solr directory and the file fst.bin was created successfully
> though. Does anyone know what caused the issue?
>
> command to build:
> http://xxxx:8080/solr/mycore/suggestkeyword?spellcheck.build=true
>
> Thanks a lot!