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

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 7.7.1
    • None
    • streaming expressions
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: