Solrj 查询响应
Solrj query Response
您好,我正在尝试从 apache solr 获取查询结果。
我正在使用 Solrj jar 借助 QueryResponse class 获取查询结果,但出现以下错误。
异常消息:
执行查询时出错
异常跟踪:
at org.apache.solr.client.solrj.request.QueryRequest.process(QueryRequest.java:100)
at org.apache.solr.client.solrj.SolrServer.query(SolrServer.java:301)
at com.adastra.candidate.search.solr.action.SolrSearchAction.aaaExecute(SolrSearchAction.java:48)
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.doGet(ActionServlet.java:449)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
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)
你能告诉我我哪里做错了吗
谢谢佩里克利,
但它得到了整理。
代码如下:
SolrServer solrServer = new HttpSolrServer("http://localhost:8983/solr");
QueryResponse qResponse = solrServer.query(queryForFecthing);
实际上在创建 QueryResponse
的对象时出现异常,即 qResponse
我认为这是因为我将其作为参数传递的查询(即上面的是 'queryForFecting ').
但这是错误的假设,实际上是因为无效的 url 通过了
在为 SolrServer
创建对象期间(即 solrServer )
您好,我正在尝试从 apache solr 获取查询结果。
我正在使用 Solrj jar 借助 QueryResponse class 获取查询结果,但出现以下错误。
异常消息:
执行查询时出错
异常跟踪:
at org.apache.solr.client.solrj.request.QueryRequest.process(QueryRequest.java:100)
at org.apache.solr.client.solrj.SolrServer.query(SolrServer.java:301)
at com.adastra.candidate.search.solr.action.SolrSearchAction.aaaExecute(SolrSearchAction.java:48)
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.doGet(ActionServlet.java:449)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
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)
你能告诉我我哪里做错了吗
谢谢佩里克利, 但它得到了整理。
代码如下:
SolrServer solrServer = new HttpSolrServer("http://localhost:8983/solr");
QueryResponse qResponse = solrServer.query(queryForFecthing);
实际上在创建 QueryResponse
的对象时出现异常,即 qResponse
我认为这是因为我将其作为参数传递的查询(即上面的是 'queryForFecting ').
但这是错误的假设,实际上是因为无效的 url 通过了
在为 SolrServer
创建对象期间(即 solrServer )