Вот так я сталкиваюсь с подобной проблемой.Предполагается, что для каждого упругого поискового упора он устанавливается в упругом поиске 6.5.
GET http://localhost:9200/
{
"name": "hBCIuC6",
"cluster_name": "elasticsearch",
"cluster_uuid": "HxBX1gFSSAOBcDuysqa16Q",
"version": {
"number": "6.4.2",
},
"tagline": "You Know, for Search"
}
DELETE http://localhost:9200/myindex
PUT http://localhost:9200/myindex/_doc/1
{
"my_score":0.99,
"item_id":1
}
{
"_index": "myindex",
"_type": "_doc",
"_id": "1",
"_version": 1,
"result": "created",
"_shards": {
"total": 2,
"successful": 1,
"failed": 0
},
"_seq_no": 0,
"_primary_term": 1
}
POST http://localhost:9200/myindex/_search
{
"query":{
"match_all":{
}
},
"rescore" : [ {
"window_size" : 10,
"query" : {
"score_mode": "multiply",
"rescore_query" : {
"function_score" : {
"script_score": {
"script": {
"source": "params._source.my_score"
}
}
}
}
}
} ]
}
{
"took": 54,
"timed_out": false,
"_shards": {
"total": 1,
"successful": 1,
"skipped": 0,
"failed": 1,
"failures": [
{
"shard": 3,
"index": "myindex",
"node": "hBCIuC6qQoKLQttBxHs20Q",
"reason": {
"type": "script_exception",
"reason": "runtime error",
"script_stack": [
"params._source.my_score",
" ^---- HERE"
],
"script": "params._source.demotion_seller",
"lang": "painless",
"caused_by": {
"type": "null_pointer_exception",
"reason": null
}
}
}
]
},
"hits": {
"total": 0,
"max_score": null,
"hits": []
}
}