2012-05-16 3 views
2

날짜 범위 쿼리를 수행하려고하는데 항상 같은 오류가 있습니다. 내가 날짜 범위에 + 문자를 추가 할 때 문제는Solr 기간 쿼리

요청 :

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

이 방식으로 SOLR를 호출하고 있기 때문에, +이 URL 인코딩 됨 (예 : %2B)으로 변경해야합니다.

+0

잘 작동합니다. 감사합니다. :) –