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

NPE using http://localhost:8983/solr/select/?q=

Details

    Description

      null
      
      java.lang.NullPointerException
      	at java.io.StringReader.<init>(StringReader.java:33)
      	at org.apache.lucene.queryParser.QueryParser.parse(QueryParser.java:197)
      	at org.apache.solr.search.LuceneQParser.parse(LuceneQParserPlugin.java:78)
      	at org.apache.solr.search.QParser.getQuery(QParser.java:131)
      	at org.apache.solr.handler.component.QueryComponent.prepare(QueryComponent.java:89)
      	at org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:174)
      	at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:131)
      	at org.apache.solr.core.SolrCore.execute(SolrCore.java:1316)
      	at org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:338)
      	at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:241)
      	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1089)
      	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:365)
      	at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
      	at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
      	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:712)
      	at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
      	at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:211)
      	at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
      	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
      	at org.mortbay.jetty.Server.handle(Server.java:285)
      	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:502)
      	at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:821)
      	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:513)
      	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:208)
      	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:378)
      	at org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:226)
      	at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:442)
      
      RequestURI=/solr/select/
      

      Attachments

        1. SOLR-2001.patch
          3 kB
          Yonik Seeley

        Issue Links

          Activity

            yseeley@gmail.com Yonik Seeley added a comment - Here's a patch that implements the suggestions from http://search.lucidimagination.com/search/document/2e625d76f2b1fb78/missing_q_gives_500_error
            yseeley@gmail.com Yonik Seeley added a comment -

            committed.

            yseeley@gmail.com Yonik Seeley added a comment - committed.
            lancenorskog Lance Norskog added a comment -

            +many

            lancenorskog Lance Norskog added a comment - +many
            dsmiley David Smiley added a comment -

            By the way, this issue is actually a duplicate of SOLR-435 which I recently resolved by backporting this patch to 3x. I also made improvements (3x & 4x), namely added an empty string check for 'q', dismax support, and a test (by Hoss).

            dsmiley David Smiley added a comment - By the way, this issue is actually a duplicate of SOLR-435 which I recently resolved by backporting this patch to 3x. I also made improvements (3x & 4x), namely added an empty string check for 'q', dismax support, and a test (by Hoss).
            dsmiley David Smiley added a comment -

            I troubleshooted a user's query just now, discovering that the problem was that he had no 'q' parameter, and thus his 'fq' was irrelevant. Embarrassingly, I didn't notice this immediately. It's wonderful that a blank q no longer throws an error, as shown in the title of this issue. But what good is search that has no 'q' parameter at all? It should be an error. 'course if *:* were the default then this would be a non-issue – my preference but it's too late to argue that now.

            dsmiley David Smiley added a comment - I troubleshooted a user's query just now, discovering that the problem was that he had no 'q' parameter, and thus his 'fq' was irrelevant. Embarrassingly, I didn't notice this immediately. It's wonderful that a blank q no longer throws an error, as shown in the title of this issue. But what good is search that has no 'q' parameter at all? It should be an error. 'course if *:* were the default then this would be a non-issue – my preference but it's too late to argue that now.

            People

              Unassigned Unassigned
              sebb Sebb
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: