solr - 字符串搜索字段多个值,所有单词必须匹配

标签 solr

目前我有这样的样本数据:

<doc>
<int name="name">Nice Dress</int>
<arr name="keyword">
  <str>best cocktail dress</str>
  <str>platform complete pumps</str>
  <str>platform pumps</str>
  <str>slip dress</str>
</arr>

我在“关键字”字段中使用了多个值。

案例1

defType:edismax
qf:keyword
q:cocktail dress

solr将返回数据。

案例2

defType:edismax
qf:keyword
q:coctail dress pump

它仍然返回数据,如果我们从示例数据中看到,没有关键字在每个关键字的一行中包含所有这 3 个单词('coctail' 'dress' 'pump')。 如何让solr不返回这个结果?

谢谢。

最佳答案

检查两个参数

positionIncrementGap - 对于多值字段,此参数将决定多值字段中两个字段之间的距离。如果该值为 100,则两个多值字段之间的距离将为 100 个位置。

注意 - 默认positionIncrementGap为0

检查qs query slop dismax 参数将决定项之间的斜率匹配。

关于solr - 字符串搜索字段多个值,所有单词必须匹配,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18509198/

相关文章:

hadoop - Hue Filebrowser Search仅在第一层进行搜索

solr - 如何查找 Solr 集合更新状态

java - 我可以在 Google App Engine 上使用 Tika 进行内容提取吗?

solr - 如何在solr中的固定位置对某些项目实现自定义排序顺序?

solr - 如何修复Java RuntimeException:找不到资源'solrconfig.xml'?

elasticsearch - 如何在cassandra上安装搜索引擎?

dynamic - 索引动态字段的 Solr 搜索查询

elasticsearch - 围绕 Elasticsearch 或Solr编写包装是个好主意吗

solr - Solr 3.6 出现一些延迟后,文档得到了反射(reflect)

SOLR 日期分面和 BC/BCE 日期/负日期范围