NutzCN Logo
精华 需要手动判断'\'符号吗?
发布于 2953天前 作者 shusheng 1634 次浏览 复制 上一个帖子 下一个帖子
标签: lucene
org.apache.lucene.queryparser.classic.ParseException: Cannot parse '\': Lexical error at line 1, column 2.  Encountered: <EOF> after : ""
	at org.apache.lucene.queryparser.classic.QueryParserBase.parse(QueryParserBase.java:130) ~[lucene-queryparser-4.9.1.jar:4.9.1 1625909 - mike - 2014-09-18 04:03:41]
	at net.wendal.nutzbook.service.forum.ForumTopicSearchService.searchForum(ForumTopicSearchService.java:174) ~[classes/:?]
	at net.wendal.nutzbook.module.forum.ForumModule.search(ForumModule.java:410) ~[classes/:?]
	at net.wendal.nutzbook.module.forum.ForumModule$$NUTZAOP._aop_invoke(ForumModule.java:1) ~[nutz-1.r.59-SNAPSHOT.jar:?]
	at org.nutz.aop.InterceptorChain.invoke(InterceptorChain.java:77) ~[nutz-1.r.59-SNAPSHOT.jar:?]
	at org.nutz.aop.InterceptorChain.doChain(InterceptorChain.java:57) ~[nutz-1.r.59-SNAPSHOT.jar:?]
	at net.wendal.nutzbook.util.RedisInterceptor.filter(RedisInterceptor.java:25) ~[classes/:?]
	at org.nutz.aop.InterceptorChain.doChain(InterceptorChain.java:60) ~[nutz-1.r.59-SNAPSHOT.jar:?]
	at net.wendal.nutzbook.module.forum.ForumModule$$NUTZAOP.search(ForumModule.java:1) ~[nutz-1.r.59-SNAPSHOT.jar:?]
	at net.wendal.nutzbook.module.forum.ForumModule$$FASTCLASS._invoke(ForumModule.java:1) ~[nutz-1.r.59-SNAPSHOT.jar:?]
	at org.nutz.lang.reflect.AbstractFastClass.invoke(AbstractFastClass.java:143) ~[nutz-1.r.59-SNAPSHOT.jar:?]
	at org.nutz.lang.reflect.FastClassFactory.invoke(FastClassFactory.java:67) ~[nutz-1.r.59-SNAPSHOT.jar:?]
	at org.nutz.mvc.impl.processor.MethodInvokeProcessor.process(MethodInvokeProcessor.java:27) ~[nutz-1.r.59-SNAPSHOT.jar:?]
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44) ~[nutz-1.r.59-SNAPSHOT.jar:?]
	at org.nutz.mvc.impl.processor.AdaptorProcessor.process(AdaptorProcessor.java:33) ~[nutz-1.r.59-SNAPSHOT.jar:?]
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44) ~[nutz-1.r.59-SNAPSHOT.jar:?]
	at org.nutz.mvc.impl.processor.ActionFiltersProcessor.process(ActionFiltersProcessor.java:58) ~[nutz-1.r.59-SNAPSHOT.jar:?]
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44) ~[nutz-1.r.59-SNAPSHOT.jar:?]
	at org.nutz.integration.shiro.NutShiroProcessor.process(NutShiroProcessor.java:126) ~[nutz-integration-shiro-1.r.58.jar:?]
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44) ~[nutz-1.r.59-SNAPSHOT.jar:?]
	at org.nutz.mvc.impl.processor.ModuleProcessor.process(ModuleProcessor.java:123) ~[nutz-1.r.59-SNAPSHOT.jar:?]
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44) ~[nutz-1.r.59-SNAPSHOT.jar:?]
	at org.nutz.mvc.impl.processor.EncodingProcessor.process(EncodingProcessor.java:27) ~[nutz-1.r.59-SNAPSHOT.jar:?]
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44) ~[nutz-1.r.59-SNAPSHOT.jar:?]
	at org.nutz.mvc.impl.processor.UpdateRequestAttributesProcessor.process(UpdateRequestAttributesProcessor.java:15) ~[nutz-1.r.59-SNAPSHOT.jar:?]
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44) ~[nutz-1.r.59-SNAPSHOT.jar:?]
	at net.wendal.nutzbook.mvc.DailyUniqueUsersProcessor.process(DailyUniqueUsersProcessor.java:48) ~[classes/:?]
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44) ~[nutz-1.r.59-SNAPSHOT.jar:?]
	at net.wendal.nutzbook.mvc.LogTimeProcessor.process(LogTimeProcessor.java:19) ~[classes/:?]
	at org.nutz.mvc.impl.NutActionChain.doChain(NutActionChain.java:44) [nutz-1.r.59-SNAPSHOT.jar:?]
	at org.nutz.mvc.impl.ActionInvoker.invoke(ActionInvoker.java:68) [nutz-1.r.59-SNAPSHOT.jar:?]
	at org.nutz.mvc.ActionHandler.handle(ActionHandler.java:31) [nutz-1.r.59-SNAPSHOT.jar:?]
	at org.nutz.mvc.NutFilter.doFilter(NutFilter.java:198) [nutz-1.r.59-SNAPSHOT.jar:?]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) [catalina.jar:9.0.0.M11]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) [catalina.jar:9.0.0.M11]
	at com.alibaba.druid.support.http.WebStatFilter.doFilter(WebStatFilter.java:123) [druid-1.0.25.jar:1.0.25]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) [catalina.jar:9.0.0.M11]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) [catalina.jar:9.0.0.M11]
	at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449) [shiro-web-1.3.2.jar:1.3.2]
	at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365) [shiro-web-1.3.2.jar:1.3.2]
	at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90) [shiro-core-1.3.2.jar:1.3.2]
	at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83) [shiro-core-1.3.2.jar:1.3.2]
	at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383) [shiro-core-1.3.2.jar:1.3.2]
	at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362) [shiro-web-1.3.2.jar:1.3.2]
	at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125) [shiro-web-1.3.2.jar:1.3.2]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) [catalina.jar:9.0.0.M11]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) [catalina.jar:9.0.0.M11]
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199) [catalina.jar:9.0.0.M11]
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:108) [catalina.jar:9.0.0.M11]
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472) [catalina.jar:9.0.0.M11]
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140) [catalina.jar:9.0.0.M11]
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) [catalina.jar:9.0.0.M11]
	at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:620) [catalina.jar:9.0.0.M11]
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) [catalina.jar:9.0.0.M11]
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:349) [catalina.jar:9.0.0.M11]
	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:784) [tomcat-coyote.jar:9.0.0.M11]
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) [tomcat-coyote.jar:9.0.0.M11]
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:802) [tomcat-coyote.jar:9.0.0.M11]
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1455) [tomcat-coyote.jar:9.0.0.M11]
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-coyote.jar:9.0.0.M11]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_102]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_102]
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-util.jar:9.0.0.M11]
	at java.lang.Thread.run(Thread.java:745) [?:1.8.0_102]
Caused by: org.apache.lucene.queryparser.classic.TokenMgrError: Lexical error at line 1, column 2.  Encountered: <EOF> after : ""
	at org.apache.lucene.queryparser.classic.QueryParserTokenManager.getNextToken(QueryParserTokenManager.java:1133) ~[lucene-queryparser-4.9.1.jar:4.9.1 1625909 - mike - 2014-09-18 04:03:41]
	at org.apache.lucene.queryparser.classic.QueryParser.jj_ntk(QueryParser.java:638) ~[lucene-queryparser-4.9.1.jar:4.9.1 1625909 - mike - 2014-09-18 04:03:41]
	at org.apache.lucene.queryparser.classic.QueryParser.Modifiers(QueryParser.java:136) ~[lucene-queryparser-4.9.1.jar:4.9.1 1625909 - mike - 2014-09-18 04:03:41]
	at org.apache.lucene.queryparser.classic.QueryParser.Query(QueryParser.java:180) ~[lucene-queryparser-4.9.1.jar:4.9.1 1625909 - mike - 2014-09-18 04:03:41]
	at org.apache.lucene.queryparser.classic.QueryParser.TopLevelQuery(QueryParser.java:170) ~[lucene-queryparser-4.9.1.jar:4.9.1 1625909 - mike - 2014-09-18 04:03:41]
	at org.apache.lucene.queryparser.classic.QueryParserBase.parse(QueryParserBase.java:120) ~[lucene-queryparser-4.9.1.jar:4.9.1 1625909 - mike - 2014-09-18 04:03:41]
	... 63 more
2 回复

lucene好像有抹除特殊字符的方法,查查它的文档吧

当然,最暴力的方法就是replace掉

QueryParser.escape(keys);
添加回复
请先登陆
回到顶部