2012-08-27 193 views
0

我的Lucene查詢出了什麼問題?我不明白爲什麼這會出錯。這個Lucene查詢有什麼問題?

[27/08/12 10:28:38:447 CEST]錯誤lucene.LuceneUtils:嘗試在當前索引中搜索結果時發生錯誤。 org.apache.lucene.queryParser.ParseException:無法解析「+ structurename:bijzonderedag​​en +(conhost:64d17170-C24B-4812-a788-78283d989a64 conhost:system_host)+ bijzonderedag​​en.vestigingnaam:阿姆斯特丹 + bijzonderedag​​en.iskoopzondag:JA + languageid:3 + deleted:false + working:true date1:​​[01/01/2003 TO 01/01/2012] + working:true +((permissions:p654b0931-1027-41f7-ad4d-173115ed8ec1.1p *) )':遇到「,「01/01/2012 」「 在第1行,列245 期待: 」]「 ...

at org.apache.lucene.queryParser.QueryParser.parse(QueryParser.java:187) 
at com.dotmarketing.util.lucene.LuceneUtils.prepareQuery(LuceneUtils.java:1195) 
at com.dotmarketing.util.lucene.LuceneUtils.searchInCurrentIndex(LuceneUtils.java:507) 
at com.dotmarketing.portlets.contentlet.business.ContentletFactoryDBImpl.indexSearch(ContentletFactoryDBImpl.java:388) 
at com.dotmarketing.portlets.contentlet.business.ContentletAPIImpl.searchIndex(ContentletAPIImpl.java:548) 
at com.dotmarketing.portlets.contentlet.business.ContentletAPIImpl.search(ContentletAPIImpl.java:453) 
at com.dotmarketing.portlets.contentlet.business.ContentletAPIImpl.search(ContentletAPIImpl.java:445) 
at com.dotmarketing.portlets.contentlet.business.ContentletAPIInterceptor.search(ContentletAPIInterceptor.java:1491) 
at com.dotmarketing.servlets.JSONContentServlet.service(JSONContentServlet.java:172) 
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 com.dotmarketing.filters.CMSFilter.doFilter(CMSFilter.java:484) 
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) 
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) 
at com.dotmarketing.filters.AutoLoginFilter.doFilter(AutoLoginFilter.java:61) 
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) 
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) 
at com.dotmarketing.cms.urlmap.filters.URLMapFilter.doFilter(URLMapFilter.java:313) 
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) 
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) 
at com.dotmarketing.filters.CharsetEncodingFilter.doFilter(CharsetEncodingFilter.java:140) 
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.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.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:465) 
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.valves.AccessLogValve.invoke(AccessLogValve.java:555) 
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) 
at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190) 
at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:291) 
at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:769) 
at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:698) 
at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:891) 
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690) 
at java.lang.Thread.run(Thread.java:662) 

引起:org.apache.lucene.queryParser.ParseException :在第1行第245列遇到「」01/01/2012「」。 期待: 「]」 ...

at org.apache.lucene.queryParser.QueryParser.generateParseException(QueryParser.java:1759) 
at org.apache.lucene.queryParser.QueryParser.jj_consume_token(QueryParser.java:1641) 
at org.apache.lucene.queryParser.QueryParser.Term(QueryParser.java:1399) 
at org.apache.lucene.queryParser.QueryParser.Clause(QueryParser.java:1250) 
at org.apache.lucene.queryParser.QueryParser.Query(QueryParser.java:1207) 
at org.apache.lucene.queryParser.QueryParser.TopLevelQuery(QueryParser.java:1167) 
at org.apache.lucene.queryParser.QueryParser.parse(QueryParser.java:182) 
... 41 more 

回答

1

你必須使用ISO格式的日期,例如[2003-01-01 TO 2012-01-01]

結賬this page。也可能與此SO question有關。