我正在尝试在 Stackoverflow 上实现类似于“相关问题”的功能。
我该如何编写 SQL 语句,以便在我的数据库的 Title 和 Summary 字段中搜索类似问题?
如果我的问题是:“用于在 Stackoverflow 上进行类似于“相关问题”的搜索的 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/