【发布时间】:2015-07-11 07:20:54
【问题描述】:
我想做一个字段折叠顶部点击聚合,完全按照此处记录:
尤其是这一段是个问题:
"top_hit": {
"max": {
"script": "_score"
}
}
因为生产环境配置有:
script.disable_dynamic: sandbox
这意味着我不能使用 groovy 脚本,而不会出现以下错误:
nested: ScriptException[dynamic scripting for [groovy] disabled];
如果我像这样更改查询:
"top_hit": {
"max": {
"lang": "expression",
"script": "_score"
}
}
我收到不同类型的错误:
nested: IllegalStateException[Expressions referencing the score can only be used for sorting];
弹性搜索版本为 1.5.2。有没有办法做我想做的事(使用 lucene 表达式)?
【问题讨论】:
标签: elasticsearch