ElasticSearch DSL Script使用案例分享
the best elasticsearch highlevel java rest api-----bboss ElasticSearch DSL Script使用案例分享,涉及到的功能点: 脚本片段使用 多行文本使用 添加属性字段 1前言 先看看elasticsearch官方的script dsl块文本的写法:通过一对""" """来包含块文本 { "query": { "function_score": { "script_score": { "script": { "lang": "painless", "source": """ int total = 0; for (int i = 0; i < doc['goals'].length; ++i) { total += doc['goals'][i]; } return total; """ } } } } } 对应的bboss script dsl块文本的写法:通过一对@""" """来包含块文本 { "query": { "function_score": { "script_score": { "script":...