sql - 在 Stackoverflow 上进行类似于 "Related Questions"的搜索使用的 SQL 是什么

标签 sql search text

我正在尝试在 Stackoverflow 上实现类似于“相关问题”的功能。
我该如何编写 SQL 语句,以便在我的数据库的 Title 和 Summary 字段中搜索类似问题?
如果我的问题是:“用于在 Stackoverflow 上进行类似于“相关问题”的搜索的 SQL 是什么”。
我能想到的步骤是;

  • 去掉引号
  • 将句子拆分为一组单词并对每个单词运行 SQL 搜索。

  • 如果我这样做,我猜我不会得到任何有意义的结果。我不确定服务器上是否启用了全文搜索,所以我没有使用它。使用全文搜索会有优势吗?
    我发现了一个类似的问题,但没有答案:similar question
    使用 SQL 2005

    最佳答案

    看看这个 podcast .

    One of our major performance optimizations for the “related questions” query is removing the top 10,000 most common English dictionary words (as determined by Google search) before submitting the query to the SQL Server 2008 full text engine. It’s shocking how little is left of most posts once you remove the top 10k English dictionary words. This helps limit and narrow the returned results, which makes the query dramatically faster.

    关于sql - 在 Stackoverflow 上进行类似于 "Related Questions"的搜索使用的 SQL 是什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/937059/

    相关文章:

    java - 如何在android中下载页面

    ios - 子类化 UIFont

    Jquery text() 与 IE7 中的标题进行比较

    text - ncurses 滚动窗口的文本内容

    php - 如何在 Doctrine 中对 more andWhere 或 Where 进行分组

    sql - 如何根据 Snowflake 中的列进行分层

    javascript - 如何为对象实现 glob ** ?

    sql - 数据的组合半转置

    mysql - 按案例订购

    jQuery 过滤列表而不隐藏父级