首页 新闻 搜索 专区 学院

一个zookeeper 管理两个 solr ,单独 请求 suggest 正常,但是不分片访问的话报错

0
悬赏园豆:180 [待解决问题]

这样访问: http://localhost:8084/solr/collection1/suggest?q=*%3A*&rows=1&wt=json&indent=true&spellcheck=true&spellcheck.q=积木&distrib=false . 可以正常suggest ,但是我 去掉 distrib 属性就报错。 

 

我调试 代码 :发现问题出在:solr-core 包中的这个类 spellcheckComponent,这段代码

protected SolrSpellChecker getSpellChecker(SolrParams params) {
String[] dictName = getDictionaryNames(params);
if (dictName.length == 1) {
return spellCheckers.get(dictName[0]);
} else {
String singleStr = getDictionaryNameAsSingleString(dictName);
SolrSpellChecker ssc = spellCheckers.get(singleStr);
if (ssc == null) {
ConjunctionSolrSpellChecker cssc = new ConjunctionSolrSpellChecker();
for (String dn : dictName) {
cssc.addChecker(spellCheckers.get(dn));
}
ssc = cssc;
}
return ssc;
}
}

 

调试结果  dictName="pyNotokenSuggest"  (是我自定义的 suggest)

分片查询的话: return spellCheckers.get(dictName[0]);//spellCheckers是包含我定义的suggest 的。

但是 直接使用zookeeper 查询所有的话,如访问104,执行到这个句话时 spellCheckers是包含我定义的suggest的,接着它会访问103的solr,仍然会执行这段代码,但是这是会发现 spellCheckers中已经不包含我定义的 suggest,导致 空指针 异常 。。

 

求大神 赐教 解决办法 。!!!!!!!!!!

 

 

被访问的solr 报错 :

90484 [http-bio-8084-exec-31] INFO org.apache.solr.core.SolrCore – [collection1] webapp=/solr path=/suggest params={spellcheck=true&indent=true&q=*:*&spellcheck.q=积木&wt=json&rows=1} status=500 QTime=9094
190484 [http-bio-8084-exec-31] ERROR org.apache.solr.servlet.SolrDispatchFilter – null:org.apache.solr.client.solrj.impl.HttpSolrServer$RemoteSolrException: Server at http://192.168.1.54:8083/solr/collection1 returned non ok status:500, message:Internal Server Error
at org.apache.solr.client.solrj.impl.HttpSolrServer.request(HttpSolrServer.java:385)
at org.apache.solr.client.solrj.impl.HttpSolrServer.request(HttpSolrServer.java:180)
at org.apache.solr.handler.component.HttpShardHandler$1.call(HttpShardHandler.java:156)
at org.apache.solr.handler.component.HttpShardHandler$1.call(HttpShardHandler.java:119)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)

 

 

集群中的另一个 solr 集群报错如下:

1244578 [http-bio-8083-exec-3] ERROR org.apache.solr.core.SolrCore – java.lang.NullPointerException
at org.apache.solr.handler.component.SpellCheckComponent.process(SpellCheckComponent.java:146)
at org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:208)
at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:135)
at org.apache.solr.core.SolrCore.execute(SolrCore.java:1904)
at org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:659)
at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:362)
at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:158)
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:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1041)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:603)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)

远方的人的主页 远方的人 | 初学一级 | 园豆:7
提问于:2014-11-28 17:10
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册