Solr
  1. Solr
  2. SOLR-529

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

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor 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
        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
        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
        Lars Kotthoff added a comment -

        Repost of patch, the previous version was fundamentally flawed.

        Show
        Lars Kotthoff added a comment - Repost of patch, the previous version was fundamentally flawed.
        Hide
        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
        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:
            Hoss Man
            Reporter:
            Lars Kotthoff
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development