【发布时间】:2011-10-15 12:52:55
【问题描述】:
假设我们有一个带有全文字段的表格。该字段称为text。表格的内容是:
car wash
car and wash
and这个词在我的stoplist中
现在,我将使用这个 sql 查询这个表:
select * from mytable
where contains(text, '"car wash"')
此查询仅返回 car wash 行,而不返回 car and wash 行。通过假设单词and 是停用词,为什么Sql 不返回car and wash 行?
我知道我正在进行短语搜索(使用“”)。这正是我所需要的,但我认为 Sql 应该忽略停止列表中的单词,这不是正在发生的事情。快把我逼疯了。
我的理解是,当 FT 算法找到像 car and wash 这样的短语时,它只会索引 car 和 wash。这是真的吗?
此外,当我查询 ft_parser 时,它说出了我的预期:
SELECT * FROM sys.dm_fts_parser ('"car and wash"', 1033, 5, 0)
special_term display_term
Exact Match car
Noise Word and
Exact Match wash
有什么想法吗?
【问题讨论】:
标签: sql-server sql-server-2008 full-text-search stop-words