SQL 2008 全文搜索词邻近度

发布于 2024-09-12 22:04:07 字数 381 浏览 0 评论 0原文

我一直在 MSDN 和其他地方阅读 CONTAINS、FREETEXT、CONTAINSTABLE 等的全文帮助文件,但我无法找到我正在寻找的解决方案。

我希望能够使用以下条件进行查询:

示例值:“敏捷的棕色狐狸跳过了懒狗。”

Select * from MyText where CONTAINS(column, 'brown near lazy').

我希望能够返回单词“brown”与“lazy”的距离在 n 个单词之内的结果,例如,“brown”与“lazy”的距离在 5 个单词之内。

这是否可以通过全文搜索实现,如果可以,有人可以提供一个例子吗?

谢谢

I have been reading the Full Text help files for CONTAINS, FREETEXT, CONTAINSTABLE and so forth on MSDN and elsewhere, but I am not able to find the solution I am looking for.

I would like to be able to query with the following criteria:

Example value: "The quick brown fox jumped over the lazy dogs."

Select * from MyText where CONTAINS(column, 'brown near lazy').

I want to be able to return results where the word brown is within an n number of words from lazy, so for example, brown is within 5 words of lazy.

Is this even possible with the full text search, and if so, can someone provide an example?

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

別甾虛僞 2024-09-19 22:04:07

基于这篇文章 我想说这是不可能的。

摘抄:

你无法定义级别
距离近,也无法指定
按单词、句子的间隔距离,
段落、页面、章节或书籍
在其他 Microsoft 搜索中也可以这样做
产品。这本来应该运送到
SQL 2008 但被砍掉了。

50字后的间隔距离
对排名的贡献为 0 但他们
仍会出现在搜索中。

Based on this post i'd say it can't be done.

Excerpt:

you can't define the level of
nearness, nor can you specify
separation distance by word, sentence,
paragraph, page, chapter or book the
way you can in other Microsoft Search
products. This was supposed to ship in
SQL 2008 but was cut.

After 50 words of separation distance
the contribution to rank is 0 but they
will still show up in searches.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文