lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jack Krupansky" <j...@basetechnology.com>
Subject Re: NULL POINTER EXCEPTION WITH SOLR SUGGESTER
Date Sun, 13 Jan 2013 16:55:56 GMT
What URL did you use? What is your data like?

I tried your exact config but with the field name of "name" rather than 
spell_check, using the Solr 4.0 example. Then I added the following data:

curl http://localhost:8983/solr/update?commit=true -H 
'Content-type:application/csv' -d '
id,name
sug-1,aardvark abacus ball bill cat cello
sug-2,abate accord band bell cattle check
sug-3,adorn border clean clock'

Then I issued a suggest request using curl and got the expected response:

Jack Krupansky@JackKrupansky ~ $ curl 
"http://localhost:8983/solr/suggest?q=b&indent=true"
<?xml version="1.0" encoding="UTF-8"?>
<response>

<lst name="responseHeader">
  <int name="status">0</int>
  <int name="QTime">1</int>
</lst>
<lst name="spellcheck">
  <lst name="suggestions">
    <lst name="b">
      <int name="numFound">5</int>
      <int name="startOffset">0</int>
      <int name="endOffset">1</int>
      <arr name="suggestion">
        <str>ball</str>
        <str>band</str>
        <str>bell</str>
        <str>bill</str>
        <str>border</str>
      </arr>
    </lst>
    <str name="collation">ball</str>
  </lst>
</lst>
</response>

So, try that simple example first and make sure it works for you, then see 
what else is different in your failing scenario.

-- Jack Krupansky

-----Original Message----- 
From: obi240
Sent: Saturday, January 12, 2013 12:15 PM
To: solr-user@lucene.apache.org
Subject: NULL POINTER EXCEPTION WITH SOLR SUGGESTER

Hi,

I'm currently working with SOLR 4. I tried calling my suggester feature and
got the error below:

5001java.lang.NullPointerException at
org.apache.lucene.search.suggest.fst.FSTCompletionLookup.lookup(FSTCompletionLookup.java:237)
at
org.apache.solr.spelling.suggest.Suggester.getSuggestions(Suggester.java:190)
at
org.apache.solr.handler.component.SpellCheckComponent.process(SpellCheckComponent.java:172)
at
org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:206)
at
org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:129)
at org.apache.solr.core.SolrCore.execute(SolrCore.java:1699) at
org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:455)
at
org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:276)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:405)
at
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:964)
at
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:515)
at
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:302)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722) 500

My suggest searchcomponent and request handler are as below:


  <searchComponent class="solr.SpellCheckComponent" name="suggest">
    <lst name="spellchecker">
      <str name="name">suggest</str>
      <str name="classname">org.apache.solr.spelling.suggest.Suggester</str>
      <str
name="lookupImpl">org.apache.solr.spelling.suggest.fst.FSTLookup</str>
      <str name="field">spell_check</str>
      <float name="threshold">0.005</float>
      <str name="buildOnCommit">true</str>

    </lst>
  </searchComponent>


  <requestHandler class="org.apache.solr.handler.component.SearchHandler"
name="/suggest">
    <lst name="defaults">
      <str name="spellcheck">true</str>
      <str name="spellcheck.dictionary">suggest</str>
      <str name="spellcheck.onlyMorePopular">true</str>
      <str name="spellcheck.count">5</str>
      <str name="spellcheck.collate">true</str>
    </lst>
    <arr name="components">
      <str>suggest</str>
    </arr>
  </requestHandler>

Can anyone point out what I'm doing wrong here?

Thanks



--
View this message in context: 
http://lucene.472066.n3.nabble.com/NULL-POINTER-EXCEPTION-WITH-SOLR-SUGGESTER-tp4032763.html
Sent from the Solr - User mailing list archive at Nabble.com. 


Mime
View raw message