不为失败找理由,要为成功找方法。

为什么我的索引里面_score是为null呢?

Elasticsearch | 作者 xujianxing | 发布于2016年06月15日 | 阅读数:10353

如下是我存储的值。
 "_index" : "supercoach",
"_type" : "supercoach_wxcard",
"_id" : "66794",
"_score" : null,
"_source" : {
"addinapp" : 0,
"avggradtime" : 0,
"basicWeightScore" : 130,
"bgimg" : "/common/img/images/bg10.jpg",
"cityid" : 1,
"classInfo" : [ {
"cartype" : "C1",
"classname" : "贵宾班",
"createtime" : 1463126879703,
"id" : 41875,
"mobile" : "18510649985",
"openid" : "",
"price" : 2000,
"remark" : "周一至周五,两人一车"
}, {
"cartype" : "B1",
"classname" : "普通班",
"createtime" : 1463126879703,
"id" : 41874,
"mobile" : "18510649985",
"openid" : "",
"price" : 5800,
"remark" : "周六至周日,两人一车"
} ],
为什么_score是为null呢?
我该如何为_score赋值? 就是每次都会有一个基本值。然后根据不同的数据来变化_score。这个score能自动变吗?我能自己设置么?并且能够根据这个_score来排序
已邀请:

[已注销]

赞同来自: xujianxing

你用了排序  _score就为null.

Arya

赞同来自:

trace_score设置为true ,可以显示得分

code4j - coder github: https://github.com/rpgmakervx

赞同来自:

如果使用了额外字段进行排序,还想保留得分,需要手动在堆_score字段进行排序

要回复问题请先登录注册