Solr v6.6.3 在使用自定义 searchHandler 时抛出 IOexception

Solr v6.6.3 throwing IOexception while using custom searchHandler

我已经在 linux OS 上安装并配置了 SOLR 6.6.3。并配置了 DIH 和名为 filesearch 的搜索处理程序,它具有简单的分片 locolhost:8983/solr/fI_idx。但是在使用配置的搜索处理程序进行搜索时出现问题。如果 运行 在请求处理程序中使用 /select,则来自查询部分的管理员 UI 我能够获得在本地服务器中编制索引的结果,但是当我尝试传递 filesearch 作为请求处理程序和搜索它给出

null:org.apache.solr.common.SolrException: 
org.apache.solr.client.solrj.SolrServerException: IOException occured 
when talking to server at: http://localhost:8983/solr/FI_idx
27/06/2018, 15:45:12
ERROR true

谁能告诉我可能是什么问题。您可能会问一个问题,为什么在默认情况下需要新的 searchHanlder /select 我正在尝试将其作为分布式搜索功能的一部分。

/filesearch

的定义
<requestHandler name="/filesearch" class="solr.SearchHandler">
   <lst name="defaults">
   <str name="q.alt">*:*</str>
   <str name="shards">localhost:8983/solr/FI_idx</str>
   <str name="df">document</str>
   </lst>
</requestHandler>

我观察到的主要问题是因为 luceneMatchVersion 在旧服务器中是 LUCENE_40 现在我在更改版本后将其更改为 LUCENE_CURRENT6.6.3通过从数据库中提取记录来使用 DIH 进行索引。然后尝试使用 filesearch 进行搜索,但它不起作用,下面是完整的错误

2018-06-28 09:50:50.488 ERROR (qtp1348949648-80) [   x:FI_idx] 
o.a.s.s.HttpSolrCall null:org.apache.solr.common.SolrException: org.apache.solr.client.solrj.SolrServerException: IOException occured when talking to server at: http://localhost:8984/solr/FI_idx
    at org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:416)
    at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:173)
    at org.apache.solr.core.SolrCore.execute(SolrCore.java:2477)
    at org.apache.solr.servlet.HttpSolrCall.execute(HttpSolrCall.java:723)
    at org.apache.solr.servlet.HttpSolrCall.call(HttpSolrCall.java:529)
    at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:361)
    at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:305)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1691)
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:582)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
    at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
    at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226)
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1180)
    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:512)
    at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1112)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
    at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:213)
    at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:119)
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)
    at org.eclipse.jetty.rewrite.handler.RewriteHandler.handle(RewriteHandler.java:335)
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)
    at org.eclipse.jetty.server.Server.handle(Server.java:534)
    at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:320)
    at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:251)
    at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273)
    at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
    at org.eclipse.jetty.io.SelectChannelEndPoint.run(SelectChannelEndPoint.java:93)
    at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303)
    at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148)
    at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.run(QueuedThreadPool.java:589)
    at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.solr.client.solrj.SolrServerException: IOException occured when talking to server at: http://localhost:8984/solr/FI_idx
    at org.apache.solr.client.solrj.impl.HttpSolrClient.executeMethod(HttpSolrClient.java:626)
    at org.apache.solr.client.solrj.impl.HttpSolrClient.request(HttpSolrClient.java:279)
     at org.apache.solr.client.solrj.impl.HttpSolrClient.request(HttpSolrClient.java:268)
    at org.apache.solr.client.solrj.SolrClient.request(SolrClient.java:1219)
    at org.apache.solr.handler.component.HttpShardHandler.lambda$submit[=12=](HttpShardHandler.java:163)
    at org.apache.solr.handler.component.HttpShardHandler$$Lambda9/1837196479.call(Unknown Source)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at com.codahale.metrics.InstrumentedExecutorService$InstrumentedRunnable.run(InstrumentedExecutorService.java:176)
    at org.apache.solr.common.util.ExecutorUtil$MDCAwareThreadPoolExecutor.lambda$execute[=12=](ExecutorUtil.java:229)
    at org.apache.solr.common.util.ExecutorUtil$MDCAwareThreadPoolExecutor$$Lambda5/303240439.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    ... 1 more
 Caused by: org.apache.http.conn.ConnectionPoolTimeoutException: Timeout waiting for connection from pool
    at org.apache.http.impl.conn.PoolingClientConnectionManager.leaseConnection(PoolingClientConnectionManager.java:226)
    at org.apache.http.impl.conn.PoolingClientConnectionManager.getConnection(PoolingClientConnectionManager.java:195)
    at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:423)
    at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:882)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:55)
    at org.apache.solr.client.solrj.impl.HttpSolrClient.executeMethod(HttpSolrClient.java:515)
    ... 14 more

如果需要任何其他信息,请告诉我。

谢谢。

如下修改searchHandler并解决了问题。由于版本升级需要修改。

<requestHandler name="/filesearch" class="solr.SearchHandler">
   <lst name="defaults">
    <str name="q.alt">*:*</str>
    <str name="shards">localhost:8983/solr/FI_idx</str>
    <str name="df">document</str>
    <str name="shards.qt">/select</str>
   </lst>
</requestHandler>

对搜索处理程序的额外更改是

 <str name="shards.qt">/select</str>

请在此处找到有关讨论的更多详细信息

http://lucene.472066.n3.nabble.com/A-user-defined-request-handler-is-failing-to-fetch-the-data-td4396102.html

谢谢,

阿达什