Solr
  1. Solr
  2. SOLR-3453

edismax lowercaseOperators=false broken by SOLR-3026

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.6
    • Fix Version/s: 4.0-ALPHA, 5.0
    • Component/s: search
    • Labels:
      None

      Description

      The edismax lowercaseOperators=false option seems to have been broken by SOLR-3026. "foo and bar" and "foo or bar" are treated as "foo AND bar" and "foo OR bar", respectively, even when lowercaseOperators=false.

      Fix is rather simple, I think (though I haven't tested this). Current code:

              if (i>0 && i+1<clauses.size()) {
                if ("AND".equalsIgnoreCase(s)) {
                  s="AND";
                } else if ("OR".equalsIgnoreCase(s)) {
                  s="OR";
                }
              }

      Proposed code:

              if (lowercaseOperators) {
                if (i>0 && i+1<clauses.size()) {
                  if ("AND".equalsIgnoreCase(s)) {
                    s="AND";
                  } else if ("OR".equalsIgnoreCase(s)) {
                    s="OR";
                  }
                }
              }

      Also interesting is the treatment of "Or" and "oR", but I'll leave that as an exercise to the reader.

      1. SOLR-3453
        2 kB
        Erick Erickson
      2. SOLR-3026.patch
        2 kB
        Tomás Fernández Löbbe
      3. SOLR-3026.patch
        2 kB
        Tomás Fernández Löbbe

        Issue Links

          Activity

          Hide
          Tomás Fernández Löbbe added a comment -

          This patch includes the fix and a test case.

          Show
          Tomás Fernández Löbbe added a comment - This patch includes the fix and a test case.
          Hide
          Tomás Fernández Löbbe added a comment -

          Improved the test case a bit. The patch is for trunk.

          Show
          Tomás Fernández Löbbe added a comment - Improved the test case a bit. The patch is for trunk.
          Hide
          Erick Erickson added a comment -

          Correctly named patch.

          Show
          Erick Erickson added a comment - Correctly named patch.
          Hide
          Erick Erickson added a comment -

          Added correctly named patch.
          4x fix r: 1352249
          trunk fix r: 1352250

          Show
          Erick Erickson added a comment - Added correctly named patch. 4x fix r: 1352249 trunk fix r: 1352250
          Hide
          Erick Erickson added a comment -

          Thanks Tomás!

          Show
          Erick Erickson added a comment - Thanks Tomás!

            People

            • Assignee:
              Unassigned
              Reporter:
              Michael Ryan
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development