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

There is no convenient way to define a numeric value in the Tuple function

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 7.7.1
    • Fix Version/s: None
    • Component/s: streaming expressions
    • Labels:
      None

      Description

      Background

      An easy way to experiment with Streaming Expressions is to define a tuple or list of tuples as a stream source and apply decorators\evaluators to this source. However, at the moment there is no easy way to define numeric values in a tuple because everything is being treated as a string.

      Steps to Reproduce

      Evaluate the following streaming expression:

      tuple(int=13, float=42.42, string=foo, quoted_string="bar")
      

      Actual Result:

      "docs": [
        {
          "int": "13",
          "float": "42.42",
          "string": "foo",
          "quoted_string": "bar"
        },
        ...
      ]
      

      Expected Result:

      "docs": [
        {
          "int": 13,
          "float": 42.42,
          "string": "foo",
          "quoted_string": "bar"
        },
        ...
      ]
      

      Possible Workarounds

      It's possible to get the desired result by applying val() function to each numeric value, but it's not convenient:

      tuple(int=val(13), float=val(42.42))
      

        Attachments

          Activity

            People

            • Assignee:
              jbernste Joel Bernstein
              Reporter:
              pseudochaos Oleksandr Chornyi
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: