(moving to solr-user@lucene.apache.org)

Gene,

I can reproduce your problem if I misspell the "spellcheck.dictionary" 
parameter in my query.  But I see your query has "direct" which matches the 
"name" element of one of your spellcheckers.  I think the actual problem in 
your case might be that you have separate <searchComponent /> sections in your 
configuration.  This might be causing only the last Search Component named 
"spellcheck" to be active.  I believe you need to have just one:

<searchComponent name="spellcheck" class="solr.SpellCheckComponent">
 <lst name="spellchecker">
  <str name="name">direct</str>
  ...
 </lst>
 <lst name="spellchecker">
  <str name="name">index</str>
  ...
 </lst>
 <lst name="spellchecker">
  <str name="name">wordbreak</str>
  ...
 </lst>
</searchComponent> 


James Dyer
Ingram Content Group

From: genel [mailto:g...@tekdata.com] 
Sent: Monday, April 16, 2018 12:25 PM
To: java-u...@lucene.apache.org
Subject: Error configuring Spell Checker
Importance: Low

We've been using SOLR for quite awhile. I'm attempting to install spell
checking.

I think I have the basic configuration correct, because the wordbreak
component seems to work, but none of the others do. 

I consistently get an NPE error 


. java.lang.NullPointerException at
org.apache.solr.handler.component.SpellCheckComponent.process(SpellCheckComponent.java:147)
at
org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:273)
at
org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:156)
at org.apache.solr.core.SolrCore.execute(SolrCore.java:2073) at
org.apache.solr.servlet.HttpSolrCall.execute(HttpSolrCall.java:658) at
org.apache.solr.servlet.HttpSolrCall.call(HttpSolrCall.java:457) at
org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:223)
at
org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:181)
at
org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
at
org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)
at
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
at
org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577)
at
org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)
at
org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
at
org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
at
org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)
at
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at
org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:215)
at
org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:110)
at
org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
at org.eclipse.jetty.server.Server.handle(Server.java:499) at
org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:310) at
org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)
at
org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540)
at
org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)
at
org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)
at java.lang.Thread.run(Unknown Source) 

Relevant part of solrconfig:


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

<lst name="spellchecker">
<str name="name">direct</str>
<str name="field">text_spell</str>
<str name="classname">solr.DirectSolrSpellChecker</str>
<str name="distanceMeasure">internal</str>
<float name="accuracy">0.5</float>
<int name="maxEdits">2</int>
<int name="minPrefix">2</int>
<int name="maxInspections">5</int>
<int name="minQueryLength">4</int>
<float name="maxQueryFrequency">0.01</float>
<float name="thresholdTokenFrequency">.01</float>
</lst>
</searchComponent>
<searchComponent name="spellcheck" class="solr.SpellCheckComponent">
<lst name="spellchecker">
<str name="name">index</str>
<str name="classname">solr.IndexBasedSpellChecker</str>
<str name="spellcheckIndexDir">./spellchecker</str>
<str name="field">text_spell</str>
<str name="buildOnCommit">true</str>

</lst>
</searchComponent>
<searchComponent name="spellcheck" class="solr.SpellCheckComponent">
<lst name="spellchecker">
<str name="name">wordbreak</str>
<str name="classname">solr.WordBreakSolrSpellChecker</str>
<str name="field">text_spell</str>
<str name="combineWords">true</str>
<str name="breakWords">true</str>
<int name="maxChanges">10</int>
</lst>
</searchComponent> 
<requestHandler name="/spell" class="solr.SearchHandler" startup="lazy">
<lst name="defaults">
<str name="echoParams">explicit</str> 
<int name="rows">20</int> 
<str name="df">text</str>

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

<str name="spellcheck">on</str>
<str name="spellcheck.extendedResults">true</str>
<str name="spellcheck.count">10</str>
<str name="spellcheck.alternativeTermCount">5</str>
<str name="spellcheck.maxResultsForSuggest">5</str>
<str name="spellcheck.collate">true</str>
<str name="spellcheck.collateExtendedResults">true</str>
<str name="spellcheck.maxCollationTries">10</str>
<str name="spellcheck.maxCollations">5</str>
</lst>
<arr name="last-components">
<str>spellcheck</str>
</arr>
</requestHandler>

Relevant part of schema:

<fieldType name="tokenized" class="solr.TextField"
positionIncrementGap="100">
<analyzer type="index">
<filter class="solr.ASCIIFoldingFilterFactory"/>
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.StopFilterFactory" ignoreCase="true"
words="stopwords.txt" />
<filter class="solr.KeywordMarkerFilterFactory"
protected="protwords.txt"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
</analyzer>
<analyzer type="query">
<filter class="solr.ASCIIFoldingFilterFactory"/>
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.StopFilterFactory" ignoreCase="true"
words="stopwords.txt"/>
<filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt"
ignoreCase="true" expand="true"/>
<filter class="solr.KeywordMarkerFilterFactory"
protected="protwords.txt"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
</analyzer>
</fieldType>

<field name="text_spell" type="tokenized" indexed="true" stored="true"
multiValued="true" />

<copyField source="resource_name" dest="text_spell"/>
<copyField source="description" dest="text_spell"/>

url:

http://localhost:8983/solr/gene/spell?spellcheck.q=rainb&spellcheck=true

I've tried just about everything I can think of, what am I missing?



--
Sent from: http://lucene.472066.n3.nabble.com/Lucene-Java-Users-f532864.html

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-user-h...@lucene.apache.org

Reply via email to