Hi,
At boostrap, some settings are pushed to elastic search : analyser/filter/tokenizers.
But this time, I’am stucked on one filter I don’t manage to send :
[Conditional token filter | Elasticsearch Guide [8.2] | Elastic](The conditionnal filter)
context.tokenFilter("quote_condition")
.type("condition")
.param("script", "{ \"source\": \"return token.getPosition() > 0\"}");
I don’t find the value
syntax for the script
param. I attempted a lot of syntax yet :
.param("script", "{ \\\"source\\\": \\\"return token.getPosition() > 0\\\"}");
.param("script", "{\\\"script\\\": { \\\"source\\\": \\\"return token.getPosition() > 0\\\"}}");
.param("script", "{\"script\": { \"source\": \"return token.getPosition() > 0\"}}");
The error message is always the same :
"error": {
"root_cause": [
{
"type": "illegal_argument_exception",
"reason": "must specify either [source] for an inline script or [id] for a stored script"
}
],
"type": "illegal_argument_exception",
"reason": "must specify either [source] for an inline script or [id] for a stored script"
},
Any idea of the value
syntax ?
Thank you.