【问题标题】:ElasticSearch - how to give priority to the matching from the same rowElasticSearch - 如何优先匹配来自同一行的匹配
【发布时间】:2012-11-18 16:16:06
【问题描述】:

我在 ElasticSearch 0.19.11 中有以下文档,使用:

{ "title": "dogs species",
    "col_names": [ "name", "description", "country_of_origin" ],
    "rows": [
        { "row": [ "Boxer", "good dog", "Germany" ] },
        { "row": [ "Irish Setter", "great dog", "Ireland" ] }
    ]
}
{ "title": "Misc stuff",
    "col_names": [ "foo" ],
    "rows": [
        { "row":    [ "Setter is impotant" ] },
        { "row":     [ "Ireland is green" ] }
    ]
}

映射如下:

{
    "table" : {
        "properties" : {
            "title" : {"type" : "string"},
            "col_names" : {"type" : "string"},
            "rows" : {
                "properties" : {
                    "row" : {"type" : "string"}
                }
            }
        }
    }
}

问题:我现在正在搜索“Ireland Setter”,对于在同一行中包含搜索词的文档,我需要获得更高的分数。

目前第二个文档的得分为 0.22,而第一个文档的得分为 0.14。

在这种情况下,我希望第一个文档获得更高的分数,因为它在同一行中同时包含“Ireland”和“Setter”。怎么办?

【问题讨论】:

    标签: lucene elasticsearch


    【解决方案1】:

    在 ElasticSearch google-group 成员的大力合作下,找到了解决方案。 这是讨论的链接:https://groups.google.com/forum/?fromgroups#!topic/elasticsearch/4O9dff2SNhg

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-04-06
      • 2010-09-28
      • 2014-07-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多