我想使用脚本过滤器来获得得分值等于maxScore值的所有匹配。但它不起作用。
{
"query": {
"filtered": {
"filter": {
"script": {
"script": "doc['match.score'].value == doc['match.maxScore'].value"
}
}
}
}
}
我有这个错误:
{
"error": "SearchPhaseExecutionException[Failed to execute phase [query], all shards failed; shardFailures {[yk_PnKg9SOaf1d8acCsjvw][cobink_search][0]: SearchParseException[[cobink_search][0]: from[-1],size[-1]: Parse Failure [Failed to parse source [{"query":{"filtered":{"filter":{"script":{"script":"doc['match.score'].value == doc['match.maxScore'].value"}}}}}]]]; nested: ScriptException[dynamic scripting for [groovy] disabled]; }{[0jYKWZlyQiiVPHlzmoMjkA][cobink_search][1]: RemoteTransportException[[Hammer Harrison][inet[/192.168.1.100:9300]][indices:data/read/search[phase/query]]]; nested: SearchParseException[[cobink_search][1]: from[-1],size[-1]: Parse Failure [Failed to parse source [{"query":{"filtered":{"filter":{"script":{"script":"doc['match.score'].value == doc['match.maxScore'].value"}}}}}]]]; nested: ScriptException[dynamic scripting for [groovy] disabled]; }{[yk_PnKg9SOaf1d8acCsjvw][cobink_search][2]: SearchParseException[[cobink_search][2]: from[-1],size[-1]: Parse Failure [Failed to parse source [{"query":{"filtered":{"filter":{"script":{"script":"doc['match.score'].value == doc['match.maxScore'].value"}}}}}]]]; nested: ScriptException[dynamic scripting for [groovy] disabled]; }{[yk_PnKg9SOaf1d8acCsjvw][cobink_search][3]: SearchParseException[[cobink_search][3]: from[-1],size[-1]: Parse Failure [Failed to parse source [{"query":{"filtered":{"filter":{"script":{"script":"doc['match.score'].value == doc['match.maxScore'].value"}}}}}]]]; nested: ScriptException[dynamic scripting for [groovy] disabled]; }{[0jYKWZlyQiiVPHlzmoMjkA][cobink_search][4]: RemoteTransportException[[Hammer Harrison][inet[/192.168.1.100:9300]][indices:data/read/search[phase/query]]]; nested: SearchParseException[[cobink_search][4]: from[-1],size[-1]: Parse Failure [Failed to parse source [{"query":{"filtered":{"filter":{"script":{"script":"doc['match.score'].value == doc['match.maxScore'].value"}}}}}]]]; nested: ScriptException[dynamic scripting for [groovy] disabled]; }]",
"status": 400
}
谢谢你们:)