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

Function Queries: if() function

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.4.1
    • Fix Version/s: 4.0-ALPHA
    • Component/s: search
    • Labels:
      None

      Description

      Add an if() function which will enable conditional function queries.

      The function could be modeled after a spreadsheet if function (e.g: http://wiki.services.openoffice.org/wiki/Documentation/How_Tos/Calc:_IF_function)

      IF(test; value1; value2) where:
      test is or refers to a logical value or expression that returns a logical value (TRUE or FALSE).
      value1 is the value that is returned by the function if test yields TRUE.
      value2 is the value that is returned by the function if test yields FALSE.

      If value2 is omitted it is assumed to be FALSE; if value1 is also omitted it is assumed to be TRUE.

      Example use:
      if(color=="red"; 100; if(color=="green"; 50; 25))
      This function will check the document field "color", and if it is "red" return 100, if it is "green" return 50, else return 25.

        Attachments

        1. SOLR-2136.patch
          25 kB
          Yonik Seeley
        2. SOLR-2136.patch
          47 kB
          Yonik Seeley

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                janhoy Jan Høydahl
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: