Solr
  1. Solr
  2. SOLR-2409

edismax unescaped colon returns no results

    Details

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

      Description

      The edismax query parser should behave OK when a colon is in the query, but does not refer to a field name.

      1. SOLR-2409.patch
        6 kB
        Yonik Seeley
      2. SOLR-2409.patch
        4 kB
        Yonik Seeley
      3. SOLR-2409-unescapedcolon.patch
        4 kB
        Ryan McKinley

        Issue Links

          Activity

          Hide
          Ryan McKinley added a comment -

          adding test and patch from SOLR-1553

          Show
          Ryan McKinley added a comment - adding test and patch from SOLR-1553
          Hide
          Ryan McKinley added a comment -

          From: https://issues.apache.org/jira/browse/SOLR-1553?focusedCommentId=12994448&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-12994448

          Adding:

          // Make sure the Boolean Query actually has somethign there
          if( parsedUserQuery instanceof BooleanQuery ) {
            if( ((BooleanQuery)parsedUserQuery).getClauses().length < 1 ) {
              parsedUserQuery = null;
            }
          }
          

          seems to fix thigns.

          I don't understand the bigger picture well enough to know the implications

          Show
          Ryan McKinley added a comment - From: https://issues.apache.org/jira/browse/SOLR-1553?focusedCommentId=12994448&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-12994448 Adding: // Make sure the Boolean Query actually has somethign there if ( parsedUserQuery instanceof BooleanQuery ) { if ( ((BooleanQuery)parsedUserQuery).getClauses().length < 1 ) { parsedUserQuery = null ; } } seems to fix thigns. I don't understand the bigger picture well enough to know the implications
          Hide
          Yonik Seeley added a comment -

          Here's a draft patch that takes the more direct approach of actually checking if the field name of a fielded query exists.

          Show
          Yonik Seeley added a comment - Here's a draft patch that takes the more direct approach of actually checking if the field name of a fielded query exists.
          Hide
          Yonik Seeley added a comment -

          One problem with the previous approach of checking for a zero length query is that it wouldn't handle cases like
          I loved Terminator 2: Judgement Day
          Because that gets truncated to (Terminator Day) which isn't zero length.

          Show
          Yonik Seeley added a comment - One problem with the previous approach of checking for a zero length query is that it wouldn't handle cases like I loved Terminator 2: Judgement Day Because that gets truncated to (Terminator Day) which isn't zero length.
          Hide
          Yonik Seeley added a comment -

          Here's an updated patch with tests (both from Ryan's patch and my own additions).

          Show
          Yonik Seeley added a comment - Here's an updated patch with tests (both from Ryan's patch and my own additions).
          Hide
          Yonik Seeley added a comment -

          committed to trunk & 3x

          Show
          Yonik Seeley added a comment - committed to trunk & 3x
          Hide
          Uwe Schindler added a comment -

          Bulk cose after release of 3.2

          Show
          Uwe Schindler added a comment - Bulk cose after release of 3.2
          Hide
          Michael Watts added a comment -

          This seems to give up support for 'query:

          {!parser p1=v1 ... pn=vn}

          '. Is this intended? (as far as I know, this would decrease the expressiveness of edismax)

          Show
          Michael Watts added a comment - This seems to give up support for ' query : {!parser p1=v1 ... pn=vn} '. Is this intended? (as far as I know, this would decrease the expressiveness of edismax)
          Hide
          Michael Watts added a comment -

          (Sorry, I'm not familiar with the Jira syntax, there should be underscores on the extremes of 'query')

          Show
          Michael Watts added a comment - (Sorry, I'm not familiar with the Jira syntax, there should be underscores on the extremes of 'query')
          Hide
          Yonik Seeley added a comment -

          Hmmm, you're right... this was definitely not intended.

          Show
          Yonik Seeley added a comment - Hmmm, you're right... this was definitely not intended.
          Hide
          Michael Watts added a comment -

          I guess _val_ is another 'special' field to account for. Does anyone know of any others?

          Show
          Michael Watts added a comment - I guess _val_ is another 'special' field to account for. Does anyone know of any others?

            People

            • Assignee:
              Yonik Seeley
              Reporter:
              Ryan McKinley
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development