我正在使用Solr进行地址搜索,结果会因单词顺序不同而有所不同。

huangapple go评论43阅读模式
英文:

I'm using solr for address searching and I get different results depends on word order

问题

这是正确行为吗,还是我需要进行一些额外的设置?

我创建了一个自定义过滤器,用于删除特殊字符并添加同义词。

英文:

Is this correct behavior or do I need to do some extra setting?

I created custom filter where remove special characters and add synonyms

答案1

得分: 1

在Solr中,搜索是一个两步过程,首先匹配文档,然后对它们进行评分以排序结果。评分考虑了一个词与另一个词的距离,因此如果查询中词的顺序改变,评分会受到影响。

如果在字段定义中使用omitPositions="true"来省略单词位置的存储,搜索就不会受到词序的影响。在Solr字段文档中,您可以找到更多选项以及它们对搜索的影响描述。

英文:

the search in Solr is a two step process, first the documents are matched, and second they are scored for ordering the results. The scoring takes in account how near are one term to the other, so if the order of the words in the query change, the scoring is affected.

if you omit the storing of word positions with omitPositions="true" in the field definition, and then the search should not be affected by the word order. In the Solr fields documentation you have many more options and how they affect the search described.

huangapple
  • 本文由 发表于 2023年2月8日 19:43:56
  • 转载请务必保留本文链接:https://go.coder-hub.com/75385323.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定