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

        Lars Kotthoff created issue -
        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.
        Lars Kotthoff made changes -
        Field Original Value New Value
        Attachment solr-default-search-query.patch [ 12379231 ]
        Lars Kotthoff made changes -
        Attachment solr-default-search-query.patch [ 12379231 ]
        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.
        Lars Kotthoff made changes -
        Attachment solr-default-search-query.patch [ 12379232 ]
        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.
        Hoss Man made changes -
        Resolution Fixed [ 1 ]
        Status Open [ 1 ] Resolved [ 5 ]
        Assignee Hoss Man [ hossman ]
        Fix Version/s 1.3 [ 12312486 ]
        Lars Kotthoff made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        5d 17h 21m 1 Hoss Man 08/Apr/08 21:48
        Resolved Resolved Closed Closed
        107d 4h 11m 1 Lars Kotthoff 25/Jul/08 01:59

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development