【问题标题】:Exact Phrase Not working properly in mongodb full text search确切的短语在 mongodb 全文搜索中无法正常工作
【发布时间】:2016-05-11 07:06:12
【问题描述】:

我目前在使用 or 条件的 MongoDB 中的全文搜索功能方面遇到了一些问题。特别是在尝试使用 or 条件匹配精确短语时。

确切的短语和/或条件在 mongodb 全文搜索中无法正常工作

{
$text: { $search: "cake \"coffee shop\"" }
}

我想要找到所有包含“cake”或“coffee shop”的文档的结果:

【问题讨论】:

    标签: mongodb full-text-search database


    【解决方案1】:

    看看here

    如果搜索字符串包含短语,搜索将与搜索字符串中的任何其他词进行 AND;例如搜索 "\"twinkle twinkle\" little star" 搜索 "twinkle twinkle" and ("little" or "star")。

    【讨论】:

      猜你喜欢
      • 2016-01-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-12-02
      • 2015-10-19
      • 2023-03-28
      • 2013-04-16
      • 1970-01-01
      相关资源
      最近更新 更多