这个Lucene查询有什么问题?

时间:2012-08-27 08:36:59

标签: java json servlets lucene

我的Lucene查询有什么问题?我无法理解为什么会出错。

[27/08/12 10:28:38:447 CEST] ERROR lucene.LuceneUtils:尝试在当前索引中搜索结果时出错。 org.apache.lucene.queryParser.ParseException:无法解析' + structurename:bijzonderedag​​en +(conhost:64d17170-c24b-4812-a788-78283d989a64 conhost:system_host)+ bijzonderedag​​en.vestigingnaam: Amsterdam + 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:遇到" " 01/01/2012""在第1行,第245栏。 期待:     "]" ...

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 个答案:

答案 0 :(得分:1)

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

结帐this page。也可能与此SO question有关。