Lucene Lexical Search error

Description

There seems to be something wrong with cfsearch and/or Lucene.

We have a search form that submits to a CFSEARCH on a collection. We are searching an exact phrase, so it is in double quotes preceded by a plus.

This works...

<cfset request.criteria = '+"Two Words"' /> <cfsearch name="searchnews" collection="news" criteria="#request.criteria#" />

This throws an error...

<cfset request.criteria = '+"Three Word Search"' /> <cfsearch name="searchnews" collection="news" criteria="#request.criteria#" />

Cannot parse '"+""Three Word" Search"': Lexical error at line 1, column 29. Encountered: after : ""
Type: lucee.runtime.search.SearchException

I also tried it without the plus sign. That works, but it does not search for the phrase and instead return all matches for ANY word. I need an exact match for the phrase.

Environment

None

Attachments

1
  • 16 Mar 2018, 12:02 pm

Activity

Show:

Pothys - MitrahSoft 16 March 2018 at 15:30

I've added test case for this ticket & confirmed the issue happened. If we search the keyword with '+ "test test test" it throw error like "Cannot parse '"+""Test test test"': Lexical error at line 1, column 29. Encountered".

Pull request: https://github.com/lucee/Lucee/pull/418

Michael Offner 16 March 2018 at 15:07

that's fine

Michael Sprague 16 March 2018 at 13:26

Is that enough, or do you need more?

Michael Sprague 16 March 2018 at 13:25

lucee.runtime.exp.NativeException: Cannot parse '"""Three Word" Search"': Lexical error at line 1, column 24. Encountered: <EOF> after : "" at org.apache.lucene.queryParser.QueryParser.parse(QueryParser.java:178) at org.lucee.extension.search.lucene.LuceneSearchCollection._search(LuceneSearchCollection.java:553) at org.lucee.extension.search.SearchCollectionSupport.search(SearchCollectionSupport.java:598) at lucee.runtime.tag.Search.doStartTag(Search.java:312) at devms.test_cfm$cf.call(/devms/test.cfm:2) at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:939) at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:833) at lucee.runtime.listener.ClassicAppListener._onRequest(ClassicAppListener.java:63) at lucee.runtime.listener.MixedAppListener.onRequest(MixedAppListener.java:44) at lucee.runtime.PageContextImpl.execute(PageContextImpl.java:2405) at lucee.runtime.PageContextImpl._execute(PageContextImpl.java:2395) at lucee.runtime.PageContextImpl.executeCFML(PageContextImpl.java:2363) at lucee.runtime.engine.Request.exe(Request.java:44) at lucee.runtime.engine.CFMLEngineImpl._service(CFMLEngineImpl.java:1091) at lucee.runtime.engine.CFMLEngineImpl.serviceCFML(CFMLEngineImpl.java:1039) at lucee.loader.engine.CFMLEngineWrapper.serviceCFML(CFMLEngineWrapper.java:102) at lucee.loader.servlet.CFMLServlet.service(CFMLServlet.java:51) at javax.servlet.http.HttpServlet.service(HttpServlet.java:742) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:478) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:80) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342) at org.apache.coyote.ajp.AjpProcessor.service(AjpProcessor.java:486) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:861) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1455) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748) Caused by: lucee.runtime.search.SearchException: Cannot parse '"""Three Word" Search"': Lexical error at line 1, column 24. Encountered: <EOF> after : "" ... 39 more

Michael Offner 16 March 2018 at 09:18

do you have a full stacktrace of the exception?

Fixed

Details

Assignee

Reporter

Priority

Labels

New Issue warning screen

Before you create a new Issue, please post to the mailing list first https://dev.lucee.org

Once the issue has been verified, one of the Lucee team will ask you to file an issue

Created 16 March 2018 at 09:14
Updated 21 May 2024 at 18:56
Resolved 21 May 2024 at 18:56

Flag notifications