You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by "Joel Bernstein (Jira)" <ji...@apache.org> on 2022/01/27 14:41:00 UTC

[jira] [Resolved] (SOLR-13525) There is no convenient way to define a numeric value in the Tuple function

     [ https://issues.apache.org/jira/browse/SOLR-13525?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Joel Bernstein resolved SOLR-13525.
-----------------------------------
    Resolution: Fixed

The *double* and *long* functions can now be used like this:

tuple(a=long(5))

> There is no convenient 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
>          Components: streaming expressions
>    Affects Versions: 7.7.1
>            Reporter: Oleksandr Chornyi
>            Assignee: Joel Bernstein
>            Priority: Minor
>
> 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
(v8.20.1#820001)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org