嘿~ 今天天气不错嘛

关于ES评分的一个问题

Elasticsearch | 作者 CoderSu | 发布于2018年04月04日 | 阅读数:3073

我在做一个文档阅读状态的功能,记录每个用户对于文档的阅读状态,当有一个用户阅读该文档时,我会在该文档下的一个字段(数组)中插入当前用户的id,达到记录用户阅读状态的效果.
但现在有一个问题,当我在字段中插入id后,该文档的评分却改变了,导致文档在原始列表中的位置改变,这不是我想要的结果,想问一下怎么才能让我这个插入操作对文档的评分无影响
已邀请:

CoderSu

赞同来自:

这是文档结构

{
"resume":{
"properties":{
"name":{
"type":"keyword"
},
"state":{
"type":"integer"
},
"job_type":{
"type":"integer"
},
"ismail":{
"type":"integer"
},
"sex":{
"type":"integer"
},
"school":{
"type":"keyword"
},
"education":{
"type":"integer"
},
"source":{
"type":"integer"
},
"recent_company":{
"type":"text",
"analyzer": "ik_smart",
"search_analyzer": "ik_smart"
},
"recent_position":{
"type":"text",
"analyzer": "ik_smart",
"search_analyzer": "ik_smart"
},
"work_time":{
"type":"integer"
},
"label":{
"type":"text",
"analyzer": "ik_smart",
"search_analyzer": "ik_smart"
},
"expect_position":{
"type":"text",
"analyzer": "ik_smart",
"search_analyzer": "ik_smart"
},
"basic":{
"type":"text",
"analyzer": "ik_smart",
"search_analyzer": "ik_smart"
},
"workExp":{
"type":"text",
"analyzer": "ik_smart",
"search_analyzer": "ik_smart"
},
"eduExp":{
"type":"text",
"analyzer": "ik_smart",
"search_analyzer": "ik_smart"
},
"proExp":{
"type":"text",
"analyzer": "ik_smart",
"search_analyzer": "ik_smart"
},
"resume_modify_time":{
"type":"date" 
},
"update_time":{
"type":"date" 
},
"resume_id":{
"type":"integer"
}
}
}
}
 

CoderSu

赞同来自:

这个是查询语句

{
"highlight": {},
"size": "15",
"query": {
"bool": {
"filter": {
"bool": {
"must_not": [],
"should": [],
"must": [{
"bool": {
"should": [{
"bool": {
"must": []
}
}]
}
}]
}
},
"must": {
"multi_match": {
"query": "原画",
"tie_breaker": "0.3",
"type": "best_fields",
"fields": [
"recent_position^2",
"label^2",
"expect_position^10"
]
}
}
}
},
"from": "0",
"_source": {
"include": [
"_id",
"name",
"sex",
"age",
"expect_position",
"expect_place",
"recent_company",
"school",
"education",
"label",
"resume_id",
"resume_modify_time",
"update_time",
"work_time",
"max_salary",
"min_salary",
"state",
"reading_im"
]
},
"sort": [{
"_score": {
"order": "desc"
}
},
{
"resume_modify_time": {
"order": "desc"
}
}
]
}

 

要回复问题请先登录注册