lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bernd Fehling (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (SOLR-2726) NullPointerException when using spellcheck.q
Date Wed, 31 Aug 2011 14:18:09 GMT

     [ https://issues.apache.org/jira/browse/SOLR-2726?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Bernd Fehling updated SOLR-2726:
--------------------------------

    Attachment: SOLR-2726.patch

According to SOLR-572 the default analyzer should be WhitespaceAnalyzer. So I added the WhitespaceAnalyzer
to "init" of Suggester.java.
Now spellcheck.q works without NPE.

Tip:
To get suggestions with multiple words like "New Y" for "New York" and also for "New Year"
you can use queryAnalyzerFieldType with an analyzer having a PatternReplaceFilterFactory for
e.g. "_" (underscore).
If you now lookup up suggestions with New_Y you will get suggestions for "New York", "New
Year", ...


> NullPointerException when using spellcheck.q
> --------------------------------------------
>
>                 Key: SOLR-2726
>                 URL: https://issues.apache.org/jira/browse/SOLR-2726
>             Project: Solr
>          Issue Type: Bug
>          Components: spellchecker
>    Affects Versions: 3.3, 4.0
>         Environment: ubuntu
>            Reporter: valentin
>              Labels: nullpointerexception, spellcheck
>         Attachments: SOLR-2726.patch
>
>
> When I use spellcheck.q in my query to define what will be "spellchecked", I always have
this error, for every configuration I try :
> java.lang.NullPointerException
> at org.apache.solr.handler.component.SpellCheckComponent.getTokens(SpellCheckComponent.java:476)
> at org.apache.solr.handler.component.SpellCheckComponent.process(SpellCheckComponent.java:131)
> at org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:202)
> at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:129)
> at org.apache.solr.core.SolrCore.execute(SolrCore.java:1368)
> at org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:356)
> at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:252)
> at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1212)
> at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:399)
> at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
> at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
> at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766)
> at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:450)
> at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
> at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
> at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
> at org.mortbay.jetty.Server.handle(Server.java:326)
> at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
> at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:928)
> at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:549)
> at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
> at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
> at org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228)
> at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
> All my other functions works great, this is the only thing which doesn't work at all,
just when i add "&spellcheck.q=my%20sentence" in the query...
> Example of a query : 
> http://localhost:8983/solr/db/suggest_full?q=american%20israel&spellcheck.q=american%20israel
> In solrconfig.xml :
> <searchComponent name="suggest_full" class="solr.SpellCheckComponent">
> 	 <str name="queryAnalyzerFieldType">suggestTextFull</str>
> 	 <lst name="spellchecker">
> 	  <str name="name">suggest_full</str>
> 	  <str name="classname">org.apache.solr.spelling.suggest.Suggester</str>
> 	  <str name="lookupImpl">org.apache.solr.spelling.suggest.tst.TSTLookup</str>
> 	  <str name="field">text_suggest_full</str>
> 	  <str name="fieldType">suggestTextFull</str>
> 	 </lst>
> </searchComponent>
> <requestHandler name="/suggest_full" class="org.apache.solr.handler.component.SearchHandler">
> 	<lst name="defaults">
> 	 <str name="spellcheck">true</str>
> 	 <str name="spellcheck.dictionary">suggest_full</str>
> 	 <str name="spellcheck.count">10</str>
> 	 <str name="spellcheck.onlyMorePopular">true</str>
> 	</lst>
> 	<arr name="components">
> 	 <str>suggest_full</str>
> 	</arr>
> </requestHandler>
> I'm using SolR 3.3, and I tried it too on SolR 4.0

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Mime
View raw message