使用netstat -lntp来看看有侦听在网络某端口的进程。当然,也可以使用 lsof。

elasticsearch脚本无法使用

Elasticsearch | 作者 krugle | 发布于2017年08月18日 | 阅读数:2144

\"sqrt\" is not defined. (Script3.js#1)

一些sqrt,log等函数无法使用,script脚本已经安装了
POST /appstoreservicetest/app/_search
{
    "query": {
        "function_score":{
            "query":{
                "bool": {
                    "should": [
                        {
                           "match": {
                              "appName": "a"
                            }
                        },
                        {
                           "match": {
                              "appName": "滴滴出行"
                           }
                        }
                    ],        
                    "minimum_should_match":1
                }
            },
            "script_score": {
                "script": {
                    "lang":"javascript",
                    "inline":"sqrt(log10(1000000/10000 +10))  * sqrt(100) * sqrt((10 + 1))"
                }     
            }
        } 

    }
}



{
"error": {
"root_cause": [
{
"type": "ecma_error",
"reason": "ReferenceError: \"log10\" is not defined. (Script6.js#1)"
}
],
"type": "search_phase_execution_exception",
"reason": "all shards failed",
"phase": "query",
"grouped": true,
"failed_shards": [
{
"shard": 0,
"index": "appstoreservicetest",
"node": "rv6eXcVJSqyO-jXlv85niw",
"reason": {
"type": "ecma_error",
"reason": "ReferenceError: \"log10\" is not defined. (Script6.js#1)"
}
}
],
"caused_by": {
"type": "ecma_error",
"reason": "ReferenceError: \"log10\" is not defined. (Script6.js#1)"
}
},
"status": 500
}
已邀请:

shiyuan

赞同来自: krugle

改为
Math.sqrt(Math.log10(1000000/10000 +10))  * Math.sqrt(100) * Math.sqrt((10 + 1))

要回复问题请先登录注册