在配对匹配中,公式2 *对配对/联合对* 100 ex:santhoshi在弹性索引文档值中,santhosh在查询中是searchin元素,然后在santhoshi = 8中没有配对,no.of pair匹配= 7,santhosh中的对没有= 7结果= 2 * 7 /(7_8)* 100 = 93%......我尝试了以下代码获取归档.sumDocFreq是“type”:“illegal_argument_exception,”reason“ :“未定义变量[字段]。”
{ "query": {
"function_score": {
"query": {
"match": {
"Name":"santhosh"
}
},
"min_score":100,
"functions": [
{
"script_score": {
"script": {
"params" : {
"inputpairlength": 6 },
"source": "double tf = doc.freq; double ttf = field.sumDocFreq; return (2* tf /(params.inputpairlength + ttf)) * 100;"
}
}
}
]
}
}
}
"settings": {
"similarity": {
"scripted_tfidf": {
"type": "scripted",
"script": {
"source": "double tf = doc.freq; double ttf = field.sumDocFreq; return tf / (params.inputpairlength+ttf) * 100;"
}
}
},
getting param.input is not defined
I need to pass parameter and calcluate score using this "double tf = doc.freq; double ttf = field.sumDocFreq; return tf / (params.inputpairlength+ttf) * 100