ASP.NET 中搜索的拼写检查器

发布于 2024-10-06 16:02:45 字数 442 浏览 6 评论 0原文

我正在构建一个搜索,我需要在其中实现几个功能。

1-它应该带来所有同义词,就像如果有人搜索沙发,它应该带来该沙发的匹配结果以及语言匹配,例如(沙发、垫子等)。为了实现这一点,我使用全文搜索。

在我的查询中,我使用 FreeText 但它不会产生所需的结果。这就是我所做的,

select * from Furn_Products Where FreeText(FurnName, 'Couch');

它应该使包含 Cushions、Sofa 和 Couch 的名称偏离当然,但它只带来包含 Couch 的名称,我也可以通过简单的 Like 查询来完成。有什么解决办法吗?

2-我需要检查拼写错误,比如如果有人输入 soofa,它应该会带来沙发、沙发等的结果。

关于如何实现这一点有什么提示和想法吗?提前致谢。

I am building a search where I need to implement couple of features in it among others.

1- It should bring all synonyms, like if someone searches for couch, it should bring in matching results for that couch plus linguistic matches like (sofas, cushions etc). To accomplish that I am using Full Text Search.

In my query I use FreeText but it does not yield the required results. That's what I do,

select * from Furn_Products Where FreeText(FurnName, 'Couch');

It should bring Names containing Cushions, Sofa and Couch off course but it only brings Names with Couch which I could also do by simple Like query. Any solutions?

2- I need to check for typos, like if someone types soofa, it should bring in results for sofa, couch etc.

Any tips, ideas on how to achieve this? Thanks in advance.

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

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

发布评论

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

评论(3

风筝在阴天搁浅。 2024-10-13 16:02:45

我同意 Nelson 的观点,已经有很多开源搜索引擎,并且它们已经经过了大量的调试。最大的是 Lucene/Solr、Sphinx 和 Xapian。

另外,添加同义词扩展时要小心。例如,如果将 paddle 扩展为 bat,您可能会得到很多您不想要的动物学结果。如果您正在进行自动查询。找到一些示例并设置带有极端情况的测试套件。如果您希望有人类用户,请找一些人来引导您完成他们的流程以帮助构建您的测试套件,并计划对搜索日志非常友好。祝你好运!

I agree with Nelson, there are lots of open-source search engines already out there, and they have gone through a lot of debugging. The biggest ones are Lucene/Solr, Sphinx, and Xapian.

Also, be careful when adding synonym expansion. If you expand paddle, for example, to bat, you might get a lot of zoological results you don't want. If you're doing automated queries. find some examples and set up a test suite with corner cases. If you expect to have human users, find a couple who will walk you through their processes to help build your test suite, and plan to get very friendly with the search logs. Best of luck!

泛泛之交 2024-10-13 16:02:45

据我所知,全文搜索并不能让您访问所有可能的单词(词干等)。但从 SQL Server 2008 开始,您可以获得所有索引词的列表。

要获得更多功能,您可能必须使用 Lucene 等第三方索引器。

As far as I know, Full Text Search doesn't give you access to all the possible words (stemming, etc.). But starting with SQL Server 2008 you can get a list of all the indexed words.

For more features you would probably have to go with a 3rd party indexer like Lucene.

不必你懂 2024-10-13 16:02:45

You can explicitly define matches by configuring the thesaurus.

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