你的浏览器禁用了JavaScript, 请开启后刷新浏览器获得更好的体验!
输入关键字进行搜索
搜索:
没有找到相关结果
liuyeye
赞同来自:
"script_score": { "script": { "source": "Map map = params.a; return map['a'];", "lang": "painless", "params":{"a":"{{a}}"}, } } [quote]
"script_score": { "script": { "source": "Map map = params.a; return map['a'];", "lang": "painless", "params":{"a":"{{a}}"}, } }
doom
{{#toJson}}parameter{{/toJson}}
GET _search/template { "source": "{ \"query\": { \"terms\": {{#toJson}}statuses{{/toJson}} }}", "params": { "statuses" : { "status": [ "pending", "published" ] } } }
{ "query": { "terms": { "status": [ "pending", "published" ] } } }
要回复问题请先登录或注册
3 个回复
liuyeye
赞同来自:
传入params.a为map类型:
"reason": "class_cast_exception: java.lang.String cannot be cast to java.util.Map",
[/quote]
doom
赞同来自:
如果是 查询模板,更加灵活;变量直接{{}},;外部直接给字段和参数;具体你的问题,不知道能否解决;还望详细描述目的;为啥需要返回Map。
doom
赞同来自:
Converting parameters to JSONedit
The function can be used to convert parameters like maps and array to their JSON representation: