繁体   English   中英

Elastic Search中的自定义分数

[英]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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM