我可以定义在构建 mssql 全文索引时使用哪些断字符吗?
我创建了一个全文目录,用于存储表中某些列的数据,但内容似乎已被我不想被视为单词分隔符的字符分开。 (“/”、“-”、“_”等..)
我知道我可以设置断字符的语言,并且 http://msdn.microsoft.com/en-us/library/ms345188.aspx 提供了一些有关如何安装新语言的想法 - 但我需要比因为所有这些语言仍然会破坏我不想破坏的字符。
有没有办法定义我自己的语言来查找断字符?
I have created a fulltext catalog that stores the data from some of the columns in a table, but the contents seem to have been split apart by characters that I don't really want to be considered word delimiters. ("/", "-", "_" etc..)
I know that I can set the language for word breaker, and http://msdn.microsoft.com/en-us/library/ms345188.aspx gives som idea on how to install new languages - but I need more direct control than that, because all of those languages still break on the characters I want to not break on.
Is there a way to define my own language to use for finding word breakers?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
全文索引在索引时仅考虑字符 _ 和 `。所有其他字符都将被忽略,并且单词会在这些字符出现的地方被分割。这主要是因为全文索引旨在索引大型文档,并且只考虑适当的单词以使其成为更精细的搜索。
我们遇到了类似的问题。为了解决这个问题,我们实际上有一个翻译表,其中 @、-、/ 等字符被替换为特殊序列,例如 '`at`'、'`dash `'、'`斜杠`'等。在全文搜索时,您必须再次用这些特殊序列替换搜索字符串中的字符并进行搜索。这应该照顾特殊字符。
Full text indexes only consider the characters _ and ` while indexing. All the other characters are ignored and the words get split where these characters occur. This is mainly because full text indexes are designed to index large documents and there only proper words are considered to make it a more refined search.
We faced a similar problem. To solve this we actually had a translation table, where characters like @,-, / were replaced with special sequences like '`at`','`dash`','`slash`' etc. While searching in the full text, u've to again replace ur characters in the search string with these special sequences and search. This should take care of the special characters.
配置 FTS 索引的能力在开箱即用时相当有限。我不认为你可以使用语言来做到这一点。
如果您愿意接受挑战,并且能够了解一些 C++ 知识,那么您始终可以编写自定义 IFilter 实现。这不是微不足道的,但也不是太难。 请参阅此处了解 IFilter 资源。
The ability to configure FTS indexing is fairly limited out of the box. I don't think that you can use languages to do this.
If you are up for a challenge, and have access to some C++ knowledge, you can always write a custom IFilter implementation. It's not trivial, but not too difficult. See here for IFilter resources.