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

edismax treat operator as a keyword when a query parameter 'qf' contains inexist field.

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 5.2.1, 5.5.1, 6.2.1
    • Fix Version/s: None
    • Component/s: None
    • Security Level: Public (Default Security Level. Issues are Public)
    • Labels:
      None

      Description

      edismax treat operator as a keyword when a query parameter 'qf' contains inexist field.

      ex. ('hoge' does not existing in the schema.)
      q=Japan OR Tokyo
      defType=edismax
      qf=title hoge

      you will get result containing keywords 'Japan' or 'OR' or 'Tokyo' in Title.
      also, you can get the following parsed query with debugQuery=true.

      <str name="parsedquery_toString">+((title:Japan) (title:OR) (title:Tokyo))</str>
      
      1. SOLR-9677.patch
        3 kB
        Takumi Yoshida

        Activity

        Hide
        erickerickson Erick Erickson added a comment -

        Just confirmed on trunk and 6x...

        Show
        erickerickson Erick Erickson added a comment - Just confirmed on trunk and 6x...
        Hide
        dsmiley David Smiley added a comment -

        yep; this has bitten me and a customer of mine before. I thought there was an existing issue for it but can't find it so maybe not.

        Essentially, we should make Solr complain loudly (fail) if qf/df doesn't match a field in the schema.

        Show
        dsmiley David Smiley added a comment - yep; this has bitten me and a customer of mine before. I thought there was an existing issue for it but can't find it so maybe not. Essentially, we should make Solr complain loudly (fail) if qf/df doesn't match a field in the schema.
        Hide
        yoshi0309 Takumi Yoshida added a comment -

        I read some codes.

        If the edismax parser failed to parse the user query because of RuntimeException (detail message = UnknowField) ExtendedDismaxQParser.parseOriginalQuery method returns null. after that, operators which are contained in user query are escaped as Keyword and parsed.

        https://github.com/apache/lucene-solr/blob/master/solr/core/src/java/org/apache/solr/search/ExtendedDismaxQParser.java#L185-L189

        so i think , as David mentioned, insted of changing parsing logic, we shuld show exception in log file.

        Show
        yoshi0309 Takumi Yoshida added a comment - I read some codes. If the edismax parser failed to parse the user query because of RuntimeException (detail message = UnknowField) ExtendedDismaxQParser.parseOriginalQuery method returns null. after that, operators which are contained in user query are escaped as Keyword and parsed. https://github.com/apache/lucene-solr/blob/master/solr/core/src/java/org/apache/solr/search/ExtendedDismaxQParser.java#L185-L189 so i think , as David mentioned, insted of changing parsing logic, we shuld show exception in log file.
        Hide
        yoshi0309 Takumi Yoshida added a comment -

        patch

        Show
        yoshi0309 Takumi Yoshida added a comment - patch

          People

          • Assignee:
            Unassigned
            Reporter:
            yoshi0309 Takumi Yoshida
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:

              Development