lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "不知道" <591347...@qq.com>
Subject Re: Null pointer exception in spell checker at addchecker method
Date Mon, 09 Dec 2013 07:24:40 GMT
how can i unsubscribe




------------------ Original ------------------
From:  "Areek Zillur";<areek666@gmail.com>;
Date:  Mon, Dec 9, 2013 02:26 PM
To:  "solr-user"<solr-user@lucene.apache.org>; 

Subject:  Re: Null pointer exception in spell checker at addchecker method



From the solrConfig provided it seems like you have only two named
spellcheckers defined (direct & wordbreak), but in your '/spell'
requestHandler you are setting three spellcheckers (direct, default &
wordbreak). As you do not have an unnamed spellchecker, there is no
spellchecker defined with the name 'default'.
Hence its erroring out when its trying to get config for the non-existent
'default' spellchecker. I think it should work if you remove "<str
name="spellcheck.dictionary">default</str>" from your '/spell'
requestHandler?

Hope that helps,

Areek


On Fri, Dec 6, 2013 at 11:33 PM, sweety <sweetyshinde45@yahoo.com> wrote:

> Im trying to use spell check component.
> My *schema* is:(i have included only fields necessary for spell check not
> the entire schema)
> <fields>
>
> <field name="doc_id" type="uuid" indexed="true" stored="true" default="NEW"
> multiValued="false"/>
> <field name="id" type="string" indexed="true" stored="true" required="true"
> multiValued="false"/>
> <field name="contents" type="text" indexed="true" stored="true"
> multiValued="false"/>
> <field name="author" type="string" indexed="true" stored="true"
> multiValued="true"/>
> <field name="title" type="text" indexed="true" stored="true"/>
> <field name="_version_" type="long" indexed="true" stored="true"
> multiValued="false"/>
> <copyfield source="id" dest="text" />
> <dynamicField name="ignored_*" type="text" indexed="false" stored="false"
> multiValued="true"/>
>
> <field name="spelltext" type="spell" indexed="true" stored="false"
> multiValued="true" />
> <copyField source="contents" dest="spelltext" />
> </fields>
> <types>
> <fieldType name="spell" class="solr.TextField" >
> <analyzer type="index">
> <tokenizer class="solr.WhitespaceTokenizerFactory"/>
> <filter class="solr.LowerCaseFilterFactory" />
> <filter class="solr.EnglishMinimalStemFilterFactory" />
> <filter class="solr.SnowballPorterFilterFactory" />
> <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1"
> splitOnCaseChange="1"/>
> </analyzer>
> <analyzer type="query">
> <tokenizer class="solr.WhitespaceTokenizerFactory"/>
> <filter class="solr.EnglishMinimalStemFilterFactory" />
> <filter class="solr.SnowballPorterFilterFactory" />
> </analyzer>
> </fieldType>
> </types>
>
> My *solrconfig* is:
>
> <searchComponent name="spellcheck" class="solr.SpellCheckComponent">
> <str name="queryAnalyzerFieldType">text</str>
> <lst name="spellchecker">
> <str name="name">direct</str>
> <str name="field">contents</str>
> <str name="classname">solr.DirectSolrSpellChecker</str>
> <str name="distanceMeasure">internal</str>
> <float name="accuracy">0.8</float>
> <int name="maxEdits">1</int>
> <int name="minPrefix">1</int>
> <int name="maxInspections">5</int>
> <int name="minQueryLength">3</int>
> <float name="maxQueryFrequency">0.01</float>
> </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">contents</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="spellcheck">true</str>
> <str name="spellcheck.dictionary">direct</str>
> <str name="spellcheck.dictionary">default</str>
> <str name="spellcheck.dictionary">wordbreak</str>
> <str name="spellcheck">on</str>
> <str name="spellcheck.extendedResults">true</str>
> <str name="spellcheck.count">5</str>
> <str name="spellcheck.collate">true</str>
> <str name="spellcheck.collateExtendedResults">true</str>
> </lst>
> <arr name="last-components">
> <str>spellcheck</str>
> </arr>
> </requestHandler>
>
> I get this *error*:
> java.lang.NullPointerException at
>
> org.apache.solr.spelling.*ConjunctionSolrSpellChecker.addChecker*(ConjunctionSolrSpellChecker.java:58)
> at
>
> org.apache.solr.handler.component.SpellCheckComponent.getSpellChecker(SpellCheckComponent.java:475)
> at
>
> org.apache.solr.handler.component.SpellCheckComponent.prepare(SpellCheckComponent.java:106)
> at
>
> org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:187)
> at
>
> org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:135)
> at
>
> org.apache.solr.core.RequestHandlers$LazyRequestHandlerWrapper.handleRequest(RequestHandlers.java:242)
> at org.apache.solr.core.SolrCore.execute(SolrCore.java:1797) at
>
> org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:637)
> at
>
> org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:343)
> at
>
> org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:141)
> at
>
> I know that the error might be in addchecker method,i read this method but
> the coding of this method is such that, for all the null values, default
> values are added.
> (eg: if (queryAnalyzer == null)
>  queryAnalyzer = checker.getQueryAnalyzer(); )
> Now so i feel that the Null checker value is sent when
> /checkers.add(checker);/  is executed.
>
> If i am right tell me how to resolve this,else what has gone wrong.
> Thanks in advance.
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Null-pointer-exception-in-spell-checker-at-addchecker-method-tp4105489.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>
Mime
  • Unnamed multipart/alternative (inline, 8-Bit, 0 bytes)
View raw message