我有两个在分片中运行的solr服务器(solr 4.5.1)..
我已经使用spellcheckComponent为自动建议器实现了solr suggester。
当我在个别核心上执行建议url时,solr建议正确。
mysolr.com:8986/solr/core1/suggest?spellcheck.q=city%20of
和
mysolr.com:8987/solr/core1/suggest?spellcheck.q=city%20of
当我向refir wiki(wiki.apache.org/solr/SpellCheckComponent#Distributed_Search_Support)发送带有refence的url时,结果不会出现,并且会发生异常。
位于org.apache.solr.handler.component.QueryComponent.handleRegularResponses(QueryComponent.java:649)的org.apache.solr.handler.component.QueryComponent.mergeIds(QueryComponent.java:843)中的mysolr.com:8986/solr/core1/select?shards=mysolr.com:8986/solr/core1,mysolr.com:8987/solr/core1&spellcheck.q=city%20of&shards.qt=% 2Fsuggest&安培; QT =建议
java.lang.NullPointerException位于org.apache.solr.handler的org.apache.solr.handler.component.QueryComponent.handleResponses(QueryComponent.java:628)org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:311) .RequestHandlerBase.handleRequest(RequestHandlerBase.java:135)在org.apache.solr.core.SolrCore.execute(SolrCore.java:1859)在org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:703)在org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:406)在org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:195)在org.eclipse.jetty.servlet.ServletHandler $ CachedChain。在org.eclipse.jetty.ser的org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:455)的doFilter(ServletHandler.java:1419) ver.handler.ScopedHandler.handle(ScopedHandler.java:137)org.eclipse.jetty.securityHandler.handle(SecurityHandler.java:557)org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler。 java:231)org.eclipse.jetty上的org.eclipse.jetty.server.hand.上传。或者org.eclipse.jet上的org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:384)中的org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1075)位于org.eclipse.jetty.server.hand.hand.ScopedHandler.handle的org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1009)的.server.session.SessionHandler.doScope(SessionHandler.java:193) (ScopedHandler.java:135)在org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:255)在org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:154)在org.eclipse.jetty.server.handle(HandlerWrapper.handle)上的org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)org.eclipse.jet.Server.handle(Server.java:368)org.eclipse.jetty.server.Abst ractHttpConnection.handleRequest(AbstractHttpConnection.java:489)在org.eclipse.jetty.server.BlockingHttpConnection.handleRequest(BlockingHttpConnection.java:53)在org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:942)在组织.eclipse.jetty.server.AbstractHttpConnection $ RequestHandler.headerComplete(AbstractHttpConnection.java:1004)在org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:640)在org.eclipse.jetty.http.HttpParser.parseAvailable (HttpParser.java:235)org.eclipse.jetty.server.BlockingHttpConnection.handle(BlockingHttpConnection.java:72)at org.eclipse.jetty.server.bio.SocketConnector $ ConnectorEndPoint.run(SocketConnector.java:264)at at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)在org.eclipse.jetty.util.thread.QueuedThreadPool $ 3.run(QueuedThreadPool.java:543)在java.lang.Thread.run (Thread.java:619)
以下参考是我的schema.xml和solrconfig.xml条目
<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.tst.TSTLookupFactory</str>
<str name="field">sugg</str>
<str name="buildOnCommit">true</str>
</lst>
<requestHandler class="org.apache.solr.handler.component.SearchHandler" name="/suggest">
<lst name="defaults">
<str name="spellcheck">on</str>
<str name="spellcheck.dictionary">suggest</str>
<str name="spellcheck.onlyMorePopular">true</str>
<str name="spellcheck.count">10</str>
<str name="spellcheck.collate">true</str>
</lst>
<arr name="components">
<str>suggest</str>
</arr>
<fieldType name="text_autocomplete" class="solr.TextField" positionIncrementGap="100">
<analyzer>
<tokenizer class="solr.KeywordTokenizerFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.TrimFilterFactory"/>
<filter class="solr.SynonymFilterFactory" synonyms="syn.txt" ignoreCase="true" expand="true"/>
<filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
</analyzer>
我在store = true
schema.xml
任何人都可以建议解决方案。