无法在Solr中设置导出处理程序

时间:2016-10-04 11:20:56

标签: solr cloudera-cdh

我已按照此处的说明为Solr设置导出处理程序,并且在尝试检索数据时遇到问题:

Java.io.IOException: org.apache.solr.search.SyntaxError: xport RankQuery is required for xsort: rq={!xport}
at org.apache.solr.response.SortingResponseWriter.write(SortingResponseWriter.java:100)
at org.apache.solr.servlet.SolrDispatchFilter.writeResponse(SolrDispatchFilter.java:813)
at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:437)
at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:211)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.solr.servlet.SolrHadoopAuthenticationFilter$2.doFilter(SolrHadoopAuthenticationFilter.java:394)
at org.apache.hadoop.security.authentication.server.AuthenticationFilter.doFilter(AuthenticationFilter.java:589)
at org.apache.hadoop.security.token.delegation.web.DelegationTokenAuthenticationFilter.doFilter(DelegationTokenAuthenticationFilter.java:291)
at org.apache.hadoop.security.authentication.server.AuthenticationFilter.doFilter(AuthenticationFilter.java:552)
at org.apache.solr.servlet.SolrHadoopAuthenticationFilter.doFilter(SolrHadoopAuthenticationFilter.java:399)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.solr.servlet.HostnameFilter.doFilter(HostnameFilter.java:86)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
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:103)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:620)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.solr.search.SyntaxError: xport RankQuery is required for xsort: rq={!xport}
... 26 more

我已按照此说明中的说明设置了solrconfig.xml: Exporting Result Sets 所以我补充道:

<requestHandler name="/export" class="solr.SearchHandler">
  <lst name="invariants">
   <str name="rq">{!xport}</str>
   <str name="wt">xsort</str>
   <str name="distrib">false</str>
  </lst>
  <arr name="components">
   <str>query</str>
  </arr>
</requestHandler>

但是当我使用以下查询时,我得到上述错误:

http://big-d-cluster:8983/solr/trading/export?q=*%3A*&fl=id&sort=tradeTimestamp+desc

知道可能导致这种情况的原因吗?

我正在使用SolR 4.10,我没有使用Sorj所以它应该有用,所以我不是重复:Solrj exportIssue because user was not using SolR 4.10+

1 个答案:

答案 0 :(得分:0)

我发现如果Solr索引没有数据,则会收到上述错误。我填充它,它工作。