SQL 2005 XML 搜索

发布于 2024-09-29 03:26:46 字数 220 浏览 2 评论 0原文

我在 SQL Server 的 Xml 列中有一个大型 XML 文档。我基本上需要对文档中的元素执行自由文本搜索。

你会用吗 A) SQL 自由文本搜索 B) 遍历 XML 并检查每个元素的每个值的存储过程 C) 使用 Lucene.NET 动态构建索引并搜索索引?

用户知道这会在某种程度上变慢。如果存储过程不是一个难以编写的怪物,我会倾向于它,因为它是最不需要维护的并且降低了整体复杂性。

I have a large XML document in Xml column within SQL Server. I need to basically perform a free text search across the elements in the document.

Would you use
A) SQL Free Text Search
B) A stored procedure that traverses the XML and checks each value of each element
C) Use Lucene.NET to build an Index on the fly and search the index?

Users understand this will be slow to some degree. If the stored procedure wasn't a monster to write I'd lean toward that because its the least to maintain and decreases overall complexity.

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

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

发布评论

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

评论(1

娇柔作态 2024-10-06 03:26:46

“Pro SQL Server 2008 XML”一书中有一个关于 XML 数据的全文索引的部分,您可能会感兴趣。它提到,当对 XML 数据进行索引时,会使用特殊的“XML Word Breaker”将文本内容与标记分开。本质上,这意味着只有内容被索引,而不是标记。全文索引还支持词干提取和同义词库匹配。

刚刚注意到您正在使用 SQL Server 2005,因此您必须检查是否支持此功能。我怀疑是的。

The book "Pro SQL Server 2008 XML" has a section on Full-Text indexing of XML data that may be of interest to you. It mentions that when XML data is indexed a special "XML Word Breaker" is used to separate text content from the markup. Essentially this means is that only the content is indexed, not the markup. Full text indexes also support stemming and thesaurus matching.

Just noticed that you are using SQL Server 2005, so you'll have to check if this functionality is supported. I suspect that it is.

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