solr - Elasticsearch-国家相似度

标签 solr elasticsearch similarity relevance scoring

我有一个文档,其中包含许多字段,其中之一是country。许多文档具有相同的country

例如,当我针对match query进行fuzzycountry搜索并查询Belgium时,它将返回与Belgium国家/地区匹配的文档列表,但它们的得分均不同。我相信是由于tdidf的相似性以及其他文档 Realm 中belgium术语的存在等。

在这种情况下,我希望它返回相同的分数。我应该使用什么相似性?

更新

我有接下来的6个文件:

{country:"Austria", title: "house"}
{country:"Austria", title: "Austria village"}
{country: "Germany", title: "deutch hotel" }
{country:"Austria", title: ""}
{country: "USA", title: "Usa hotel" }
{country: "USA", title: "Usa another hotel" }

当我针对国家/地区执行匹配查询时:
{
   query: {match: {country: "Austria"}}
}

我回顾下一个结果:
[ {
  "_index" : "elasticdemo_docs",
  "_type" : "doc",
  "_id" : "1",
  "_score" : 1.0, "_source" : {country:"Austria", title: "Austria village"}
}, {
  "_index" : "elasticdemo_docs",
  "_type" : "doc",
  "_id" : "2",
  "_score" : 0.30685282, "_source" : {country:"Austria", title: "house"}
}, {
  "_index" : "elasticdemo_docs",
  "_type" : "doc",
  "_id" : "3",
  "_score" : 0.30685282, "_source" : {country:"Austria", title: ""}
} ]

我希望所有3个文档都收到相同的_score,因为它们作为国家/地区都具有Austria。我应该使用什么相似性?

最佳答案

似乎我发现了问题-它与以下内容有关:
http://www.elasticsearch.org/blog/understanding-query-then-fetch-vs-dfs-query-then-fetch/

使用dfs_query_then_fetch搜索类型后,我得到了预期的结果。

关于solr - Elasticsearch-国家相似度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22016735/

相关文章:

algorithm - 分组相似集算法

algorithm - 计算句子之间的相似度

solr - 如何通过 geodist() 的逆来提高 Solr 相关性分数

java - 使用 Logstash、ElasticSearch 和 Kibana 处理 Warc 文件

php - Apache Solr 搜索自动完成

hadoop - 关于 Guava jar 的问题

node.js - 具有两个字段和条件的 mongoosastic 搜索

colors - 如何从两个 RGB 值中找到一种颜色的 RGBA 值?

solr - 如何在solr中分词?

solr - 如何使用 Solr 的 FileListEntityProcessor 在搜索结果中显示文件名