Oleksandr Chornyi created SOLR-13525:
----------------------------------------

             Summary: There is no way to define a numeric value in the Tuple 
function
                 Key: SOLR-13525
                 URL: https://issues.apache.org/jira/browse/SOLR-13525
             Project: Solr
          Issue Type: Bug
      Security Level: Public (Default Security Level. Issues are Public)
          Components: streaming expressions
    Affects Versions: 7.7.1
            Reporter: Oleksandr Chornyi


h3. 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.
h3. Steps to Reproduce

Evaluate the following streaming expression:
{code:java}
tuple(int=13, float=42.42, string=foo, quoted_string="bar")
{code}
*Actual Result*:
{code}
"docs": [
  {
    "int": "13",
    "float": "42.42",
    "string": "foo",
    "quoted_string": "bar"
  },
  ...
]
{code}
*Expected Result*:
{code}
"docs": [
  {
    "int": 13,
    "float": 42.42,
    "string": "foo",
    "quoted_string": "bar"
  },
  ...
]
{code}
h3. Possible Workarounds

It's possible to get the desired result by applying {{val()}} function to each 
numeric value, but it's not convenient:
{code:java}
tuple(int=val(13), float=val(42.42))
{code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to