[英]Custom score in Elastic Search
我有一個索引,其中每個文檔代表一個班級,其中包含學生列表和教師列表。
這是映射:
{
"properties" : {
"students" : {
"include_in_root" : 1,
"type" : "nested",
"properties" : {
"name" : {
"first" : "text",
"last" : "text",
},
},
"email" : { "type" : "string", "index" : "not_analyzed" },
},
"teachers" : {
"include_in_root" : 0,
"include_in_all" : 0,
"type" : "nested",
"properties" : {
"name" : {
"title" : { "type" : "string", "index" : "not_analyzed" },
"first" : "text",
"last" : "text",
},
},
},
},
}
我想影響Elastic Search的評分功能,這樣它將為具有匹配技術人員的文檔提供更高的評分。
例如,如果我搜索“ Smith”,我希望與史密斯老師在一起的文檔要比與學生史密斯老師在一起的文檔得分更高。
有誰知道該如何在彈性搜索中完成? 換句話說,如何返回某些邏輯排序的結果?
提前致謝!
在這里回答: https ://groups.google.com/forum/?fromgroups#!search /%22使用$ 20a $ 20bool $ 20query $ 20to $ 20run $ 20two $ 20nested $ 20queries%22 / elasticsearch / XTAb7eHcbqI / UgnKDh7ou48J
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.