Solr
  1. Solr
  2. SOLR-2757

Switch min(a,b) function to min(a,b,...)

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 3.4
    • Fix Version/s: 3.5, 4.0-ALPHA
    • Component/s: None
    • Labels:
      None

      Description

      Would like the ability to use min(1,5,10,11) to return 1. To do that today it is parenthesis nightmare:
      min(min(min(1,5),10),11)

      Should extend max() as well.

        Issue Links

          Activity

          Hide
          Bill Bell added a comment -

          You can test with:

          http://localhost:8983/solr/select?q=

          {!func}max%2810,3,8,7,5,4%29&fl=score

          http://localhost:8983/solr/select?q={!func}

          min%2810,3,8,7,5,4%29&fl=score

          Show
          Bill Bell added a comment - You can test with: http://localhost:8983/solr/select?q= {!func}max%2810,3,8,7,5,4%29&fl=score http://localhost:8983/solr/select?q= {!func} min%2810,3,8,7,5,4%29&fl=score
          Hide
          Bill Bell added a comment -

          This is ready to be committed to 4.0

          Show
          Bill Bell added a comment - This is ready to be committed to 4.0
          Hide
          Bill Bell added a comment -

          Can we get his committed. I have tested it extensively.

          Patch for 3x is needed.

          Show
          Bill Bell added a comment - Can we get his committed. I have tested it extensively. Patch for 3x is needed.
          Hide
          Hoss Man added a comment -

          Bill: the code looks good – could you please some basic tests? I think if you look at TestFunctionQuery there should already be some really straight forward testing of the two arg version of min & max – can you just add a few similar lines demonstrating that multiple args work properly?

          Show
          Hoss Man added a comment - Bill: the code looks good – could you please some basic tests? I think if you look at TestFunctionQuery there should already be some really straight forward testing of the two arg version of min & max – can you just add a few similar lines demonstrating that multiple args work properly?
          Hide
          Bill Bell added a comment -

          Test cases

          Show
          Bill Bell added a comment - Test cases
          Hide
          Hoss Man added a comment -

          Bill: thanks for the patch and the tests.

          committed to trunk r1176097, and merged to 3x r1176125.

          Show
          Hoss Man added a comment - Bill: thanks for the patch and the tests. committed to trunk r1176097, and merged to 3x r1176125.
          Hide
          Uwe Schindler added a comment -

          Bulk close after 3.5 is released

          Show
          Uwe Schindler added a comment - Bulk close after 3.5 is released

            People

            • Assignee:
              Bill Bell
              Reporter:
              Bill Bell
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 1h
                1h
                Remaining:
                Remaining Estimate - 1h
                1h
                Logged:
                Time Spent - Not Specified
                Not Specified

                  Development