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

          Bill Bell created issue -
          Bill Bell made changes -
          Field Original Value New Value
          Description Would like the ability to use min(1,5,10,11) to return 1. To o that today it is parenthesis nightmare:
          min(min(min(1,5),10),11)

          Should extend max() as well.
          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.
          Bill Bell made changes -
          Link This issue is part of SOLR-2371 [ SOLR-2371 ]
          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
          Bill Bell made changes -
          Attachment SOLR-2757.patch [ 12494386 ]
          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
          Bill Bell made changes -
          Attachment SOLR-2757-2.patch [ 12496380 ]
          Bill Bell made changes -
          Attachment SOLR-2757.patch [ 12494386 ]
          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.
          Hoss Man made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Assignee Hoss Man [ hossman ]
          Fix Version/s 3.5 [ 12317876 ]
          Fix Version/s 4.0 [ 12314992 ]
          Resolution Fixed [ 1 ]
          Hoss Man made changes -
          Assignee Hoss Man [ hossman ] Bill Bell [ billnbell ]
          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
          Uwe Schindler made changes -
          Status Resolved [ 5 ] Closed [ 6 ]

            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