Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-5697

Delete by query does not work properly with customly configured query parser

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 4.3.1
    • 4.7, 6.0
    • query parsers, update
    • None

    Description

      The shard with the configuration illustrating the issue is attached. Since the size of the archive exceed the upload limit, I have dropped the solr.war from the webapps directory. Please add it (SOLR 4.3.1).

      Also attached is example query parser maven project. The binary has been already deployed onto lib directories of each core.

      Start the shard using startUp_multicore.sh.

      1. curl 'http://localhost:8983/solr/metadata/update?commit=false&debugQuery=on' --data-binary '<delete><query>Title:this_title</query></delete>' -H "Content-type:text/xml"

      This query produces an exception:

      <?xml version="1.0" encoding="UTF-8"?>
      <response>
      <lst name="responseHeader"><int name="status">400</int><int name="QTime">33</int></lst><lst name="error"><str name="msg">Unknown query parser 'lucene'</str><int name="code">400</int></lst>
      </response>

      2. Change the multicore/metadata/solrconfig.xml and multicore/statements/solrconfig.xml by uncommenting the defType parameters on requestHandler name="/select".

      Issue the same query. Result is same:

      <?xml version="1.0" encoding="UTF-8"?>
      <response>
      <lst name="responseHeader"><int name="status">400</int><int name="QTime">30</int></lst><lst name="error"><str name="msg">Unknown query parser 'lucene'</str><int name="code">400</int></lst>
      </response>

      3. Keep the same config as in 2. and specify query parser in the local params:

      curl 'http://localhost:8983/solr/metadata/update?commit=false&debugQuery=on' --data-binary '<delete><query>

      {!qparser1}

      Title:this_title</query></delete>' -H "Content-type:text/xml"

      The result:

      <?xml version="1.0" encoding="UTF-8"?>
      <response>
      <lst name="responseHeader"><int name="status">400</int><int name="QTime">3</int></lst><lst name="error"><str name="msg">no field name specified in query and no default specified via 'df' param</str><int name="code">400</int></lst>
      </response>

      The reason being because our query parser is "mis-behaving" in that it removes colons from the input queries => we get on the server side:

      Modified input query: Title:this_title ---> Titlethis_title
      5593 [qtp2121668094-15] INFO org.apache.solr.update.processor.LogUpdateProcessor – [metadata] webapp=/solr path=/update params=

      {debugQuery=on&commit=false}

      {} 0 31
      5594 [qtp2121668094-15] ERROR org.apache.solr.core.SolrCore – org.apache.solr.common.SolrException: no field name specified in query and no default specified via 'df' param
      at org.apache.solr.parser.SolrQueryParserBase.checkNullField(SolrQueryParserBase.java:924)
      at org.apache.solr.parser.SolrQueryParserBase.getFieldQuery(SolrQueryParserBase.java:944)
      at org.apache.solr.parser.SolrQueryParserBase.handleBareTokenQuery(SolrQueryParserBase.java:765)
      at org.apache.solr.parser.QueryParser.Term(QueryParser.java:300)
      at org.apache.solr.parser.QueryParser.Clause(QueryParser.java:186)
      at org.apache.solr.parser.QueryParser.Query(QueryParser.java:108)
      at org.apache.solr.parser.QueryParser.TopLevelQuery(QueryParser.java:97)
      at org.apache.solr.parser.SolrQueryParserBase.parse(SolrQueryParserBase.java:160)
      at org.apache.solr.search.LuceneQParser.parse(LuceneQParserPlugin.java:72)
      at org.apache.solr.search.QParser.getQuery(QParser.java:142)
      at org.apache.solr.update.DirectUpdateHandler2.getQuery(DirectUpdateHandler2.java:319)
      at org.apache.solr.update.DirectUpdateHandler2.deleteByQuery(DirectUpdateHandler2.java:349)
      at org.apache.solr.update.processor.RunUpdateProcessor.processDelete(RunUpdateProcessorFactory.java:80)
      at org.apache.solr.update.processor.UpdateRequestProcessor.processDelete(UpdateRequestProcessor.java:55)
      at org.apache.solr.update.processor.DistributedUpdateProcessor.doDeleteByQuery(DistributedUpdateProcessor.java:931)
      at org.apache.solr.update.processor.DistributedUpdateProcessor.processDelete(DistributedUpdateProcessor.java:772)
      at org.apache.solr.update.processor.LogUpdateProcessor.processDelete(LogUpdateProcessorFactory.java:121)
      at org.apache.solr.handler.loader.XMLLoader.processDelete(XMLLoader.java:346)
      at org.apache.solr.handler.loader.XMLLoader.processUpdate(XMLLoader.java:277)
      at org.apache.solr.handler.loader.XMLLoader.load(XMLLoader.java:173)
      at org.apache.solr.handler.UpdateRequestHandler$1.load(UpdateRequestHandler.java:92)
      at org.apache.solr.handler.ContentStreamHandlerBase.handleRequestBody(ContentStreamHandlerBase.java:74)
      at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:135)
      at org.apache.solr.core.SolrCore.execute(SolrCore.java:1820)
      at org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:656)
      at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:359)
      at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:155)
      at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1307)
      at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:453)
      at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
      at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:560)
      at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
      at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1072)
      at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:382)
      at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
      at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1006)
      at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
      at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:255)
      at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:154)
      at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
      at org.eclipse.jetty.server.Server.handle(Server.java:365)
      at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:485)
      at org.eclipse.jetty.server.BlockingHttpConnection.handleRequest(BlockingHttpConnection.java:53)
      at org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:937)
      at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:998)
      at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:856)
      at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:240)
      at org.eclipse.jetty.server.BlockingHttpConnection.handle(BlockingHttpConnection.java:72)
      at org.eclipse.jetty.server.bio.SocketConnector$ConnectorEndPoint.run(SocketConnector.java:264)
      at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
      at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
      at java.lang.Thread.run(Thread.java:744)

      THE GENERAL PROBLEM: The default lucene parser not found => causing the above issues.

      Attachments

        1. query_parser_maven_project.tgz
          15 kB
          Dmitry Kan
        2. shard.tgz
          1.85 MB
          Dmitry Kan

        Issue Links

          Activity

            People

              Unassigned Unassigned
              dmitry_key Dmitry Kan
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: