The <x>::text inline cast depends on ToString to make the cast, which always returns keyword.
It could make sense in ToString, but a <x>::text cast is expected to return a text.
FROM test
| eval x = CASE(true, text_field, "txt"::text)
Result:
{
"error": {
"root_cause": [
{
"type": "verification_exception",
"reason": "Found 1 problem line 4:12: third argument of [CASE(true, text_field, \"txt\"::text)] must be [text], found value [\"txt\"::text] type [keyword]"
}
],
"type": "verification_exception",
"reason": "Found 1 problem line 4:12: third argument of [CASE(true, text_field, \"txt\"::text)] must be [text], found value [\"txt\"::text] type [keyword]"
},
"status": 400
}
The
<x>::text
inline cast depends onToString
to make the cast, which always returnskeyword
. It could make sense inToString
, but a<x>::text
cast is expected to return atext
.Reproduce with:
Query:
Result:
Note that the column type is "keyword".
Another example
Index
test
with mapping:Query:
Result: