CustomScoreQueryBuilder param values unexpectedly cast to java.lang.String

The parameter values added to a CustomScoreQueryBuilder by
using .param(java.lang.String key, java.lang.Object value) end up being
Strings when retrieved in an implementation of, for example,
AbstractDoubleSearchScript. Somewhere the values are cast to
java.lang.String, but I couldn't find where. Is this behavior expected?

Cheers
Alex

No, it should maintain its native type (i.e. Double, or Integer). Can you
open an issue, I will have a look...

On Wed, Nov 2, 2011 at 12:15 AM, Alex
alessandro.usseglioviretta@gmail.comwrote:

The parameter values added to a CustomScoreQueryBuilder by
using .param(java.lang.String key, java.lang.Object value) end up being
Strings when retrieved in an implementation of, for example,
AbstractDoubleSearchScript. Somewhere the values are cast to
java.lang.String, but I couldn't find where. Is this behavior expected?

Cheers
Alex

alright, this is the Scala code to replicate the problem


and here is the stack trace

Cheers
Alex

Double and Int work as expected. Are there limitations in the types that
can be used?

Alex

A hint that might help solve the riddle: if the value placed into the param
is a java.util.HashMap instead of Test,
that is .param("test", someHashMap<String, Test>)), it works as expected.

Alex

The parameters supported are only the ones supported by "json", i.e. native
types (numeric, string), and map/lists. Are you trying to pass a "custom"
class? In this case, it will just pass the "toString" representation of it.

On Wed, Nov 2, 2011 at 3:31 AM, Alex
alessandro.usseglioviretta@gmail.comwrote:

A hint that might help solve the riddle: if the value placed into the
param is a java.util.HashMap instead of Test,
that is .param("test", someHashMap<String, Test>)), it works as expected.

Alex

ok, that makes sense. Thanks!

Alex