2

日付範囲のクエリを実行しようとしていますが、常に同じエラーが発生します。問題は、日付範囲に+文字を追加するときです

リクエスト:

http://192.168.10.202:8080/solr/PageRequests/select/?q=request_datetime:[2011-09-01T00:21:57Z TO 2011-09-01T01:21:57Z+1HOUR]&version=2.2&start=0&rows=10&indent=on

そしてスタックトレース:

at org.apache.solr.core.SolrCore.execute(SolrCore.java:1376)
at org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:365)
at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:260)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(    ApplicationFilterChain.java:243)    
at org.apache.catalina.core.Appl    icationFilterChain.doFilter(Applicat    ionFilterChain.    java:210)    
at org.ap    ache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.    java:225)    
at org.ap    ache.catalina.core.StandardContextValve.invoke(StandardContextValve.    java:169)    
at org.ap    ache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.    java:472)    
at org.ap    ache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at org.ap    ache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.ap    ache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
at org.ap    ache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.ap    ache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.ap    ache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.    java:999)    
at org.ap    ache.coyote.AbstractProtocol$AbstractConnectionHandler.process(    AbstractP    rotocol.java:565)    
at org.ap    ache.tomcat.util.    net.JIoEndpoint$SocketProcessor.run(JIoEndpoin    t.java:307)
at java.u    til.concurrent.Th    readPoolExecutor.runWorker(ThreadPoolExecutor.    java:1110)
at java.u    til.concurrent.Th    readPoolExecutor$Worker.run(ThreadPoolExecutor    .java:603)
at java.l    ang.Thread.run(Th    read.java:679)    
Caused by    : org.apache.luce    ne.queryParser    .ParseException: Cannot parse     'request_datetime:[2011-09-01T00:21:57Z TO 2011-09-01T01:21:57Z 1HOUR]    ':     Encounter    ed " <RANGEIN_GOO    P> "1HOUR "" a    t line 1, column 63.    
Was expec    ting:    
"]" ...    

at org.apache.lucene.queryParser.QueryParser.parse(QueryParser.java:211)
at org.apache.solr.search.LuceneQParser.parse(LuceneQParserPlugin.java:79)
at org.apache.solr.search.QParser.getQuery(QParser.java:143)
4

1 に答える 1

4

この方法でSolrを呼び出すので、+がURLエンコードされるように、つまり。に置き換えられるようにする必要があります%2B

于 2012-05-16T16:41:54.753 に答える