我只是想知道這個值是怎么來的
POST sneaker/_search
{
"query": {
"function_score": {
"functions": [
{
"gauss": {
"price": {
"origin": "300",
"scale": "200"
}
}
}
]
}
}
, "explain": true
}
查詢結果
"max_score" : 1.0,
"hits" : [
{
"_shard" : "[sneaker][0]",
"_node" : "29ds_f0VSM6_-eDNhdQPLw",
"_index" : "sneaker",
"_type" : "_doc",
"_id" : "6",
"_score" : 1.0,
"_source" : {
"brand" : "flite",
"price" : 300,
"rating" : 2,
"release_date" : "2020-12-21"
},
"_explanation" : {
"value" : 1.0,
"description" : "function score, product of:",
"details" : [
{
"value" : 1.0,
"description" : "*:*",
"details" : [ ]
},
{
"value" : 1.0,
"description" : "min of:",
"details" : [
{
"value" : 1.0,
"description" : "Function for field price:",
"details" : [
{
"value" : 1.0,
"description" : "exp(-0.5*pow(MIN[Math.max(Math.abs(300.0(=doc value) - 300.0(=origin))) - 0.0(=offset), 0)],2.0)/28853.900817779268)",
"details" : [ ]
}
]
},
我尋找高斯分布,但它與此不同。我想知道28853.900817779268價值是怎么來的
uj5u.com熱心網友回復:
如果您查看
使用 scale = 200 和 decay = 0.5(如果未指定,則為默認值),我們得到以下結果:
-200^2 / (2 * ln (0.5)) = -28853.90081
這就是您在查詢解釋中看到的內容。
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/425459.html
下一篇:通過API從kibana讀取日志
