我正在使用布尔查询,我想在Elasticsearch的脚本中使用匹配的结果值
{
"query": {
"nested": {
"path": "Names",
"query": {
"function_score": {
"script_score": {
"script": {
"source": "((_score)/(X+doc['Names.count'].value))*100"
}
},
"min_score": 80,
"query": {
"bool": {
"should": [
{
"match": {
"Names.name": "siriporn kanchana"
}
},
{
"match": {
"Names.name": "ganjana siriporn"
}
}
]
}
}
}
}
}
} }
在上面,我希望X值应该是匹配的字符串的长度示例,如果sirporn被匹配,那么我希望x =7。在elasticsearch中是否可能