使用ContentStreamUpdateRequest将doc / pdf / docx文件索引到solr中

时间:2016-05-31 13:22:24

标签: solrj solr4 java-6

您好我在这里使用Solr 4.7.2索引文档。

使用solrj的ContentStreamUpdateRequest我试图索引Solr中的文件,但同时 我正在使用UI

发送文件路径和唯一ID字段作为输入

在动作类中,将ContentStreamUpdateRequest的对象传递给solrServer对象 即

SolrServer solrServer = ..;
solrServer.request(contentStreamUpdateRequest);

我收到以下错误

Exception:
    org.apache.solr.client.solrj.SolrServerException

Exception message:
    error reading streams

异常追踪:

at   org.apache.solr.client.solrj.impl.HttpSolrServer.request(HttpSolrServer.java:382)
at   org.apache.solr.client.solrj.impl.HttpSolrServer.request(HttpSolrServer.java:199)
at   com.adastra.candidate.search.solr.action.SolrUpdateAction.aaaExecute(SolrUpdateAction.java:49)
at   com.adastra.base.action.BaseAction.execute(BaseAction.java:181)
at   org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:425)
at   org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:228)
at   org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
at   org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
at   javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at   javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at   org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at   org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at   org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at   org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at   org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at   org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at   org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at   org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at   org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:859)
at   org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:579)
at   org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1555)
at   java.lang.Thread.run(Unknown Source) 

请建议我修理它。

1 个答案:

答案 0 :(得分:0)

我认为在版本4.7.2中,默认情况下禁用流式传输,您必须在文件solrconfig.xml中启用它

变化

<requestParsers enableRemoteStreaming="false" 

<requestParsers enableRemoteStreaming="true" 

另外,请查看文档 http://wiki.apache.org/solr/SolrSecurity#Streaming_Consideration

如果这解决了这个问题,请告诉我。启用远程流媒体时请注意安全性。