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

NullPointerException for search query without field specification and no default search field

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.3
    • Fix Version/s: 1.3
    • Component/s: search
    • Labels:
      None
    • Environment:

      Tomcat 5.5

      Description

      When posting a search query which does not specify a field to a Solr instance whose schema.xml does not have a default search field defined, a NullPointerException is raised.

        Activity

        Hide
        larsko Lars Kotthoff added a comment -

        Patch fixing the NullPointerException and instead returning a 400 and the message "no search field specified and no default search field defined" to the client.

        Show
        larsko Lars Kotthoff added a comment - Patch fixing the NullPointerException and instead returning a 400 and the message "no search field specified and no default search field defined" to the client.
        Hide
        larsko Lars Kotthoff added a comment -

        Repost of patch, the previous version was fundamentally flawed.

        Show
        larsko Lars Kotthoff added a comment - Repost of patch, the previous version was fundamentally flawed.
        Hide
        hossman Hoss Man added a comment -

        Lars: I tweaked your patch a bit to account for all the types of queries SolrQueryParser has special behavior for.

        SolrQueryParser can still generate NPEs from query types that it doesn't do anything special for (wildcards, fuzzy, etc...) because of the superclass, but this is still a big improvement ... thanks

        Committed revision 646092.

        Show
        hossman Hoss Man added a comment - Lars: I tweaked your patch a bit to account for all the types of queries SolrQueryParser has special behavior for. SolrQueryParser can still generate NPEs from query types that it doesn't do anything special for (wildcards, fuzzy, etc...) because of the superclass, but this is still a big improvement ... thanks Committed revision 646092.

          People

          • Assignee:
            hossman Hoss Man
            Reporter:
            larsko Lars Kotthoff
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development